소스 검색

ref: unimportant stuff

Sv443 3 달 전
부모
커밋
9d45f5bf84
3개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  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)).  
   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.  
   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.  
   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`**  
 - **`pnpm run build-prod`**  
   Builds the userscript for production for all hosts with their respective options already set.  
   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.  
   Outputs the files using a suffix predefined in the `package.json` file.  

+ 2 - 1
package.json

@@ -8,10 +8,11 @@
   "type": "module",
   "type": "module",
   "scripts": {
   "scripts": {
     "dev": "concurrently \"nodemon --exec pnpm run build-private-dev\" \"pnpm run serve\"",
     "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",
     "serve": "pnpm run node-ts ./src/tools/serve.ts",
     "lint": "eslint . && tsc --noEmit",
     "lint": "eslint . && tsc --noEmit",
     "build": "rollup -c",
     "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",
     "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",
     "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",
     "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 */
 /** Whether to log requests to the console */
 const enableLogging = false;
 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 */
 /** 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();
 const app = express();