Skip to content

Commit

Permalink
build: migrate to Typescript v5 (#829)
Browse files Browse the repository at this point in the history
- Use TypeScript 5.0
- Change `tsconfig` to use multiple extends
- Change build target to es2021
  • Loading branch information
nogic1008 committed Apr 12, 2023
1 parent 5839f30 commit 7264020
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 28 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,11 @@ jobs:
id: compare
continue-on-error: true
run: |
echo "# Compare ${{ github.sha }} to main" >> $GITHUB_STEP_SUMMARY
git diff --no-index --exit-code ./dist/ ./current/ >> $GITHUB_STEP_SUMMARY
echo '# Compare ${{ github.sha }} to main' >> $GITHUB_STEP_SUMMARY
echo '```diff' >> $GITHUB_STEP_SUMMARY
git diff --no-index ./dist/ ./current/ >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
git diff --no-index --exit-code ./dist/ ./current/
- name: Report diff
if: steps.compare.outcome == 'failure'
Expand All @@ -149,5 +152,5 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `${message} [Show More](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})`
body: `${message} [Show More](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})`
})
48 changes: 30 additions & 18 deletions package-lock.json

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

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"scripts": {
"prepare": "husky install",
"build": "ncc build src/main.ts -m --license licenses.txt --target es2019",
"build": "ncc build src/main.ts -m --license licenses.txt --target es2021",
"fix": "run-p \"lint:eslint --fix\" \"lint:prettier --write\"",
"lint": "run-p lint:*",
"lint:eslint": "eslint --ext .ts --ignore-path .gitignore .",
Expand All @@ -37,7 +37,8 @@
},
"devDependencies": {
"@octokit/webhooks-types": "^6.10.0",
"@tsconfig/node16-strictest": "^1.0.4",
"@tsconfig/node16": "^1.0.3",
"@tsconfig/strictest": "^2.0.0",
"@types/node": "^16.18.23",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
Expand All @@ -52,7 +53,7 @@
"lint-staged": "^13.2.0",
"npm-run-all2": "^6.0.4",
"prettier": "^2.8.7",
"typescript": "~4.9.5",
"typescript": "~5.0.4",
"vitest": "^0.29.8"
}
}
10 changes: 6 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"extends": "@tsconfig/node16-strictest/tsconfig.json",
"extends": [
"@tsconfig/node16/tsconfig.json",
"@tsconfig/strictest/tsconfig.json"
],
"compilerOptions": {
"rootDir": "./src",
"checkJs": false
"rootDir": "src"
},
"exclude": ["node_modules", "test", "*.config.ts"]
"exclude": ["coverage", "node_modules", "test", "*.config.ts"]
}

0 comments on commit 7264020

Please sign in to comment.