Przeglądaj źródła

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
Ken Chong 5 lat temu
rodzic
commit
02df2bfea5

+ 2 - 1
cli/tauri.js/src/helpers/tauri-config.ts

@@ -31,7 +31,8 @@ const getTauriConfig = (cfg: Partial<TauriConfig>): TauriConfig => {
       ctx: {},
       tauri: {
         embeddedServer: {
-          active: true
+          active: true,
+          port: "3000"
         },
         bundle: {
           active: true,

+ 5 - 1
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"
-}
+}

+ 1 - 0
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

+ 4 - 0
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"