Skip to content

Commit 798f3b8

Browse files
authored
chore(deps): Upgrade to Vite 6 and related dependencies (#1496)
1 parent a886ab2 commit 798f3b8

File tree

12 files changed

+1852
-1292
lines changed

12 files changed

+1852
-1292
lines changed

.github/workflows/pkg.pr.new.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
run: pnpm buildc all
2626

2727
- name: Publish
28-
run: pnpx pkg-pr-new publish --compact './packages/*'
28+
run: pnpx pkg-pr-new publish --compact --pnpm './packages/*'

packages/module-react/build.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineBuildConfig } from 'unbuild';
22
import { resolve } from 'node:path';
33

44
export default defineBuildConfig({
5-
rootDir: 'modules',
5+
rootDir: resolve(__dirname, 'modules'),
66
outDir: resolve(__dirname, 'dist'),
77
entries: [{ input: 'react.ts', name: 'index' }],
88
rollup: {

packages/module-solid/build.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineBuildConfig } from 'unbuild';
22
import { resolve } from 'node:path';
33

44
export default defineBuildConfig({
5-
rootDir: 'modules',
5+
rootDir: resolve(__dirname, 'modules'),
66
outDir: resolve(__dirname, 'dist'),
77
entries: [{ input: 'solid.ts', name: 'index' }],
88
rollup: {

packages/storage/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ function createStorage(): WxtStorage {
394394
(await migrations?.[migrateToVersion]?.(migratedValue)) ??
395395
migratedValue;
396396
} catch (err) {
397-
throw Error(`v${migrateToVersion} migration failed for "${key}"`, {
397+
throw new MigrationError(key, migrateToVersion, {
398398
cause: err,
399399
});
400400
}

packages/wxt/e2e/tests/npm-packages.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ test('Only one version of esbuild should be installed (each version is ~20mb of
2121
if (name === 'esbuild') esbuildVersions.add(meta.version);
2222
});
2323

24-
expect([...esbuildVersions]).toHaveLength(1);
24+
// TODO: Revert to 1 once vite is upgraded to >6.0.8
25+
expect([...esbuildVersions]).toHaveLength(2);
2526
});
2627

2728
function iterateDependencies(

packages/wxt/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@
144144
"lodash.merge": "catalog:",
145145
"oxlint": "catalog:",
146146
"publint": "catalog:",
147-
"tsx": "catalog:",
148147
"typescript": "catalog:",
149148
"unbuild": "catalog:",
150149
"vitest": "catalog:",

packages/wxt/src/core/builders/vite/plugins/bundleAnalysis.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import path from 'node:path';
66
let increment = 0;
77

88
export function bundleAnalysis(config: ResolvedConfig): vite.Plugin {
9+
// @ts-expect-error: Mismatched vite version
910
return visualizer({
1011
template: 'raw-data',
1112
filename: path.resolve(

packages/wxt/src/core/resolve-config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ export async function resolveConfig(
5252
name: 'wxt',
5353
cwd: inlineConfig.root ?? process.cwd(),
5454
rcFile: false,
55-
jitiOptions: {
56-
esmResolve: true,
57-
},
5855
});
5956
if (inlineConfig.configFile && metadata.layers?.length === 0) {
6057
throw Error(`Config file "${inlineConfig.configFile}" not found`);

packages/wxt/src/core/utils/building/import-entrypoint.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export async function importEntrypointFile<T>(path: string): Promise<T> {
4949
{
5050
cache: false,
5151
debug: wxt.config.debug,
52-
esmResolve: true,
5352
alias: {
5453
'webextension-polyfill': resolve(
5554
wxt.config.wxtModuleDir,
@@ -65,7 +64,7 @@ export async function importEntrypointFile<T>(path: string): Promise<T> {
6564
},
6665
// Continue using node to load TS files even if `bun run --bun` is detected. Jiti does not
6766
// respect the custom transform function when using it's native bun option.
68-
experimentalBun: false,
67+
tryNative: false,
6968
// List of extensions to transform with esbuild
7069
extensions: [
7170
'.ts',

packages/wxt/src/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { UnimportOptions, Import } from 'unimport';
44
import { LogLevel } from 'consola';
55
import type { ContentScriptContext } from './client/content-scripts/content-script-context';
66
import type { PluginVisualizerOptions } from '@aklinker1/rollup-plugin-visualizer';
7-
import type { FSWatcher } from 'chokidar';
87
import { ResolvedConfig as C12ResolvedConfig } from 'c12';
98
import { Hookable, NestedHooks } from 'hookable';
109
import type * as Nypm from 'nypm';
@@ -1097,7 +1096,7 @@ export interface WxtBuilderServer {
10971096
/**
10981097
* Chokidar file watcher instance.
10991098
*/
1100-
watcher: FSWatcher;
1099+
watcher: vite.ViteDevServer['watcher'];
11011100
on?(event: string, callback: () => void): void;
11021101
}
11031102

0 commit comments

Comments
 (0)