feat(TypeScript): Add the workflow file for CI check (#1280)
* feat(TypeScript): Add the workflow file for CI check * fix: Install TypeScript Execute (tsx) * test: Test failed * test: Test successful * test: on windows * Add a bug * feat: type checking * test: Test successful * feat: add main * fix: use process * feat: use es-main * Test failure * feat: streamlined configuration * Apply suggestions from code review Co-authored-by: Yudong Jin <krahets@163.com> * feat: remove lock file * Test failure * Test success --------- Co-authored-by: Yudong Jin <krahets@163.com>pull/1293/head
parent
499419e4ce
commit
587344da62
@ -0,0 +1,26 @@
|
||||
name: TypeScript
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['main']
|
||||
paths: ['codes/typescript/**/*.ts']
|
||||
pull_request:
|
||||
branches: ['main']
|
||||
paths: ['codes/typescript/**/*.ts']
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
- name: Install dependencies
|
||||
run: cd codes/typescript && npm install
|
||||
- name: Check TypeScript code
|
||||
run: cd codes/typescript && npm run check
|
@ -1,4 +1,2 @@
|
||||
node_modules
|
||||
out
|
||||
package.json
|
||||
package-lock.json
|
||||
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"check": "tsc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.12.7",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
}
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES6",
|
||||
"module": "CommonJS",
|
||||
"outDir": "out",
|
||||
"sourceMap": true
|
||||
}
|
||||
"baseUrl": ".",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"types": ["@types/node"],
|
||||
"noEmit": true,
|
||||
"target": "esnext",
|
||||
},
|
||||
"include": ["chapter_*/*.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
Loading…
Reference in new issue