Skip to content

Commit

Permalink
feat: upgrade to Vite 6.x
Browse files Browse the repository at this point in the history
BREAKING CHANGE:

The base version of Vite is updated.

BEFORE:

Vite 5.x is the base version.

AFTER:

Vite 6.x is the base version.
  • Loading branch information
brandonroberts committed Dec 17, 2024
1 parent d955698 commit 5ce9829
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 66 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- beta
- main
- alpha

permissions:
contents: read # for checkout
Expand Down Expand Up @@ -41,4 +42,4 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
TAG="$(${{ github.ref_name == 'main' }} && echo 'latest' || echo '${{ github.ref_name }}')"
RELEASE_TAG=$TAG npx semantic-release
RELEASE_TAG=$TAG npx semantic-release --dry-run
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
"ts-node": "10.9.1",
"typescript": "~5.5.0",
"vfile": "^6.0.3",
"vite": "^5.4.0",
"vite": "^6.0.0",
"vite-plugin-eslint": "^1.8.1",
"vite-tsconfig-paths": "4.2.0",
"vitefu": "^0.2.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-analog/template-angular-v17/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"nx": "~18.0.0",
"jsdom": "^22.1.0",
"typescript": "~5.3.0",
"vite": "^5.0.0",
"vite": "^6.0.0",
"vitest": "^1.3.1"
}
}
2 changes: 1 addition & 1 deletion packages/create-analog/template-angular-v18/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@angular/compiler-cli": "^18.0.0",
"jsdom": "^22.0.0",
"typescript": "~5.4.2",
"vite": "^5.0.0",
"vite": "^6.0.0",
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^1.3.1"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-analog/template-blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@angular/compiler-cli": "^19.0.0",
"jsdom": "^22.0.0",
"typescript": "~5.5.0",
"vite": "^5.0.0",
"vite": "^6.0.0",
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^2.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-analog/template-latest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@angular/compiler-cli": "^19.0.0",
"jsdom": "^22.0.0",
"typescript": "~5.5.0",
"vite": "^5.0.0",
"vite": "^6.0.0",
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^2.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-analog/template-minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@angular/compiler-cli": "^19.0.0",
"jsdom": "^22.0.0",
"typescript": "~5.5.0",
"vite": "^5.0.0",
"vite": "^6.0.0",
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^2.0.0"
}
Expand Down
3 changes: 2 additions & 1 deletion packages/vite-plugin-angular/src/lib/angular-vite-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ export function angular(options?: PluginOptions): Plugin[] {
// - @nx/vite executor set server.watch explicitly to undefined (watch)/null (watch=false)
// - vite config for test.watch variable
testWatchMode =
!(config.server.watch === null) || config.test?.watch === true;
!(config.server.watch === null) ||
(config as any).test?.watch === true;
},
configureServer(server) {
viteServer = server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function angularVitestPlugin(): Plugin {
noExternal: [/cdk\/fesm2022/],
},
test: {
pool: userConfig.test?.pool ?? 'vmThreads',
pool: (userConfig as any).test?.pool ?? 'vmThreads',
server: {
deps: {
inline: [/fesm2022(.*?)testing/],
Expand Down
7 changes: 3 additions & 4 deletions packages/vitest-angular/src/lib/builders/build/vitest.impl.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createBuilder } from '@angular-devkit/architect';
import * as path from 'path';
import type { Vitest } from 'vitest/node';
import type { Plugin, UserConfig } from 'vite';
import type { UserConfig as VitestConfig } from 'vitest';
import type { Vitest, UserConfig as VitestConfig } from 'vitest/node';
import type { Plugin } from 'vite';

import { VitestSchema } from './schema';
import { createAngularMemoryPlugin } from './plugins/angular-memory-plugin';
Expand Down Expand Up @@ -71,7 +70,7 @@ async function* vitestApplicationBuilder(

const outputFiles = new Map();

const viteConfig: UserConfig = {
const viteConfig: any = {
plugins: [
(await createAngularMemoryPlugin({
angularVersion,
Expand Down
12 changes: 9 additions & 3 deletions packages/vitest-angular/src/lib/builders/test/vitest.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ async function vitestBuilder(
config: options.configFile,
...extraArgs,
};

const server = await startVitest('test', options.testFiles ?? [], config, {
const viteOverrides: any = {
test: { watch },
});
};

const server = await startVitest(
'test',
options.testFiles ?? [],
config,
viteOverrides
);

let hasErrors = false;

Expand Down
116 changes: 66 additions & 50 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

0 comments on commit 5ce9829

Please sign in to comment.