From 96765b4c9c6bfb34ee4a60f33d1ff20fb2e904a0 Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Tue, 12 May 2020 15:17:31 +0200 Subject: [PATCH] fix(create): Fix use of deprecated port option --- packages/create/src/create-vendure-app.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/create/src/create-vendure-app.ts b/packages/create/src/create-vendure-app.ts index 8ac3f0d52c..943f1e86aa 100644 --- a/packages/create/src/create-vendure-app.ts +++ b/packages/create/src/create-vendure-app.ts @@ -38,7 +38,7 @@ program .version(packageJson.version) .arguments('') .usage(`${chalk.green('')} [options]`) - .action(name => { + .action((name) => { projectName = name; }) .option( @@ -116,7 +116,7 @@ async function createApp( { title: 'Installing dependencies', task: (() => { - return new Observable(subscriber => { + return new Observable((subscriber) => { subscriber.next('Creating package.json'); fs.writeFileSync( path.join(root, 'package.json'), @@ -137,14 +137,14 @@ async function createApp( } }) .then(() => subscriber.complete()) - .catch(err => subscriber.error(err)); + .catch((err) => subscriber.error(err)); }); }) as any, }, { title: 'Generating app scaffold', - task: ctx => { - return new Observable(subscriber => { + task: (ctx) => { + return new Observable((subscriber) => { fs.ensureDirSync(path.join(root, 'src')); const assetPath = (fileName: string) => path.join(__dirname, '../assets', fileName); const srcPathScript = (fileName: string): string => @@ -179,13 +179,13 @@ async function createApp( subscriber.next(`Copied email templates`); subscriber.complete(); }) - .catch(err => subscriber.error(err)); + .catch((err) => subscriber.error(err)); }); }, }, { title: 'Initializing server', - task: async ctx => { + task: async (ctx) => { try { if (usingTs) { // register ts-node so that the config file can be loaded @@ -212,7 +212,10 @@ async function createApp( await checkDbConnection(config.dbConnectionOptions, root); return bootstrap({ ...config, - port, + apiOptions: { + ...(config.apiOptions ?? {}), + port, + }, silent: logLevel === 'silent', dbConnectionOptions: { ...config.dbConnectionOptions,