Skip to content

Commit

Permalink
fix: set front-end to Node v20, fix use of ts-node
Browse files Browse the repository at this point in the history
  • Loading branch information
travellingprog committed Oct 27, 2023
1 parent 5c10eea commit 63fccea
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-preview-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node v18.x
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: './web/.node-version'
- name: Restore node_modules for web
id: cache-web
uses: actions/cache@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node v18.x
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: './web/.node-version'
- name: Restore node_modules for web
id: cache-web
uses: actions/cache@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node v18.x
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: './web/.node-version'
- name: Restore node_modules for web
id: cache-web
uses: actions/cache@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jsonlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node LTS
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: './web/.node-version'
- name: Install jsonlint-mod
run: |
npm install -g jsonlint-mod
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node v18.x
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: './web/.node-version'
- name: Restore node_modules for web
id: cache-web
uses: actions/cache@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node v18.x
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: './web/.node-version'
- name: Restore node_modules for web
id: cache-web
uses: actions/cache@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node v18.x
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: './web/.node-version'
- name: Restore node_modules for web
id: cache-web
uses: actions/cache@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate_generate_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node v18.x
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: './web/.node-version'
- name: Restore node_modules for web
id: cache-web
uses: actions/cache@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate_generated_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node v18.x
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: './web/.node-version'
- name: Restore node_modules
id: cache
uses: actions/cache@v3
Expand Down
1 change: 1 addition & 0 deletions mockserver/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
1 change: 1 addition & 0 deletions web/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
6 changes: 3 additions & 3 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"build": "pnpm update-version && vite build",
"update-version": "echo '{\"version\": \"'$npm_package_version'\"}' > public/client-version.json",
"create-generated-files": "pnpm run generate-world && pnpm run generate-zones-config",
"generate-world": "ts-node --esm ./geo/generateWorld.ts",
"generate-zones-config": "ts-node --esm ./scripts/generateZonesConfig.ts",
"generate-world": "node --import=./scripts/register-tsNodeESM.js ./geo/generateWorld.ts",
"generate-zones-config": "node --import=./scripts/register-tsNodeESM.js ./scripts/generateZonesConfig.ts",
"predev": "pnpm run create-generated-files",
"dev": "vite --open",
"cy:component": "cypress open --component -b electron",
Expand Down Expand Up @@ -195,7 +195,7 @@
"workbox-window": "7.0.0"
},
"engines": {
"node": ">=18",
"node": "^20",
"pnpm": "^8"
}
}
3 changes: 3 additions & 0 deletions web/scripts/register-tsNodeESM.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { register } from 'node:module';
import { pathToFileURL } from 'node:url';
register('ts-node/esm', pathToFileURL('./'));

0 comments on commit 63fccea

Please sign in to comment.