diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fcd5b5ea..10c2fd430 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -173,7 +173,9 @@ jobs: with: node-version: 'lts/*' - if: contains(matrix.generator, 'typescript-fetch') - run: npm install -g typescript vite-plus + run: | + npm install -g typescript@7.0.2 vite-plus@1.5.0 + tsc --version - uses: actions/setup-go@v6 if: matrix.generator == 'go-http' with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8484e9ee9..aa623f217 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Upgrade generated TypeScript clients to Vite+ `^1.5.0`, including Vite `8.3.5`, + Vitest `5.1.0`, Rolldown `1.2.16`, Oxfmt `0.76.0`, Oxlint `1.91.0`, + oxlint-tsgolint `7.0.2005`, and tsdown `0.23.4`. Pin CI validation and + documented setup to Vite+ `1.5.0` and TypeScript `7.0.2`, and report the resolved + tool versions during client builds. Vite+ projects require Node.js + `^22.18.0 || ^24.11.0 || >=26.0.0`. + ## [0.3.0] ### Breaking Changes diff --git a/docs/src/golden_testing.md b/docs/src/golden_testing.md index 2ff0d7286..9d4ff1398 100644 --- a/docs/src/golden_testing.md +++ b/docs/src/golden_testing.md @@ -134,9 +134,9 @@ temporary directories so Vite+ does not skip gitignored generated sources; no generated manifests or source files are patched. The consumer type check uses the generated package's installed compiler rather than the global `tsc` selection. The current global Vite+ CLI also needs TypeScript installed alongside the CLI -for declaration packing (`npm install -g typescript vite-plus`). CI reuses that -bootstrap and its generator cache in the existing TypeScript/Vite+ golden-build -job; no separate consumer job is added. `just ci` includes these checks too. See +for declaration packing (`npm install -g typescript@7.0.2 vite-plus@1.5.0`). CI +reuses that bootstrap and its generator cache in the existing TypeScript/Vite+ +golden-build job; no separate consumer job is added. `just ci` includes these checks too. See `tests/generated-clients/typescript/README.md` for details. ## Rust Client Runtime Tests @@ -194,8 +194,8 @@ suite. The independent JVM Client Tests CI matrix and `just ci` run these checks validated with Rust 1.99.0). MSRV checks explicitly select Rust 1.90.0; they do not substitute for stable validation. - Local TypeScript validation uses TypeScript 7.0.2 and Vite+ 1.5.0 on Node - 26.13.0. The native validators use the active `tsc` and `vp` on `PATH`; when - `tsc` is not globally installed, `npm exec --package typescript -- just + 26.13.0. The native validators use the active `tsc` and `vp` on `PATH`. To select + that compiler explicitly, `npm exec --package=typescript@7.0.2 -- just golden-typescript::build-tsc` supplies it without changing generated packages. - Current local JVM validation uses Homebrew JDK 27.0.1 with Gradle 9.8.2, respecting `JAVA_HOME` or the active JVM. CI validates on JDK 27. Generated libraries may diff --git a/docs/src/ts_config.md b/docs/src/ts_config.md index 4e86bcb3d..0ea57809a 100644 --- a/docs/src/ts_config.md +++ b/docs/src/ts_config.md @@ -115,7 +115,14 @@ Selects the type checking and build toolchain. One of `"tsc"` (default) or `"vp" - `"tsc"` — bare TypeScript compiler. Generates `tsconfig.json` only. Build script: `tsc`. - `"vp"` — vite-plus. Generates `vite.config.ts` with `pack` config for library output (ESM + .d.ts). Build script: `vp pack`. Check script: `vp check --no-fmt`. -When `toolchain = "vp"`, the generated `package.json` includes `vite-plus` and `typescript` as dev dependencies, and scripts use `vp pack` (library mode) rather than `vp build` (app mode). +When `toolchain = "vp"`, the generated `package.json` includes `vite-plus` (`^1.5.0`) and `typescript` (`^7.0.2`) as dev dependencies, and scripts use `vp pack` (library mode) rather than `vp build` (app mode). + +Vite+ manages Vite, Vitest, Rolldown, Oxfmt, Oxlint, oxlint-tsgolint, and tsdown as +one toolchain. Upgrading `vite-plus` upgrades these bundled components together. +Run `vp --version` after `vp install` in a generated project to inspect the resolved +component versions. + +Vite+ 1.5.0 requires Node.js `^22.18.0 || ^24.11.0 || >=26.0.0`. ```toml [generators.typescript-fetch] diff --git a/just/golden-typescript-clients.just b/just/golden-typescript-clients.just index 0b3cf7758..eac879ff5 100644 --- a/just/golden-typescript-clients.just +++ b/just/golden-typescript-clients.just @@ -20,7 +20,7 @@ set working-directory := '..' # Like golden builds, validate outside the ignored generated directory: # Vite+ otherwise skips every source file because of the repository ignore. tar --exclude=node_modules --exclude=dist -C "$output" -cf - . | tar -C "$build" -xf - - (cd "$build" && vp install && vp check --no-fmt && vp pack) + (cd "$build" && vp install && vp --version && vp check --no-fmt && vp pack) mkdir -p "$output/dist" cp "$build"/dist/* "$output/dist/" done diff --git a/src/generators/typescript/fetch/codegen.rs b/src/generators/typescript/fetch/codegen.rs index 93286f506..4a7cecfc3 100644 --- a/src/generators/typescript/fetch/codegen.rs +++ b/src/generators/typescript/fetch/codegen.rs @@ -374,7 +374,7 @@ impl TypeScriptFetchCodeGenerator { }); package_json["devDependencies"] = serde_json::json!({ "typescript": "^7.0.2", - "vite-plus": "^0.2.5", + "vite-plus": "^1.5.0", }); } } diff --git a/tests/generated-clients/typescript/README.md b/tests/generated-clients/typescript/README.md index 28ab8857c..ec8f853e7 100644 --- a/tests/generated-clients/typescript/README.md +++ b/tests/generated-clients/typescript/README.md @@ -4,10 +4,11 @@ just golden-typescript-clients::test ``` -Requires Rust, Node, and a current Vite+ CLI installed alongside TypeScript: +Requires Rust, Node.js `^22.18.0 || ^24.11.0 || >=26.0.0`, and Vite+ 1.5.0 +installed alongside TypeScript 7.0.2: ```sh -npm install -g typescript vite-plus +npm install -g typescript@7.0.2 vite-plus@1.5.0 ``` The current global Vite+ CLI resolves the TypeScript API beside the CLI when @@ -17,7 +18,8 @@ The strict consumer check itself uses that package's installed compiler. - `prepare` runs the public generator CLI with an explicit empty configuration, producing fresh, unmodified preserve and camelCase clients. - `build` copies each client to a temporary build directory, runs `vp install`, - `vp check --no-fmt`, and `vp pack`, then copies its bundle/declarations back. + reports the resolved Vite+ component versions with `vp --version`, runs + `vp check --no-fmt` and `vp pack`, then copies its bundle/declarations back. Building outside the repository avoids Vite+ skipping gitignored generated sources. Generated source, manifests, and configuration are never patched. - `typecheck.ts` checks the actual packed declarations with strict typing and diff --git a/tests/golden/typescript/typescript-fetch/ts-property-naming-camel-case-additional-properties/package.json.golden b/tests/golden/typescript/typescript-fetch/ts-property-naming-camel-case-additional-properties/package.json.golden index faef13ac5..2b0acc16a 100644 --- a/tests/golden/typescript/typescript-fetch/ts-property-naming-camel-case-additional-properties/package.json.golden +++ b/tests/golden/typescript/typescript-fetch/ts-property-naming-camel-case-additional-properties/package.json.golden @@ -2,7 +2,7 @@ "description": "TypeScript client for TypeScript additional property preservation", "devDependencies": { "typescript": "^7.0.2", - "vite-plus": "^0.2.5" + "vite-plus": "^1.5.0" }, "exports": { ".": { diff --git a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-camel-case-tagged-nullable-unions/package.json.golden b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-camel-case-tagged-nullable-unions/package.json.golden index ea5ac7bb5..8a092f4ec 100644 --- a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-camel-case-tagged-nullable-unions/package.json.golden +++ b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-camel-case-tagged-nullable-unions/package.json.golden @@ -2,7 +2,7 @@ "description": "Masked fixture for TypeScript Fetch camelCase regression coverage.", "devDependencies": { "typescript": "^7.0.2", - "vite-plus": "^0.2.5" + "vite-plus": "^1.5.0" }, "exports": { ".": { diff --git a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-comprehensive/package.json.golden b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-comprehensive/package.json.golden index 43f0827c3..424e93d5b 100644 --- a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-comprehensive/package.json.golden +++ b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-comprehensive/package.json.golden @@ -2,7 +2,7 @@ "description": "Comprehensive test for all OpenAPI v3.1.2 schema types", "devDependencies": { "typescript": "^7.0.2", - "vite-plus": "^0.2.5" + "vite-plus": "^1.5.0" }, "exports": { ".": { diff --git a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-delete-response/package.json.golden b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-delete-response/package.json.golden index 8561c183d..7a9327070 100644 --- a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-delete-response/package.json.golden +++ b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-delete-response/package.json.golden @@ -2,7 +2,7 @@ "description": "Test fixture for DELETE operations with JSON response schemas and type alias request bodies", "devDependencies": { "typescript": "^7.0.2", - "vite-plus": "^0.2.5" + "vite-plus": "^1.5.0" }, "exports": { ".": { diff --git a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-enum-repr/package.json.golden b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-enum-repr/package.json.golden index f6d4c3e50..63aa8ed5e 100644 --- a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-enum-repr/package.json.golden +++ b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-enum-repr/package.json.golden @@ -2,7 +2,7 @@ "description": "This API demonstrates all 4 kinds of enum representation types: Externally Tagged, Internally Tagged, Adjacently Tagged, and Untagged", "devDependencies": { "typescript": "^7.0.2", - "vite-plus": "^0.2.5" + "vite-plus": "^1.5.0" }, "exports": { ".": { diff --git a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-petstore/package.json.golden b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-petstore/package.json.golden index db327e66a..cfafa60c1 100644 --- a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-petstore/package.json.golden +++ b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-petstore/package.json.golden @@ -2,7 +2,7 @@ "description": "This is a sample Pet Store Server based on the OpenAPI 3.1 specification", "devDependencies": { "typescript": "^7.0.2", - "vite-plus": "^0.2.5" + "vite-plus": "^1.5.0" }, "exports": { ".": { diff --git a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-self-referential-object/package.json.golden b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-self-referential-object/package.json.golden index 7cb84d845..90161f364 100644 --- a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-self-referential-object/package.json.golden +++ b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp-self-referential-object/package.json.golden @@ -2,7 +2,7 @@ "description": "TypeScript client for Self-Referential Object Test", "devDependencies": { "typescript": "^7.0.2", - "vite-plus": "^0.2.5" + "vite-plus": "^1.5.0" }, "exports": { ".": { diff --git a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp/package.json.golden b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp/package.json.golden index 5227c7c6c..0520f24e4 100644 --- a/tests/golden/typescript/typescript-fetch/ts-toolchain-vp/package.json.golden +++ b/tests/golden/typescript/typescript-fetch/ts-toolchain-vp/package.json.golden @@ -2,7 +2,7 @@ "description": "Test fixture for discriminated union where variants are references to component schemas.\nThis is similar to the ContainerImage pattern in the infiron API.\n", "devDependencies": { "typescript": "^7.0.2", - "vite-plus": "^0.2.5" + "vite-plus": "^1.5.0" }, "exports": { ".": {