@codefast/typescript-config 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/LICENSE +1 -1
- package/README.md +9 -6
- package/base.json +2 -2
- package/library.json +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @codefast/typescript-config
|
|
2
2
|
|
|
3
|
+
## 0.9.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#892](https://github.com/codefastlabs/codefast/pull/892) [`4c97c5b`](https://github.com/codefastlabs/codefast/commit/4c97c5b8c2314f25ee9df7eac5a4b5dd723d6d90) Thanks [@thevuong](https://github.com/thevuong)! - Lower the monorepo's Node floor from 24 to 22.12, so the packages install and run on the active Node 22 LTS line.
|
|
8
|
+
|
|
9
|
+
`engines.node` becomes `>=22.12.0` across every package — the floor the shared toolchain (oxlint, Vite, Vitest, TanStack
|
|
10
|
+
Start) already requires. Development stays on the latest Node (`.node-version`) for speed, and a CI matrix exercises the
|
|
11
|
+
floor and the active LTS directly, so the floor is a contract CI proves rather than one everyone has to run.
|
|
12
|
+
`@types/node` is pinned to the floor's major (`^22`), with a workspace override holding the whole tree there so a dev
|
|
13
|
+
tool's `@types/node: "*"` peer can no longer pull a newer major and mask an API the floor lacks. The floor stays
|
|
14
|
+
mechanical, not advisory: `@codefast/di` keeps its own `Map` upsert helpers rather than the ES2025
|
|
15
|
+
`Map.prototype.getOrInsert` (which would raise the floor to 26) and its `lib` stays `ES2024`. `@codefast/cli`'s mirror
|
|
16
|
+
step now calls the `node:path` functions directly instead of aliasing them, which the floor's types correctly flag as
|
|
17
|
+
unbound methods.
|
|
18
|
+
|
|
19
|
+
The shared `@codefast/typescript-config` presets pin `lib` and `target` to `ES2024` (was `ESNext`) so the compiler's
|
|
20
|
+
ECMAScript surface matches the Node floor: an ES2025 builtin such as `Map.prototype.getOrInsert` now fails to type-check
|
|
21
|
+
rather than compiling and crashing on Node 22.12. `@codefast/di` and `@codefast/di-testing` already pinned `lib` and are
|
|
22
|
+
unchanged.
|
|
23
|
+
|
|
24
|
+
Internal subpath imports move from a `#/` prefix to a bare `#` (`#core/token`, not `#/core/token`), and the
|
|
25
|
+
`package.json#imports` keys become `#*`/`#tests/*`/`#examples/*` to match. Node's native ESM resolver rejects a
|
|
26
|
+
`#/`-prefixed specifier with `ERR_INVALID_MODULE_SPECIFIER` on the whole Node 22 line (and on Node 24 before 24.14), and
|
|
27
|
+
each package ships those specifiers verbatim inside its published `dist/*.js` for a consumer's Node to resolve — so this
|
|
28
|
+
rename is what actually lets the packages import on the new floor. Purely internal: a consumer's own import paths are
|
|
29
|
+
unchanged.
|
|
30
|
+
|
|
3
31
|
## 0.9.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -15,8 +15,11 @@ The presets are plain JSON `tsconfig` files. There's no runtime code, and nothin
|
|
|
15
15
|
|
|
16
16
|
- **Strict by default.** `strict`, `noUncheckedIndexedAccess`, `noImplicitOverride`, and `verbatimModuleSyntax` come
|
|
17
17
|
from the base that every preset extends.
|
|
18
|
-
- **Bundler-first.** An ESNext
|
|
19
|
-
|
|
18
|
+
- **Bundler-first.** An ESNext `module` with `moduleResolution: "bundler"`, so `exports` and `imports` maps resolve the
|
|
19
|
+
way Vite, esbuild, and friends resolve them.
|
|
20
|
+
- **`lib` and `target` are `ES2024`, matching the Node floor** (`engines.node >= 22.12`). ES2024 is the newest edition
|
|
21
|
+
Node 22.12 fully supports, so an ES2025 builtin such as `Map.prototype.getOrInsert` is a type error here rather than a
|
|
22
|
+
runtime crash on the floor. Bump both together only when the floor moves.
|
|
20
23
|
- **Type-check only.** The presets set `noEmit`; a separate build overlay turns on emit and `.d.ts` generation.
|
|
21
24
|
- **Plain JSON.** No runtime code, nothing to import.
|
|
22
25
|
|
|
@@ -26,7 +29,7 @@ The presets are plain JSON `tsconfig` files. There's no runtime code, and nothin
|
|
|
26
29
|
pnpm add -D @codefast/typescript-config
|
|
27
30
|
```
|
|
28
31
|
|
|
29
|
-
`@codefast/typescript-config` requires Node.js
|
|
32
|
+
`@codefast/typescript-config` requires Node.js 22.12 or later, and `typescript` 5 or later as a peer dependency —
|
|
30
33
|
`moduleResolution: "bundler"` is a TypeScript 5 option. The package is published on 0.x and versioned on its own track:
|
|
31
34
|
breaking changes ship as minor versions, so pin the minor version when you need stability.
|
|
32
35
|
|
|
@@ -48,7 +51,7 @@ Options you set locally always win, so overriding a preset value takes one line:
|
|
|
48
51
|
{
|
|
49
52
|
"extends": "@codefast/typescript-config/library.json",
|
|
50
53
|
"compilerOptions": {
|
|
51
|
-
"lib": ["DOM", "DOM.Iterable", "
|
|
54
|
+
"lib": ["DOM", "DOM.Iterable", "ES2024"]
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
```
|
|
@@ -57,8 +60,8 @@ Options you set locally always win, so overriding a preset value takes one line:
|
|
|
57
60
|
|
|
58
61
|
| Preset | Extends | Purpose |
|
|
59
62
|
| -------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
60
|
-
| `base.json` | — | Strict, bundler-first baseline:
|
|
61
|
-
| `library.json` | `base.json` | Headless packages: `lib` is `
|
|
63
|
+
| `base.json` | — | Strict, bundler-first baseline: ES2024 target, ESNext module, DOM + ES2024 libs, type-check only. |
|
|
64
|
+
| `library.json` | `base.json` | Headless packages: `lib` is `ES2024` only, so relying on a browser global is a type error. |
|
|
62
65
|
| `react.json` | `base.json` | React with the automatic JSX runtime (`jsx: "react-jsx"`) — components need no `React` import. |
|
|
63
66
|
| `next.json` | `base.json` | Next.js apps: `jsx: "preserve"`, `incremental` builds, and the `next` TypeScript plugin. |
|
|
64
67
|
| `library-build.json` | (overlay) | Build-emit overrides for a build config: `noEmit: false`, `declaration` + `isolatedDeclarations`, declaration and source maps, `types: ["node"]`. |
|
package/base.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"exactOptionalPropertyTypes": true,
|
|
6
6
|
"forceConsistentCasingInFileNames": true,
|
|
7
7
|
"isolatedModules": true,
|
|
8
|
-
"lib": ["DOM", "DOM.Iterable", "
|
|
8
|
+
"lib": ["DOM", "DOM.Iterable", "ES2024"],
|
|
9
9
|
"module": "ESNext",
|
|
10
10
|
"moduleDetection": "force",
|
|
11
11
|
"moduleResolution": "bundler",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"resolveJsonModule": true,
|
|
16
16
|
"skipLibCheck": true,
|
|
17
17
|
"strict": true,
|
|
18
|
-
"target": "
|
|
18
|
+
"target": "ES2024",
|
|
19
19
|
"verbatimModuleSyntax": true
|
|
20
20
|
},
|
|
21
21
|
"display": "Base configuration for monorepo packages"
|
package/library.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codefast/typescript-config",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Shared TypeScript configuration for the monorepo",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"browser",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"url": "https://github.com/codefastlabs/codefast/issues"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
|
-
"author": "Vuong Phan <mr.thevuong@gmail.com>",
|
|
21
|
+
"author": "Vuong Phan <mr.thevuong@gmail.com> (https://github.com/thevuong)",
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
24
|
"url": "git+https://github.com/codefastlabs/codefast.git",
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
"typescript": ">=5.0.0"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
|
-
"node": ">=
|
|
47
|
+
"node": ">=22.12.0"
|
|
48
48
|
}
|
|
49
49
|
}
|