mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
napi: Catch typescript errors in the CI and in debug builds (#3703)
We use esbuild to transform index.ts into index.js, but we also need to perform a type check. esbuild doesn't do that, this is left to the typescript compiler. So let's run it with -noEmit as recommended by the esbuild folks, in debug builds as well as in the CI (which doesn't do debug builds).
This commit is contained in:
parent
75b3a3e07b
commit
403bb6c716
2 changed files with 5 additions and 1 deletions
3
.github/workflows/ci.yaml
vendored
3
.github/workflows/ci.yaml
vendored
|
@ -178,6 +178,9 @@ jobs:
|
|||
- name: Run npm install
|
||||
working-directory: ./api/napi
|
||||
run: npm install
|
||||
- name: Typescript check
|
||||
working-directory: ./api/napi
|
||||
run: npm run syntax_check
|
||||
- name: Run napi tests
|
||||
working-directory: ./api/napi
|
||||
run: npm test
|
||||
|
|
|
@ -24,11 +24,12 @@
|
|||
"artifacts": "napi artifacts",
|
||||
"compile": "esbuild index.ts --bundle --external:*.node --format=cjs --platform=node --outfile=index.js",
|
||||
"build": "napi build --platform --release --js rust-module.js --dts rust-module.d.ts && npm run compile",
|
||||
"build:debug": "napi build --platform --js rust-module.js --dts rust-module.d.ts && npm run compile",
|
||||
"build:debug": "napi build --platform --js rust-module.js --dts rust-module.d.ts && npm run compile && npm run syntax_check",
|
||||
"install": "npm run build",
|
||||
"docs": "npm run build && typedoc --hideGenerator --treatWarningsAsErrors --readme cover.md index.ts",
|
||||
"prepublishOnly": "napi prepublish -t npm",
|
||||
"test": "ava",
|
||||
"syntax_check": "tsc -noEmit index.ts",
|
||||
"universal": "napi universal",
|
||||
"version": "1.3.0"
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue