Skip to content

Commit

Permalink
add typecheck to ci, always prepare data
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Sep 27, 2023
1 parent 2f35f00 commit 25d858e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Install pnpm
run: npm i -g pnpm
- run: pnpm install
- run: pnpm build
- run: pnpm check-build
- run: nohup pnpm prod-start &
- run: nohup node cypress/minecraft-server.mjs &
- uses: cypress-io/github-action@v5
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"start": "node scripts/build.js copyFilesDev && node scripts/prepareData.mjs && node esbuild.mjs --watch",
"start-watch-script": "nodemon -w esbuild.mjs esbuild.mjs",
"build": "node scripts/build.js copyFiles && node scripts/prepareData.mjs && node esbuild.mjs --minify --prod",
"build": "node scripts/build.js copyFiles && node scripts/prepareData.mjs -f && node esbuild.mjs --minify --prod",
"check-build": "tsc && pnpm build",
"watch": "node scripts/build.js copyFilesDev && webpack serve --config webpack.dev.js --progress",
"test:cypress": "cypress run",
"test:e2e": "start-test http-get://localhost:8080 test:cypress",
Expand All @@ -31,6 +32,7 @@
"browserfs": "github:zardoy/browserfs#build",
"compression": "^1.7.4",
"cypress-plugin-snapshots": "^1.4.4",
"debug": "^4.3.4",
"diamond-square": "^1.2.0",
"eruda": "^3.0.1",
"esbuild": "^0.19.3",
Expand All @@ -56,8 +58,7 @@
"url": "^0.11.1",
"valtio": "^1.11.1",
"minecraft-assets": "^1.9.1",
"workbox-build": "^7.0.0",
"debug": "^4.3.4"
"workbox-build": "^7.0.0"
},
"devDependencies": {
"@types/three": "0.128.0",
Expand Down Expand Up @@ -93,6 +94,7 @@
"style-loader": "^3.3.3",
"three": "0.128.0",
"timers-browserify": "^2.0.12",
"typescript": "^5.2.2",
"url-loader": "^4.1.1",
"use-typed-event-listener": "^4.0.2",
"vite": "^4.4.9",
Expand Down
23 changes: 17 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/prepareData.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { existsSync } from 'node:fs'
import Module from "node:module"
import { dirname } from 'node:path'

if (existsSync('dist/mc-data')) {
if (existsSync('dist/mc-data') && !process.argv.includes('-f')) {
console.log('using cached prepared data')
process.exit(0)
}
Expand Down
16 changes: 11 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{
"compilerOptions": {
"target": "ES2022",
"target": "ESNext",
"moduleResolution": "Node",
"module": "CommonJS",
"module": "ESNext",
"allowJs": true,
"jsx": "react-jsx",
"allowSyntheticDefaultImports": true,
"noEmit": true,
"strictFunctionTypes": true,
"resolveJsonModule": true,
"noFallthroughCasesInSwitch": true
"strictFunctionTypes": true,
"noImplicitAny": false,
"noFallthroughCasesInSwitch": true,
"allowUnreachableCode": true,
"forceConsistentCasingInFileNames": true,
"useUnknownInCatchVariables": false,
"skipLibCheck": true
// "strictNullChecks": true
},
"include": [
"src"
"src",
"cypress"
]
}

0 comments on commit 25d858e

Please sign in to comment.