From 02df2bfea548e670516bff9fcf1965df86eaa4b3 Mon Sep 17 00:00:00 2001 From: Ken Chong Date: Thu, 9 Jul 2020 20:06:04 +0800 Subject: [PATCH] to enable custom port (#782) * to enable custom port current validator doesn't enable port config, with this patch would have allow the config, however this doesn't include the runner changes... runner might need changes too. * Update config.schema.json * Update config.validator.ts --- cli/tauri.js/src/helpers/tauri-config.ts | 3 ++- cli/tauri.js/src/types/config.schema.json | 6 +++++- cli/tauri.js/src/types/config.ts | 1 + cli/tauri.js/src/types/config.validator.ts | 4 ++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cli/tauri.js/src/helpers/tauri-config.ts b/cli/tauri.js/src/helpers/tauri-config.ts index b2d038fcd..8931d4258 100644 --- a/cli/tauri.js/src/helpers/tauri-config.ts +++ b/cli/tauri.js/src/helpers/tauri-config.ts @@ -31,7 +31,8 @@ const getTauriConfig = (cfg: Partial): TauriConfig => { ctx: {}, tauri: { embeddedServer: { - active: true + active: true, + port: "3000" }, bundle: { active: true, diff --git a/cli/tauri.js/src/types/config.schema.json b/cli/tauri.js/src/types/config.schema.json index 7791c4485..78493e630 100644 --- a/cli/tauri.js/src/types/config.schema.json +++ b/cli/tauri.js/src/types/config.schema.json @@ -399,6 +399,10 @@ "active": { "description": "whether we should use the embedded-server or the no-server mode", "type": "boolean" + }, + "port": { + "description": "enable custom port, instead of using random port", + "type": "string" } }, "type": "object" @@ -486,4 +490,4 @@ "tauri" ], "type": "object" -} \ No newline at end of file +} diff --git a/cli/tauri.js/src/types/config.ts b/cli/tauri.js/src/types/config.ts index d38a53703..2369bc28a 100644 --- a/cli/tauri.js/src/types/config.ts +++ b/cli/tauri.js/src/types/config.ts @@ -223,6 +223,7 @@ export interface TauriConfig { * whether we should use the embedded-server or the no-server mode */ active?: boolean + port?: string } /** * tauri bundler configuration diff --git a/cli/tauri.js/src/types/config.validator.ts b/cli/tauri.js/src/types/config.validator.ts index 5fb6d5534..005c70a92 100644 --- a/cli/tauri.js/src/types/config.validator.ts +++ b/cli/tauri.js/src/types/config.validator.ts @@ -409,6 +409,10 @@ export const TauriConfigSchema = { "active": { "description": "whether we should use the embedded-server or the no-server mode", "type": "boolean" + }, + "port": { + "description": "enable custom port, instead of using random port", + "type": "string" } }, "type": "object"