Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ concurrency:
group: ci-${{ github.head_ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
validate:
name: Validate
Expand All @@ -19,4 +22,6 @@ jobs:
with:
node-version: 22

- run: npm ci --ignore-scripts

- run: npm test
8 changes: 8 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ jobs:
quality:
name: Quality Gates
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- run: npm ci --ignore-scripts

- run: npm test

canary:
Expand All @@ -59,6 +63,8 @@ jobs:
node-version: 22
registry-url: https://registry.npmjs.org

- run: npm ci --ignore-scripts

- name: Upgrade npm for OIDC support
run: npm install -g npm@latest

Expand Down Expand Up @@ -92,6 +98,8 @@ jobs:
node-version: 22
registry-url: https://registry.npmjs.org

- run: npm ci --ignore-scripts

- name: Bump version
id: version
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Uses npm OIDC provenance — no `NPM_TOKEN` secret needed. Requires npm trusted
## Project structure

```
base.json ← foundation (strict, isolatedModules, noUncheckedIndexedAccess)
base.json ← foundation (strict, explicit ambient types, stable type ordering)
nodejs.json ← Node.js apps (NodeNext, ES2024)
node-library.json ← publishable npm packages (NodeNext, ES2024, declarationMap)
react.json ← React apps (Bundler, ES2022, react-jsx)
Expand All @@ -43,6 +43,6 @@ nextjs.json ← Next.js apps (Bundler, ES2022, noEmit, next plugin)

| Command | What |
|---------|------|
| `npm test` | Run smoke tests (JSON validation) |
| `npm test` | Validate every preset with the supported TypeScript 6 and 7 compilers |
| `npm pack --dry-run` | Preview tarball contents |
| `npm view @vllnt/typescript` | Check published version |
41 changes: 38 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# @vllnt/typescript

Shared TypeScript configurations for vllnt projects. Strict, modern, Node 22+.
Shared TypeScript configurations for vllnt projects. Strict, modern, Node 22+, and validated with TypeScript 6 and 7.

## Install

```sh
npm install -D @vllnt/typescript
npm install -D @vllnt/typescript typescript
```

## Presets
Expand Down Expand Up @@ -78,14 +78,49 @@ All presets extend `base.json` which enforces:
- `strict: true`
- `isolatedModules: true`
- `noUncheckedIndexedAccess: true`
- `noUncheckedSideEffectImports: true`
- `skipLibCheck: true`
- `esModuleInterop: true`
- `resolveJsonModule: true`
- `stableTypeOrdering: true`
- `types: []` (ambient type packages must be listed explicitly)

On TypeScript 6, `stableTypeOrdering` can make type-checking slower (up to 25% according to the [TypeScript 6 release notes](https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/)). It is enabled here so TypeScript 6 uses TypeScript 7's deterministic type ordering during migration; TypeScript 7 always uses this behavior.

## TypeScript 7

Version 2 supports TypeScript 6 and 7, drops TypeScript 5, and makes ambient type packages opt-in. TypeScript 7 is a native compiler and no longer exposes the JavaScript compiler API used by tools such as `typescript-eslint` and legacy `tsserver` integrations. Use TypeScript 7 directly when every tool in the project invokes the compiler CLI:

```sh
npm install -D @vllnt/typescript typescript@^7
```

During the ecosystem transition, install TypeScript 7 for `tsc` and keep the TypeScript 6 API available under the canonical `typescript` package name:

```json
{
"devDependencies": {
"@typescript/native": "npm:typescript@^7.0.2",
"@vllnt/typescript": "^2.0.0",
"typescript": "npm:@typescript/typescript6@^6.0.2"
}
}
```

This arrangement follows the [official TypeScript 7 side-by-side guidance](https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/). It provides TypeScript 7 as `tsc`, TypeScript 6 as `tsc6`, and the TypeScript 6 JavaScript API to dependent tooling.

Before switching a consumer to TypeScript 7:

- Remove `baseUrl`; make every `paths` target relative to the project root.
- Replace `moduleResolution: "node"` with `"NodeNext"` for Node.js or `"Bundler"` for bundled applications.
- Set `rootDir` explicitly for emitting projects.
- List required ambient packages in `types`, for example `types: ["node", "vitest/globals"]`.
- Use Next.js 16.3 or newer. Next.js 16.2.12 requires `experimental.useTypeScriptCli: true`.

## Requirements

- Node.js >= 22
- TypeScript >= 5.0
- TypeScript >= 6.0.2 and < 8

## License

Expand Down
3 changes: 3 additions & 0 deletions base.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"isolatedModules": true,
"skipLibCheck": true,
"noUncheckedIndexedAccess": true,
"noUncheckedSideEffectImports": true,
"stableTypeOrdering": true,
"types": [],
"resolveJsonModule": true
}
}
Loading
Loading