Skip to content
Draft
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
7 changes: 4 additions & 3 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"vite",
"vitest",
"vitest-dev",
"yuku-parser"
"yuku"
],
"enabled": false
},
Expand Down Expand Up @@ -163,8 +163,7 @@
"anyhow",
"append-only-vec",
"arcstr",
"async-channel",
"async-scoped",
"async-lock",
"base-encode",
"base64-simd",
"bitflags",
Expand All @@ -173,6 +172,7 @@
"dashmap",
"derive_more",
"dunce",
"event-listener",
"fast-glob",
"flate2",
"form_urlencoded",
Expand Down Expand Up @@ -212,6 +212,7 @@
"rolldown-ariadne",
"rolldown-notify",
"rolldown-notify-debouncer-full",
"rolldown-notify-napi",
"rustc-hash",
"schemars",
"self_cell",
Expand Down
13 changes: 9 additions & 4 deletions .github/scripts/upgrade-deps-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ export function getBundledDependencyRanges(
const tsdownRequire = createRequire(coreRequire.resolve('tsdown/package.json'));
const pluginPath = tsdownRequire.resolve('rolldown-plugin-dts/package.json');
const vitePath = join(root, 'vite/packages/vite/package.json');
const pluginDependencies = readJsonObject(pluginPath).dependencies;
const yukuPackage =
isObjectValue(pluginDependencies) && typeof pluginDependencies.yuku === 'string'
? 'yuku'
: 'yuku-parser';
// These packages stay external in packages/core/build.ts. Follow their
// bundled consumers rather than independently selecting the latest releases.
const sources: Array<{ path: string; field: DependencyField; name: string }> = [
{ path: pluginPath, field: 'dependencies', name: 'yuku-parser' },
{ path: pluginPath, field: 'dependencies', name: yukuPackage },
{ path: vitePath, field: 'dependencies', name: 'postcss' },
{ path: vitePath, field: 'optionalDependencies', name: 'fsevents' },
];
Expand All @@ -28,9 +33,9 @@ export function getBundledDependencyRanges(
if (typeof range !== 'string' || range.trim() === '') {
throw new Error(`Missing ${field}.${name} in ${path}; review core's externals`);
}
if (name === 'yuku-parser') {
// Pin the runtime parser to the exact version resolved by the bundled plugin.
const parserPath = createRequire(path).resolve('yuku-parser/package.json');
if (name === 'yuku' || name === 'yuku-parser') {
// Pin the native runtime to the exact version resolved by the bundled plugin.
const parserPath = createRequire(path).resolve(`${name}/package.json`);
const { version } = readJsonObject(parserPath);
if (typeof version !== 'string' || version.trim() === '') {
throw new Error(`Missing version in ${parserPath}; review core's externals`);
Expand Down
28 changes: 25 additions & 3 deletions .github/scripts/upgrade-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type LatestTagOptions = {
};

const upstreamNames = ['rolldown', 'vite', 'oxc-node'] as const;
type UpstreamVersions = Record<(typeof upstreamNames)[number], { hash: string }>;
type UpstreamVersions = Record<(typeof upstreamNames)[number], { hash: string; branch?: string }>;

type PnpmWorkspaceVersions = {
vitest: string;
Expand Down Expand Up @@ -240,6 +240,10 @@ async function updateUpstreamVersions(): Promise<void> {
getLatestTag('oxc-project', 'oxc-node', { stableOnly: true }),
]);
data.rolldown.hash = rolldown.sha;
const rolldownReleaseLine = /^v?(\d+\.\d+)\.\d+$/.exec(rolldown.tag)?.[1];
if (rolldownReleaseLine) {
data.rolldown.branch = `v${rolldownReleaseLine}`;
}
data.vite.hash = vite.sha;
recordChange('rolldown', oldRolldownHash, rolldown.sha, rolldown.tag);
recordChange('vite', oldViteHash, vite.sha, vite.tag);
Expand Down Expand Up @@ -548,11 +552,29 @@ function syncBundledDependencies(): void {
const pkg = readJsonObject(filePath);
for (const { name, field, range } of ranges) {
const dependencies = pkg[field];
if (!isObjectValue(dependencies) || typeof dependencies[name] !== 'string') {
if (!isObjectValue(dependencies)) {
throw new Error(`Missing ${field} in ${filePath}`);
}
const previousRange = dependencies[name];
// Yuku 0.28 consolidated the parser and its native core into `yuku`.
// Migrate core's external when the bundled plugin adopts the new package.
const replacesLegacyParser =
name === 'yuku' &&
typeof previousRange !== 'string' &&
typeof dependencies['yuku-parser'] === 'string';
if (replacesLegacyParser) {
delete dependencies['yuku-parser'];
}
if (typeof previousRange !== 'string' && !replacesLegacyParser) {
throw new Error(`Missing ${field}.${name} in ${filePath}`);
}
// Preserve the original version if synchronization runs again after fixups.
recordChange(name, changes.get(name)?.old ?? dependencies[name], range);
recordChange(
name,
changes.get(name)?.old ??
(typeof previousRange === 'string' && !replacesLegacyParser ? previousRange : undefined),
range,
);
dependencies[name] = range;
}
syncCoreVersion(pkg);
Expand Down
Loading
Loading