Skip to content

Commit 9d53581

Browse files
authored
Support typescript 5.2 (#41)
1 parent 43e50fb commit 9d53581

File tree

16 files changed

+1101
-980
lines changed

16 files changed

+1101
-980
lines changed

.github/workflows/check-pr-reviews.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ jobs:
88
checkPrReviews:
99
runs-on: ubuntu-latest
1010
name: Check PR Reviews
11-
strategy:
12-
matrix:
13-
node-version: [18.x]
1411
steps:
1512
- name: Perform Check of PR Reviews
1613
uses: checkdigit/github-actions/check-pr-reviews@main
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Check Published
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '30 20 * * *'
7+
8+
jobs:
9+
checkPublished:
10+
runs-on: ubuntu-latest
11+
name: Check Published
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
ref: ${{ github.event.pull_request.head.sha }}
16+
- name: Check Published
17+
uses: checkdigit/github-actions/check-published@main
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH }}
21+
DEBUG: '*'
22+
SLACK_PUBLISH_MISMATCH: ${{ secrets.SLACK_PUBLISH_MISMATCH }}

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
with:
2020
node-version: ${{ matrix.node-version }}
2121
cache: 'npm'
22+
- name: Check Label
23+
uses: checkdigit/github-actions/check-label@main
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2226
- name: Install dependencies
2327
run: npm ci --ignore-scripts
2428
- name: Audit Signatures
@@ -47,6 +51,10 @@ jobs:
4751
with:
4852
node-version: ${{ matrix.node-version }}
4953
cache: 'npm'
54+
- name: Check Label
55+
uses: checkdigit/github-actions/check-label@main
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5058
- name: Install dependencies
5159
run: npm ci --ignore-scripts
5260
- name: Audit Signatures

.github/workflows/publish-beta.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ jobs:
99
publishBeta:
1010
runs-on: ubuntu-latest
1111
name: Publish Beta
12-
strategy:
13-
matrix:
14-
node-version: [18.x]
1512
steps:
1613
- uses: actions/checkout@v3
1714
with:
1815
ref: ${{ github.event.pull_request.head.sha }}
1916
- name: Use Node.js ${{ matrix.node-version }}
2017
uses: actions/setup-node@v3
2118
with:
22-
node-version: ${{ matrix.node-version }}
19+
node-version: '20.x'
2320
registry-url: 'https://registry.npmjs.org'
2421
- name: Install dependencies
2522
run: npm ci --ignore-scripts

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-node@v3
1414
with:
15-
node-version: '18.x'
15+
node-version: '20.x'
1616
registry-url: 'https://registry.npmjs.org'
1717
- name: Install dependencies
1818
run: npm ci --ignore-scripts

.gitignore

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,5 @@
1-
.DS_Store
2-
# Logs
3-
logs
4-
*.log
5-
npm-debug.log*
6-
7-
# Runtime data
8-
pids
9-
*.pid
10-
*.seed
11-
12-
# Directory for instrumented libs generated by jscoverage/JSCover
13-
lib-cov
14-
15-
# IntelliJ
161
.idea
17-
18-
# Coverage directory used by tools like istanbul
192
coverage
20-
21-
# node-waf configuration
22-
.lock-wscript
23-
24-
# Build directories
253
build-*
26-
27-
# Dependency directory
284
node_modules
29-
30-
# Optional npm cache directory
31-
.npm
32-
33-
# Optional REPL history
34-
.node_repl_history
35-
36-
# built commands
375
bin

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ This module contains the standard Check Digit Typescript configuration, along wi
2323
to be used when publishing a package to NPM, or to bundle a package for deployment. It uses `tsc` for generating
2424
types, and `esbuild` for generating code.
2525

26+
**Note:** if building an ESM bundle, the `require` function will be defined as a global variable, to allow
27+
dynamic `require`s by CommonJS submodules. This is not a problem for NodeJS, but will cause issues in a browser environment.
28+
2629
#### Options
2730

2831
- `--type` the type of output to generate. Defaults to `module` (ESM). Valid values are `commonjs`, `module` or `types`.
@@ -72,7 +75,8 @@ the new version of Typescript, and/or without emitting warnings during these tes
7275

7376
Strict semver is a little complicated, as Typescript itself does not adhere to semver. So our "best effort" policy is:
7477

75-
- Each update to the minimum Node target (e.g. Node 16 to Node 18) will result in a new major version of this module.
78+
- Each update to the minimum Node target (e.g. Node 18 to Node 20), or a change to a major compiler output option
79+
(e.g. `module`, `target` or `moduleResolution`) will result in a new major version of this module.
7680
We coordinate this with whatever the latest LTS version of Node is currently supported by Amazon Lambda, Google Cloud Functions
7781
and Azure Functions.
7882
- Each new "major" version of Typescript (e.g. `4.2.x` to `4.3.x`) will result in a new minor version of this module.
@@ -96,18 +100,14 @@ Make sure your project's `tsconfig.json` extends `@checkdigit/typescript-config`
96100

97101
```
98102
{
99-
"extends": "@checkdigit/typescript-config",
100-
"compilerOptions": {
101-
"rootDir": "src",
102-
"outDir": "build"
103-
},
104-
"exclude": [
105-
"node_modules",
106-
"build"
107-
]
103+
"extends": "@checkdigit/typescript-config"
108104
}
109105
```
110106

107+
Note this configuration has `moduleResolution` set to `bundler`. This requires that you use the `builder` command
108+
to produce working code for deployment. However, for simply running Jest tests, this is not necessary if
109+
used in conjunction with [`@checkdigit/jest-config`](https://github.com/checkdigit/jest-config).
110+
111111
## License
112112

113113
MIT

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ These versions of `@checkdigit/typescript-config` are currently being supported
66

77
| Version | Supported |
88
| ------- | ------------------ |
9-
| \>= 3.x | :white_check_mark: |
10-
| \< 3.0 | :x: |
9+
| \>= 5.x | :white_check_mark: |
10+
| \< 5.0 | :x: |
1111

1212
## Reporting a Vulnerability
1313

0 commit comments

Comments
 (0)