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
358 changes: 184 additions & 174 deletions Cargo.lock

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ napi-derive = { version = "3.0.0", default-features = false, features = [
nix = { version = "0.30.1", features = ["dir"] }
nodejs-built-in-modules = "1.0.0"
nom = "8.0.0"
num-bigint = "0.4.6"
num-bigint = "0.5.1"
num_cpus = "1.17"
owo-colors = "4.2.2"
parking_lot = "0.12.5"
Expand Down Expand Up @@ -317,7 +317,7 @@ xxhash-rust = "0.8.15"
zip = { version = "7.2", default-features = false, features = ["deflate-flate2-zlib-rs"] }

# oxc crates with the same version
oxc = { version = "0.138.0", features = [
oxc = { version = "0.139.0", features = [
"ast_visit",
"transformer",
"minifier",
Expand All @@ -329,23 +329,23 @@ oxc = { version = "0.138.0", features = [
"regular_expression",
"cfg",
] }
oxc_allocator = { version = "0.138.0", features = ["pool"] }
oxc_ast = "0.138.0"
oxc_ecmascript = "0.138.0"
oxc_parser = "0.138.0"
oxc_span = "0.138.0"
oxc_napi = "0.138.0"
oxc_str = "0.138.0"
oxc_minify_napi = "0.138.0"
oxc_parser_napi = "0.138.0"
oxc_transform_napi = "0.138.0"
oxc_traverse = "0.138.0"
oxc_allocator = { version = "0.139.0", features = ["pool"] }
oxc_ast = "0.139.0"
oxc_ecmascript = "0.139.0"
oxc_parser = "0.139.0"
oxc_span = "0.139.0"
oxc_napi = "0.139.0"
oxc_str = "0.139.0"
oxc_minify_napi = "0.139.0"
oxc_parser_napi = "0.139.0"
oxc_transform_napi = "0.139.0"
oxc_traverse = "0.139.0"

# oxc crates in their own repos
oxc_index = { version = "5", features = ["rayon", "serde"] }
oxc_resolver = { version = "11.22.0", features = ["yarn_pnp"] }
oxc_resolver_napi = { version = "11.22.0", default-features = false, features = ["yarn_pnp"] }
oxc_sourcemap = "8.0.1"
oxc_resolver = { version = "11.23.0", features = ["yarn_pnp"] }
oxc_resolver_napi = { version = "11.23.0", default-features = false, features = ["yarn_pnp"] }
oxc_sourcemap = "8.1.0"

# rolldown crates
rolldown = { path = "./rolldown/crates/rolldown" }
Expand Down
8 changes: 2 additions & 6 deletions docs/config/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ import { defineConfig } from 'vite-plus';
export default defineConfig({
run: {
enablePrePostScripts: true,
cache: {
/* ... */
},
tasks: {
/* ... */
},
cache: {/* ... */},
tasks: {/* ... */},
},
});
```
Expand Down
40 changes: 14 additions & 26 deletions packages/cli/binding/index.d.cts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@ export interface MangleOptions {
* @default false
*/
keepNames?: boolean | MangleOptionsKeepNames;
/**
* Names that bindings must not be renamed to, and that bindings already
* carrying them keep. Equivalent to terser's `mangle.reserved`.
*
* Pass `['exports', 'module']` when minifying prebuilt CommonJS / UMD files
* that Node consumers `import` directly, so Node's cjs-module-lexer can still
* detect the mangled module's named exports.
*
* @default []
*/
reserved?: Array<string>;
/** Debug mangled names. */
debug?: boolean;
}
Expand Down Expand Up @@ -1762,6 +1773,7 @@ export declare class BindingNormalizedOptions {
get name(): string | null;
get entryFilenames(): string | undefined;
get chunkFilenames(): string | undefined;
get sourcemapFilenames(): string | undefined;
get assetFilenames(): string | undefined;
get dir(): string | null;
get file(): string | null;
Expand Down Expand Up @@ -2591,15 +2603,6 @@ export interface BindingMatchGroup {
includeDependenciesRecursively?: boolean;
}

export interface BindingModulePreloadOptions {
polyfill: boolean;
resolveDependencies?: (
filename: string,
deps: string[],
context: { hostId: string; hostType: 'html' | 'js' },
) => string[];
}

export interface BindingModules {
values: Array<BindingRenderedModule>;
keys: Array<string>;
Expand Down Expand Up @@ -2643,6 +2646,7 @@ export interface BindingOutputOptions {
paths?: Record<string, string> | ((id: string) => string);
plugins: (BindingBuiltinPlugin | BindingPluginOptions | undefined)[];
sourcemap?: 'file' | 'inline' | 'hidden';
sourcemapFileNames?: string | ((chunk: PreRenderedChunk) => string);
sourcemapBaseUrl?: string;
sourcemapIgnoreList?:
| boolean
Expand Down Expand Up @@ -2843,18 +2847,6 @@ export declare const enum BindingRebuildStrategy {
Never = 2,
}

export interface BindingRenderBuiltUrlConfig {
ssr: boolean;
type: 'asset' | 'public';
hostId: string;
hostType: 'js' | 'css' | 'html';
}

export interface BindingRenderBuiltUrlRet {
relative?: boolean;
runtime?: string;
}

export interface BindingReplacePluginConfig {
values: Record<string, string>;
delimiters?: [string, string];
Expand All @@ -2863,11 +2855,6 @@ export interface BindingReplacePluginConfig {
sourcemap?: boolean;
}

export interface BindingResolveDependenciesContext {
hostId: string;
hostType: string;
}

export type BindingResolvedExternal = boolean | string;

export interface BindingResolveOptions {
Expand Down Expand Up @@ -3202,6 +3189,7 @@ export interface JsOutputChunk {
map?: BindingSourcemap;
sourcemapFilename?: string;
preliminaryFilename: string;
preliminarySourcemapFilename?: string;
}

/** Error emitted from native side, it only contains kind and message, no stack trace. */
Expand Down
10 changes: 10 additions & 0 deletions packages/core/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,20 @@ async function bundleTsdown() {
// (a native module) and `postcss` also stay external: `@tsdown/css` pulls them
// in and they cannot be bundled. Both are core `dependencies`, so they resolve
// at runtime and CSS bundling works without users installing anything.
//
// `yuku-codegen` and `yuku-parser` (pulled in by `rolldown-plugin-dts` for dts
// generation) are napi packages: their loaders `require` a per-platform
// `@yuku-*/binding-<platform>/*.node` relative to their own `__dirname`.
// Bundling their JS into a core chunk rebinds `__dirname` to `dist/tsdown/`,
// so the native binding no longer resolves. Keep them external and list them
// as core `dependencies` so each package's loader resolves its own binding
// (declared as optionalDependencies) at runtime.
const tsdownExternal = [
...Object.keys(pkgJson.peerDependencies).filter((name) => !bundledTsdownPackages.has(name)),
'lightningcss',
'postcss',
'yuku-codegen',
'yuku-parser',
];
const isExternal = (id: string) => tsdownExternal.some((e) => id === e || id.startsWith(`${e}/`));

Expand Down
8 changes: 5 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
"@oxc-project/runtime": "catalog:",
"@oxc-project/types": "catalog:",
"lightningcss": "catalog:",
"postcss": "^8.5.6"
"postcss": "^8.5.6",
"yuku-codegen": "^0.5.44",
"yuku-parser": "^0.5.44"
},
"devDependencies": {
"@ast-grep/napi": "^0.43.0",
Expand Down Expand Up @@ -213,7 +215,7 @@
},
"bundledVersions": {
"vite": "8.1.3",
"rolldown": "1.1.4",
"tsdown": "0.22.3"
"rolldown": "1.1.5",
"tsdown": "0.22.4"
}
}
2 changes: 1 addition & 1 deletion packages/tools/.upstream-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"rolldown": {
"repo": "https://github.com/rolldown/rolldown.git",
"branch": "main",
"hash": "6cbd2330dc5ca973b90444973ee04c2dc7ee2f2d"
"hash": "f09947ab017d6df74299f691853dcfc4f4f0f86e"
},
"vite": {
"repo": "https://github.com/vitejs/vite.git",
Expand Down
2 changes: 1 addition & 1 deletion packages/tools/src/local-npm-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ const upstreamAgent = new HttpsAgent({ keepAlive: true, maxSockets: 64 });
// in a pnpm-packed tarball, so long-name (pax header) handling is unnecessary.
function readPackageJsonFromTarball(tgzBytes: Buffer, sourcePath: string): PackageManifest {
const tar = gunzipSync(tgzBytes);
for (let offset = 0; offset + 512 <= tar.length; ) {
for (let offset = 0; offset + 512 <= tar.length;) {
const rawName = tar.subarray(offset, offset + 100).toString();
const nulIndex = rawName.indexOf('\0');
const name = nulIndex === -1 ? rawName : rawName.slice(0, nulIndex);
Expand Down
Loading
Loading