From 8d13356808ab5c725d9c8ff8dbbce1bc0579d529 Mon Sep 17 00:00:00 2001 From: Janik Schumacher Date: Wed, 2 Mar 2022 12:18:41 +0100 Subject: [PATCH] Use "number" for port parameter during init --- libs/mf/src/schematics/mf/schema.d.ts | 4 ++-- libs/mf/src/schematics/mf/schema.json | 2 +- libs/mf/src/schematics/mf/schematic.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/mf/src/schematics/mf/schema.d.ts b/libs/mf/src/schematics/mf/schema.d.ts index 91709f30..9f45178d 100644 --- a/libs/mf/src/schematics/mf/schema.d.ts +++ b/libs/mf/src/schematics/mf/schema.d.ts @@ -1,5 +1,5 @@ export interface MfSchematicSchema { project: string; - port: string; - nxBuilders: boolean | undefined + port: number; + nxBuilders: boolean | undefined; } diff --git a/libs/mf/src/schematics/mf/schema.json b/libs/mf/src/schematics/mf/schema.json index abac4dad..01786883 100644 --- a/libs/mf/src/schematics/mf/schema.json +++ b/libs/mf/src/schematics/mf/schema.json @@ -14,7 +14,7 @@ "x-prompt": "Project name (press enter for default project)" }, "port": { - "type": "string", + "type": "number", "description": "The port to use for the federated module (remote, micro frontend, etc.)", "x-prompt": "Port to use", "$default": { diff --git a/libs/mf/src/schematics/mf/schematic.ts b/libs/mf/src/schematics/mf/schematic.ts index ab838d09..be3ac2c1 100644 --- a/libs/mf/src/schematics/mf/schematic.ts +++ b/libs/mf/src/schematics/mf/schematic.ts @@ -192,7 +192,7 @@ export default function config (options: MfSchematicSchema): Rule { const configPath = path.join(projectRoot, 'webpack.config.js').replace(/\\/g, '/'); const configProdPath = path.join(projectRoot, 'webpack.prod.config.js').replace(/\\/g, '/'); - const port = parseInt(options.port); + const port = options.port; const main = projectConfig.architect.build.options.main; const relWorkspaceRoot = path.relative(projectRoot, '');