Skip to content

Commit

Permalink
Only generate plugin when asked for it
Browse files Browse the repository at this point in the history
  • Loading branch information
flakey5 committed Mar 28, 2024
1 parent a617e64 commit d6780cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cli/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function execute (): Promise<void> {
},
port: { type: 'string', default: '3042' },
hostname: { type: 'string', default: '0.0.0.0' },
plugins: { type: 'boolean', default: true },
plugin: { type: 'boolean', default: true },
tests: { type: 'boolean', default: true },
typescript: { type: 'boolean', default: false },
git: { type: 'boolean', default: false },
Expand All @@ -26,7 +26,7 @@ async function execute (): Promise<void> {
generator.setConfig({
port: parseInt(args.values.port as string),
hostname: args.values.hostname,
plugins: args.values.plugins,
plugin: args.values.plugin,
tests: args.values.tests,
typescript: args.values.typescript,
initGitRepository: args.values.git,
Expand Down
7 changes: 4 additions & 3 deletions lib/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class AiWarpGenerator extends ServiceGenerator {
}
}

if (this.config.plugins) {
if (this.config.plugin !== undefined && this.config.plugin) {
Object.assign(config, {
plugins: {
paths: [
Expand Down Expand Up @@ -125,8 +125,9 @@ class AiWarpGenerator extends ServiceGenerator {
contents: JSON.stringify(schema, null, 2)
})

// TODO: typescript & make this optional
this.addFile(generatePluginWithTypesSupport(false))
if (this.config.plugin !== undefined && this.config.plugin) {
this.addFile(generatePluginWithTypesSupport(this.config.typescript ?? false))
}
}

async getStackablePackageJson (): Promise<PackageJson> {
Expand Down

0 comments on commit d6780cf

Please sign in to comment.