diff --git a/cli/create.ts b/cli/create.ts index e816955..05a6378 100644 --- a/cli/create.ts +++ b/cli/create.ts @@ -13,7 +13,7 @@ async function execute (): Promise { }, 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 }, @@ -26,7 +26,7 @@ async function execute (): Promise { 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, diff --git a/lib/generator.ts b/lib/generator.ts index 3f58195..6b72435 100644 --- a/lib/generator.ts +++ b/lib/generator.ts @@ -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: [ @@ -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 {