Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
Closes #5
  • Loading branch information
flakey5 committed Mar 26, 2024
1 parent 2fbb42b commit 4e5bdc1
Show file tree
Hide file tree
Showing 8 changed files with 595 additions and 5 deletions.
9 changes: 7 additions & 2 deletions lib/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ class AiWarpGenerator extends ServiceGenerator {
const defaultBaseConfig = super.getDefaultConfig()
const defaultConfig = {
aiProvider: 'openai',
aiModel: 'gpt-3.5-turbo'
aiModel: 'gpt-3.5-turbo',
// TODO: temporary fix, when running the typescript files directly
// (in tests) this goes a directory above the actual project. Exposing
// temporarily until I come up with something better
aiWarpPackageJsonPath: join(__dirname, '..', '..', 'package.json')
}
return Object.assign({}, defaultBaseConfig, defaultConfig)
}
Expand Down Expand Up @@ -131,7 +135,8 @@ class AiWarpGenerator extends ServiceGenerator {

async getStackablePackageJson (): Promise<PackageJson> {
if (this._packageJson == null) {
const packageJsonPath = join(__dirname, '..', '..', 'package.json')
// const packageJsonPath = join(__dirname, '..', '..', 'package.json')
const packageJsonPath = this.config.aiWarpPackageJsonPath
const packageJsonFile = await readFile(packageJsonPath, 'utf8')
const packageJson: Partial<PackageJson> = JSON.parse(packageJsonFile)

Expand Down
Loading

0 comments on commit 4e5bdc1

Please sign in to comment.