Skip to content

Commit f9f5042

Browse files
RebeccaStevenssxzzfiskerkirkwaiblingerJoshuaKGoldberg
authored
feat: version 3 (#796)
BREAKING CHANGE: Drop support for Node 18 BREAKING CHANGE: Minimum supported TypeScript version is now 5.5.2 BREAKING CHANGE: Dropped CJS build. BREAKING CHANGE: Removed deprecated API functions. Co-authored-by: Kevin Deng <sxzz@sxzz.moe> Co-authored-by: Kevin Deng <hi@sxzz.moe> Co-authored-by: fisker Cheung <lionkay@gmail.com> Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Co-authored-by: Josh Goldberg <git@joshuakgoldberg.com>
1 parent 586c61b commit f9f5042

59 files changed

Lines changed: 1213 additions & 1799 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pnpm install
1313
1414
## Building
1515

16-
Run [tsup](https://tsup.egoist.dev) locally to type check and build source files from `src/` into output files in `lib/`:
16+
Run [tsdown](https://tsdown.dev) locally to type check and build source files from `src/` into output files in `lib/`:
1717

1818
```shell
1919
pnpm build

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ jobs:
77
with:
88
node-version: ${{ matrix.node_version }}
99
- run: pnpm build
10-
- run: node ./lib/index.js
10+
- run: node ./lib/index.mjs
1111
- run: pnpm run lint:package
1212

1313
strategy:
1414
fail-fast: false
1515
matrix:
1616
node_version:
17-
- 18.x
17+
- 20.x
1818
- 22.x
19+
- 24.x
1920
- latest
2021
name: Build
2122

.github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
node_version:
24-
- 18.x
2524
- 20.x
2625
- 22.x
2726
- 24.x
2827
- latest
2928
ts_version:
30-
- 4.8.4
29+
- 5.5.4
3130
- latest
3231
# TS 6 rc. Once TS 6 is released, this can be removed, since it will
3332
# be superseded by `latest`

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ Check out our API docs for details:
3434

3535
📝 [ts-api-utils API docs](https://joshuakgoldberg.github.io/ts-api-utils).
3636

37+
### Supported Versions
38+
39+
`ts-api-utils` supports TypeScript versions `5.5.2` and above and Node versions `20.19.0` and above.
40+
41+
Note: `ts-api-utils` will not work with the TypeScript Native Preview (TypeScript 7) for the foreseeable future, due to
42+
unknowns around the future of the TypeScript Native API.\
43+
See their list of [What Works So Far?](https://github.com/microsoft/typescript-go#what-works-so-far) for details.
44+
3745
## Development
3846

3947
See [`.github/CONTRIBUTING.md`](./.github/CONTRIBUTING.md).

cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"quickstart",
3232
"tseslint",
3333
"tsquery",
34-
"tsup",
34+
"tsdown",
3535
"tsutils",
3636
"tsvfs",
3737
"typeguards",

docs/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ if (isAbstractKeyword(node)) {
3838
See the sidebar for the full list of available functions and types.
3939

4040
> Tip: if a function you'd want to use appears to be missing, check whether it exists on TypeScript itself.
41+
42+
### Supported Versions
43+
44+
`ts-api-utils` supports TypeScript versions `5.5.2` and above and Node versions `20.19.0` and above.

eslint.config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,21 @@ export default defineConfig(
5353
projectService: {
5454
allowDefaultProject: ["*.*s", "eslint.config.js"],
5555
},
56-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, n/no-unsupported-features/node-builtins
56+
// eslint-disable-next-line n/no-unsupported-features/node-builtins
5757
tsconfigRootDir: import.meta.dirname,
5858
},
5959
},
6060
rules: {
61+
"no-restricted-syntax": [
62+
"error",
63+
// Forbid default import from "typescript"
64+
{
65+
message: 'Default import from "typescript" is not allowed.',
66+
selector:
67+
'ImportDeclaration[source.value="typescript"] > ImportDefaultSpecifier',
68+
},
69+
],
70+
6171
// These off-by-default rules work well for this repo and we like them on.
6272
"logical-assignment-operators": [
6373
"error",

package.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,17 @@
1414
"sideEffects": false,
1515
"type": "module",
1616
"exports": {
17-
".": {
18-
"types": {
19-
"import": "./lib/index.d.ts",
20-
"require": "./lib/index.d.cts"
21-
},
22-
"import": "./lib/index.js",
23-
"require": "./lib/index.cjs"
24-
}
17+
".": "./lib/index.mjs",
18+
"./package.json": "./package.json"
2519
},
26-
"main": "./lib/index.js",
20+
"main": "./lib/index.mjs",
21+
"module": "./lib/index.mjs",
22+
"types": "./lib/index.d.mts",
2723
"files": [
2824
"lib/"
2925
],
3026
"scripts": {
31-
"build": "tsup src/index.ts && cp lib/index.d.ts lib/index.d.cts",
27+
"build": "tsdown src/index.ts",
3228
"docs": "typedoc",
3329
"docs:serve": "npx --yes http-server docs/generated",
3430
"format": "prettier \"**/*\" --ignore-unknown",
@@ -53,9 +49,9 @@
5349
"@phenomnomnominal/tsquery": "^6.1.3",
5450
"@release-it/conventional-changelog": "^10.0.0",
5551
"@types/eslint-plugin-markdown": "^2.0.2",
56-
"@types/node": "^18.19.74",
52+
"@types/node": "^20.19.33",
5753
"@typescript/vfs": "^1.6.0",
58-
"@vitest/coverage-v8": "^3.0.0",
54+
"@vitest/coverage-v8": "^4.0.0",
5955
"@vitest/eslint-plugin": "^1.1.25",
6056
"console-fail-test": "^0.6.0",
6157
"cspell": "^9.0.0",
@@ -81,21 +77,24 @@
8177
"publint": "^0.3.17",
8278
"release-it": "^19.0.0",
8379
"should-semantic-release": "^0.3.0",
84-
"tsup": "^8.3.6",
80+
"tsdown": "^0.16.6",
8581
"typedoc": "^0.28.0",
8682
"typedoc-plugin-coverage": "^4.0.0",
8783
"typedoc-plugin-custom-validation": "^2.0.2",
8884
"typedoc-plugin-konamimojisplosion": "^0.0.2",
8985
"typedoc-plugin-mdn-links": "^5.0.0",
9086
"typescript": "^5.7.3",
9187
"typescript-eslint": "^8.22.0",
92-
"vitest": "^3.0.0"
88+
"vitest": "^4.0.0"
9389
},
9490
"peerDependencies": {
95-
"typescript": ">=4.8.4"
91+
"typescript": ">=5.5.2 <7"
9692
},
9793
"packageManager": "pnpm@10.32.1",
9894
"engines": {
99-
"node": ">=18.12"
95+
"node": ">=20.19"
96+
},
97+
"publishConfig": {
98+
"provenance": true
10099
}
101100
}

0 commit comments

Comments
 (0)