Skip to content
Closed
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
1 change: 0 additions & 1 deletion .github/actions/build-upstream/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ runs:
- name: Build upstream TypeScript packages
shell: bash
run: |
pnpm --filter @rolldown/pluginutils build
pnpm --filter rolldown build-node
pnpm --filter vite build-types
pnpm --filter "@voidzero-dev/*" build
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
failed to load config from <cwd>/vite.config.ts
Failed to load vite.config: Build failed with 1 error:

[PARSE_ERROR] Error: Unexpected token
[PARSE_ERROR] Unexpected token
╭─[ vite.config.ts:5:42 ]
5 │ // syntax error: missing closing brace
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/snap-tests/bin-oxlint-wrapper/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ Output
-f, --format=ARG Use a specific output format. Possible values: `checkstyle`,
`default`, `agent`, `github`, `gitlab`, `json`, `junit`, `sarif`,
`stylish`, `unix`
--debug=OPTIONS Enable debug output options. Options are comma-separated. Possible
values:
* `timings` - Enable per-rule timing information.

Miscellaneous
--silent Do not display any diagnostics
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/snap-tests/command-helper/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ Output
-f, --format=ARG Use a specific output format. Possible values: `checkstyle`,
`default`, `agent`, `github`, `gitlab`, `json`, `junit`, `sarif`,
`stylish`, `unix`
--debug=OPTIONS Enable debug output options. Options are comma-separated. Possible
values:
* `timings` - Enable per-rule timing information.

Miscellaneous
--silent Do not display any diagnostics
Expand Down
20 changes: 10 additions & 10 deletions packages/cli/src/create/__tests__/org-tarball.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ import {
sanitizeHostForPath,
} from '../org-tarball.js';

function makeStaging(parent: string, base: string, ageMs: number): string {
const name = `${base}.tmp-${process.pid}-${Date.now() - ageMs}`;
const dir = path.join(parent, name);
fs.mkdirSync(dir, { recursive: true });
fs.writeFileSync(path.join(dir, 'marker'), '');
const then = new Date(Date.now() - ageMs);
fs.utimesSync(dir, then, then);
return dir;
}

describe('resolveBundledPath', () => {
const scratchDirs: string[] = [];

Expand Down Expand Up @@ -137,16 +147,6 @@ describe('cleanupStaleStagingDirs', () => {
return { destDir: path.join(parent, base), parent, base };
}

function makeStaging(parent: string, base: string, ageMs: number): string {
const name = `${base}.tmp-${process.pid}-${Date.now() - ageMs}`;
const dir = path.join(parent, name);
fs.mkdirSync(dir, { recursive: true });
fs.writeFileSync(path.join(dir, 'marker'), '');
const then = new Date(Date.now() - ageMs);
fs.utimesSync(dir, then, then);
return dir;
}

it('deletes siblings older than 24h', async () => {
const { destDir, parent, base } = tmpDestDir();
const stale = makeStaging(parent, base, 25 * 60 * 60 * 1000);
Expand Down
9 changes: 1 addition & 8 deletions packages/core/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@ import viteRolldownConfig from './vite-rolldown.config.js';

const projectDir = join(fileURLToPath(import.meta.url), '..');

const rolldownPluginUtilsDir = resolve(
projectDir,
'..',
'..',
'rolldown',
'packages',
'pluginutils',
);
const rolldownPluginUtilsDir = resolve(projectDir, 'node_modules', '@rolldown', 'pluginutils');

const rolldownSourceDir = resolve(projectDir, '..', '..', 'rolldown', 'packages', 'rolldown');

Expand Down
15 changes: 8 additions & 7 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@
"types": "./dist/rolldown/plugins-index.d.mts"
},
"./rolldown/pluginutils": {
"default": "./dist/pluginutils/index.js",
"types": "./dist/pluginutils/index.d.ts"
"default": "./dist/pluginutils/index.mjs",
"types": "./dist/pluginutils/index.d.mts"
},
"./rolldown/pluginutils/filter": {
"default": "./dist/pluginutils/filter/index.js",
"types": "./dist/pluginutils/filter/index.d.ts"
"default": "./dist/pluginutils/filter/index.mjs",
"types": "./dist/pluginutils/filter/index.d.mts"
},
"./rolldown/utils": {
"default": "./dist/rolldown/utils-index.mjs",
Expand All @@ -118,7 +118,8 @@
"@babel/types": "^7.28.5",
"@oxc-node/cli": "catalog:",
"@oxc-node/core": "catalog:",
"@vitejs/devtools": "^0.1.21",
"@rolldown/pluginutils": "catalog:",
"@vitejs/devtools": "^0.1.24",
"es-module-lexer": "^1.7.0",
"hookable": "^6.0.1",
"magic-string": "^0.30.21",
Expand Down Expand Up @@ -224,8 +225,8 @@
"node": "^20.19.0 || >=22.12.0"
},
"bundledVersions": {
"vite": "8.0.11",
"rolldown": "1.0.0",
"vite": "8.0.13",
"rolldown": "1.0.1",
"tsdown": "0.22.0"
}
}
41 changes: 21 additions & 20 deletions packages/prompts/src/group-multi-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,31 @@ export interface GroupMultiSelectOptions<Value> extends CommonOptions {
selectableGroups?: boolean;
groupSpacing?: number;
}
const withMarkerAndPrefix = (
marker: string,
prefix: string,
prefixWidth: number,
label: string,
format: (text: string) => string,
firstLineSuffix = '',
spacingPrefix = '',
) => {
const lines = label.split('\n');
const continuationPrefix = `${S_POINTER_INACTIVE} ${' '.repeat(prefixWidth)}`;
if (lines.length === 1) {
return `${spacingPrefix}${marker} ${prefix}${format(lines[0])}${firstLineSuffix}`;
}
const [firstLine, ...rest] = lines;
return [
`${spacingPrefix}${marker} ${prefix}${format(firstLine)}${firstLineSuffix}`,
...rest.map((line) => `${continuationPrefix}${format(line)}`),
].join('\n');
};

export const groupMultiselect = <Value>(opts: GroupMultiSelectOptions<Value>) => {
const { selectableGroups = true, groupSpacing = 0 } = opts;
const hasGuide = opts.withGuide ?? false;
const nestedPrefix = ' ';
const withMarkerAndPrefix = (
marker: string,
prefix: string,
prefixWidth: number,
label: string,
format: (text: string) => string,
firstLineSuffix = '',
spacingPrefix = '',
) => {
const lines = label.split('\n');
const continuationPrefix = `${S_POINTER_INACTIVE} ${' '.repeat(prefixWidth)}`;
if (lines.length === 1) {
return `${spacingPrefix}${marker} ${prefix}${format(lines[0])}${firstLineSuffix}`;
}
const [firstLine, ...rest] = lines;
return [
`${spacingPrefix}${marker} ${prefix}${format(firstLine)}${firstLineSuffix}`,
...rest.map((line) => `${continuationPrefix}${format(line)}`),
].join('\n');
};

const opt = (
option: Option<Value> & { group: string | boolean },
Expand Down
29 changes: 15 additions & 14 deletions packages/prompts/src/progress-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ const S_PROGRESS_CHAR: Record<NonNullable<ProgressOptions['style']>, string> = {
block: unicodeOr('█', '#'),
};

const activeStyle = (state: State) => {
switch (state) {
case 'initial':
case 'active':
return color.magenta;
case 'error':
case 'cancel':
return color.red;
case 'submit':
return completeColor;
default:
return color.magenta;
}
};

export interface ProgressOptions extends SpinnerOptions {
style?: 'light' | 'heavy' | 'block';
max?: number;
Expand All @@ -33,20 +48,6 @@ export function progress({
const max = Math.max(1, userMax);
const size = Math.max(1, userSize);

const activeStyle = (state: State) => {
switch (state) {
case 'initial':
case 'active':
return color.magenta;
case 'error':
case 'cancel':
return color.red;
case 'submit':
return completeColor;
default:
return color.magenta;
}
};
const drawProgress = (state: State, msg: string) => {
const active = Math.floor((value / max) * size);
return `${activeStyle(state)(S_PROGRESS_CHAR[style].repeat(active))}${color.dim(S_PROGRESS_CHAR[style].repeat(size - active))} ${msg}`;
Expand Down
22 changes: 11 additions & 11 deletions packages/prompts/src/select-key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ export interface SelectKeyOptions<Value extends string> extends CommonOptions {
caseSensitive?: boolean;
}

export const selectKey = <Value extends string>(opts: SelectKeyOptions<Value>) => {
const withMarker = (marker: string, value: string) => {
const lines = value.split('\n');
if (lines.length === 1) {
return `${marker} ${lines[0]}`;
}
const [firstLine, ...rest] = lines;
return [`${marker} ${firstLine}`, ...rest.map((line) => `${S_POINTER_INACTIVE} ${line}`)].join(
'\n',
);
};
const withMarker = (marker: string, value: string) => {
const lines = value.split('\n');
if (lines.length === 1) {
return `${marker} ${lines[0]}`;
}
const [firstLine, ...rest] = lines;
return [`${marker} ${firstLine}`, ...rest.map((line) => `${S_POINTER_INACTIVE} ${line}`)].join(
'\n',
);
};

export const selectKey = <Value extends string>(opts: SelectKeyOptions<Value>) => {
const opt = (
option: Option<Value>,
state: 'inactive' | 'active' | 'selected' | 'cancelled' = 'inactive',
Expand Down
32 changes: 16 additions & 16 deletions packages/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,17 +293,17 @@
"@blazediff/core": "1.9.1",
"@oxc-node/cli": "catalog:",
"@oxc-node/core": "catalog:",
"@vitest/browser": "4.1.5",
"@vitest/browser-playwright": "4.1.5",
"@vitest/browser-preview": "4.1.5",
"@vitest/browser-webdriverio": "4.1.5",
"@vitest/expect": "4.1.5",
"@vitest/mocker": "4.1.5",
"@vitest/pretty-format": "4.1.5",
"@vitest/runner": "4.1.5",
"@vitest/snapshot": "4.1.5",
"@vitest/spy": "4.1.5",
"@vitest/utils": "4.1.5",
"@vitest/browser": "4.1.6",
"@vitest/browser-playwright": "4.1.6",
"@vitest/browser-preview": "4.1.6",
"@vitest/browser-webdriverio": "4.1.6",
"@vitest/expect": "4.1.6",
"@vitest/mocker": "4.1.6",
"@vitest/pretty-format": "4.1.6",
"@vitest/runner": "4.1.6",
"@vitest/snapshot": "4.1.6",
"@vitest/spy": "4.1.6",
"@vitest/utils": "4.1.6",
"chai": "^6.2.1",
"convert-source-map": "^2.0.0",
"estree-walker": "^3.0.3",
Expand All @@ -316,16 +316,16 @@
"rolldown": "workspace:*",
"rolldown-plugin-dts": "catalog:",
"tinyrainbow": "^3.1.0",
"vitest-dev": "^4.1.5",
"vitest-dev": "^4.1.6",
"why-is-node-running": "^2.3.0"
},
"peerDependencies": {
"@edge-runtime/vm": "*",
"@opentelemetry/api": "^1.9.0",
"@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
"@vitest/coverage-istanbul": "4.1.5",
"@vitest/coverage-v8": "4.1.5",
"@vitest/ui": "4.1.5",
"@vitest/coverage-istanbul": "4.1.6",
"@vitest/coverage-v8": "4.1.6",
"@vitest/ui": "4.1.6",
"happy-dom": "*",
"jsdom": "*",
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
Expand Down Expand Up @@ -363,6 +363,6 @@
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"bundledVersions": {
"vitest": "4.1.5"
"vitest": "4.1.6"
}
}
4 changes: 2 additions & 2 deletions packages/tools/.upstream-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"rolldown": {
"repo": "https://github.com/rolldown/rolldown.git",
"branch": "main",
"hash": "ac5c71025a639d394a0db9c3a921b7eda5d71a88"
"hash": "27779450b5986931e7c798184ec3aa82e60e7090"
},
"vite": {
"repo": "https://github.com/vitejs/vite.git",
"branch": "main",
"hash": "66f3194aa8e59924562575f0a98e7f4ae0acdd89"
"hash": "a46f11a6c218f74b08ffb3e33a25c2ce02ba6643"
}
}
16 changes: 14 additions & 2 deletions packages/tools/src/sync-remote-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,15 @@ function transformPluginutilsExport(
},
];
}
if (newValue.endsWith('.mjs')) {
return [
newExportPath,
{
default: newValue,
types: newValue.replace(/\.mjs$/, '.d.mts'),
},
];
}
return [newExportPath, newValue];
}

Expand All @@ -287,6 +296,8 @@ function transformPluginutilsExport(
if (importPath && !('types' in newValue)) {
if (importPath.endsWith('.js')) {
newValue.types = importPath.replace(/\.js$/, '.d.ts');
} else if (importPath.endsWith('.mjs')) {
newValue.types = importPath.replace(/\.mjs$/, '.d.mts');
}
}
}
Expand Down Expand Up @@ -737,8 +748,9 @@ export async function syncRemote() {
const rolldownVitePackagePath = join(rootDir, VITE_DIR, 'packages', 'vite', 'package.json');
const pluginutilsPackagePath = join(
rootDir,
ROLLDOWN_DIR,
'packages',
CORE_PACKAGE_PATH,
'node_modules',
'@rolldown',
'pluginutils',
'package.json',
);
Expand Down
Loading
Loading