Skip to content
Merged
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
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ build:
pnpm --filter @rolldown/pluginutils build
pnpm --filter rolldown build-binding:release
pnpm --filter rolldown build-node
pnpm --filter rolldown-vite build-types
pnpm --filter vite build-types
pnpm --filter=@voidzero-dev/vite-plus build

ready:
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"rolldown": "workspace:*",
"rolldown-plugin-dts": "catalog:",
"tsdown": "catalog:",
"rolldown-vite": "workspace:*"
"vite": "workspace:*"
},
"napi": {
"binaryName": "vite-plus",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/snap-tests/command-helper/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Options:
--base <path> [string] public base path (default: /)
-l, --logLevel <level> [string] info | warn | error | silent
--clearScreen [boolean] allow/disable clear screen when logging
--configLoader <loader> [string] use 'bundle' to bundle the config with esbuild, or 'runner' (experimental) to process it on the fly, or 'native' (experimental) to load using the native runtime (default: bundle)
--configLoader <loader> [string] use 'bundle' to bundle the config with Rolldown, or 'runner' (experimental) to process it on the fly, or 'native' (experimental) to load using the native runtime (default: bundle)
-d, --debug [feat] [string | boolean] show debug logs
-f, --filter <filter> [string] filter debug logs
-m, --mode <mode> [string] set env mode
Expand Down
36 changes: 14 additions & 22 deletions packages/core/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,16 @@ async function buildVite() {
}
},
},
...config.plugins
.filter((plugin) => {
return !(
typeof plugin === 'object' &&
plugin !== null &&
'name' in plugin &&
plugin.name === 'rollup-plugin-license'
);
})
.map((plugin) => {
if (
typeof plugin === 'object' &&
plugin !== null &&
'name' in plugin &&
plugin.name === 'externalize-vite'
) {
return RewriteImportsPlugin;
}
return plugin;
}),
// Add RewriteImportsPlugin to handle vite/rolldown import rewrites
RewriteImportsPlugin,
...config.plugins.filter((plugin) => {
return !(
typeof plugin === 'object' &&
plugin !== null &&
'name' in plugin &&
plugin.name === 'rollup-plugin-license'
);
}),
];
}

Expand Down Expand Up @@ -171,8 +161,10 @@ async function buildVite() {
await writeFile(
dstFilePath,
file
.replaceAll(`"rolldown-vite/`, `"${pkgJson.name}/`)
.replaceAll(`"rolldown-vite"`, `"${pkgJson.name}/vite"`)
// Handle vite v8+ imports (official vite repo uses 'vite' package name)
.replaceAll(`"vite/`, `"${pkgJson.name}/`)
.replaceAll(`"vite"`, `"${pkgJson.name}"`)
// Handle rolldown imports
.replaceAll(`"rolldown/`, `"${pkgJson.name}/rolldown/`)
.replaceAll(`"rolldown"`, `"${pkgJson.name}/rolldown"`),
);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"magic-string": "^0.30.21",
"picocolors": "^1.1.1",
"rolldown": "workspace:*",
"rolldown-vite": "workspace:*",
"vite": "workspace:*",
"rollup": "^4.18.0",
"rollup-plugin-license": "^3.6.0",
"tinyglobby": "^0.2.15",
Expand Down
2 changes: 1 addition & 1 deletion packages/global/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"cross-spawn": "catalog:",
"oxlint": "catalog:",
"oxlint-tsgolint": "catalog:",
"rolldown-vite": "workspace:*",
"vite": "workspace:*",
"validate-npm-package-name": "catalog:"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/tools/.upstream-versions.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"rolldown": {
"repo": "git@github.com:rolldown/rolldown.git",
"repo": "https://github.com/rolldown/rolldown.git",
"branch": "main",
"hash": "c013fc844242178da7c4e9a7ec9f24697efcd726"
},
"rolldown-vite": {
"repo": "git@github.com:vitejs/rolldown-vite.git",
"branch": "rolldown-vite",
"hash": "ef44d7526b86704667168418f0ed9a0300652297"
"repo": "https://github.com/vitejs/vite.git",
"branch": "main",
"hash": "08c74cc54b1892e1d2f29840c18ef61f05963301"
}
}
25 changes: 19 additions & 6 deletions packages/tools/src/sync-remote-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ function cloneOrResetRepo(repoUrl: string, dir: string, branch: string = 'main',
return;
}

// Fetch latest commits
execCommand('git fetch origin', dir);
// Fetch latest commits and tags
execCommand('git fetch origin --tags', dir);

if (hash) {
// Reset to specific hash
Expand All @@ -93,11 +93,24 @@ function cloneOrResetRepo(repoUrl: string, dir: string, branch: string = 'main',
execCommand(`git reset --hard ${hash}`, dir);
log(`${dir} reset to ${hash.substring(0, 8)}`);
} else {
// Reset to latest
// Reset to latest - check if branch is a tag or a branch
log(`Resetting ${dir} to latest ${branch}...`);
execCommand(`git checkout ${branch}`, dir);
execCommand(`git reset --hard origin/${branch}`, dir);
log(`${dir} reset to latest ${branch}`);
const isTag =
spawnSync('git', ['tag', '-l', branch], {
cwd: dir,
encoding: 'utf-8',
}).stdout.trim() === branch;

if (isTag) {
// For tags, just checkout the tag directly
execCommand(`git checkout ${branch}`, dir);
log(`${dir} reset to tag ${branch}`);
} else {
// For branches, reset to origin/branch
execCommand(`git checkout ${branch}`, dir);
execCommand(`git reset --hard origin/${branch}`, dir);
log(`${dir} reset to latest ${branch}`);
}
}
} catch (err: any) {
log(`Failed to reset ${dir} (${err.message}), removing and re-cloning...`);
Expand Down
Loading
Loading