Ver código fonte

ref: unimportant stuff

Sv443 3 meses atrás
pai
commit
9d45f5bf84
3 arquivos alterados com 5 adições e 3 exclusões
  1. 1 0
      contributing.md
  2. 2 1
      package.json
  3. 2 2
      src/tools/serve.ts

+ 1 - 0
contributing.md

@@ -110,6 +110,7 @@ To edit an existing translation, please follow these steps:
   It watches for any changes, then rebuilds and serves the userscript on port 8710, so it can be updated live if set up correctly in the userscript manager (see [extras](#extras)).  
   Once it has finished building, a link will be printed to the console. Open it to install the userscript.  
   You can also configure request logging and more in `.env` and `src/tools/serve.ts`, just make sure to restart the dev server after changing anything.  
+  If you need to test with resources that weren't committed and pushed to GitHub yet, you may use `pnpm run dev-local` instead.
 - **`pnpm run build-prod`**  
   Builds the userscript for production for all hosts with their respective options already set.  
   Outputs the files using a suffix predefined in the `package.json` file.  

+ 2 - 1
package.json

@@ -8,10 +8,11 @@
   "type": "module",
   "scripts": {
     "dev": "concurrently \"nodemon --exec pnpm run build-private-dev\" \"pnpm run serve\"",
+    "dev-local": "concurrently \"nodemon --exec pnpm run build-private-dev --config-assetSource=local\" \"pnpm run serve\"",
     "serve": "pnpm run node-ts ./src/tools/serve.ts",
     "lint": "eslint . && tsc --noEmit",
     "build": "rollup -c",
-    "build-private-dev": "rollup -c --config-mode development --config-host github --config-branch develop --config-assetSource=local",
+    "build-private-dev": "rollup -c --config-mode development --config-host github --config-branch develop",
     "build-dev": "rollup -c --config-mode development --config-host github --config-branch develop",
     "preview": "pnpm run build-prod-gh --config-assetSource=local && pnpm run serve --auto-exit-time=6",
     "build-prod": "pnpm run build-prod-gh && pnpm run build-prod-gf && pnpm run build-prod-oujs",

+ 2 - 2
src/tools/serve.ts

@@ -16,9 +16,9 @@ const devServerPort = isNaN(envPort) || envPort === 0 ? 8710 : envPort;
 /** Whether to log requests to the console */
 const enableLogging = false;
 
-const autoExitRaw = argv.find(arg => arg.startsWith("--auto-exit-time="))?.split("=")[1];
+const autoExitRaw = Number(argv.find(arg => arg.startsWith("--auto-exit-time="))?.split("=")[1]);
 /** Time in milliseconds after which the process should automatically exit */
-const autoExitTime: number | undefined = !isNaN(Number(autoExitRaw)) ? Number(autoExitRaw) * 1000 : undefined;
+const autoExitTime: number | undefined = !isNaN(autoExitRaw) ? autoExitRaw * 1000 : undefined;
 
 const app = express();