rolldown 1.0.0-beta.45 → 1.0.0-beta.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-setup.mjs +4 -3
- package/dist/cli.mjs +6 -6
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -4
- package/dist/experimental-index.d.mts +3 -3
- package/dist/experimental-index.mjs +59 -8
- package/dist/experimental-runtime-types.d.ts +16 -5
- package/dist/filter-index.d.mts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -3
- package/dist/parallel-plugin-worker.mjs +5 -4
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +2 -2
- package/dist/shared/{binding-S7w0fEEX.d.mts → binding-CCMrV5an.d.mts} +37 -22
- package/dist/shared/binding-DOZoR4bu.mjs +578 -0
- package/dist/shared/{define-config-BhR6ffrr.d.mts → define-config-Czc1YEBi.d.mts} +59 -5
- package/dist/shared/{load-config-jm5iO_Ww.mjs → load-config-Brje6-4J.mjs} +1 -1
- package/dist/shared/{parse-ast-index-lp33x2Wb.mjs → parse-ast-index-oPgrkdqc.mjs} +11 -5
- package/dist/shared/{src-CPA2meNe.mjs → src-D1weNlnG.mjs} +277 -125
- package/package.json +24 -22
- package/dist/shared/binding-D7oxcV7l.mjs +0 -10719
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as logCycleLoading, c as logDeprecatedInject, d as logInputHookInOutputPlugin, f as logInvalidLogPosition, h as styleText, i as error, l as logDeprecatedKeepNames, m as logPluginError, o as logDeprecatedDefine, p as logMultiplyNotifyOption, r as augmentCodeLocation, s as logDeprecatedDropLabels, t as parseAst, u as logDeprecatedProfilerNames } from "./parse-ast-index-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-DOZoR4bu.mjs";
|
|
2
|
+
import { a as logCycleLoading, c as logDeprecatedInject, d as logInputHookInOutputPlugin, f as logInvalidLogPosition, h as styleText, i as error, l as logDeprecatedKeepNames, m as logPluginError, o as logDeprecatedDefine, p as logMultiplyNotifyOption, r as augmentCodeLocation, s as logDeprecatedDropLabels, t as parseAst, u as logDeprecatedProfilerNames } from "./parse-ast-index-oPgrkdqc.mjs";
|
|
3
3
|
import { a as unreachable, i as unimplemented, o as unsupported, r as noop, t as arraify } from "./misc-usdOVIou.mjs";
|
|
4
4
|
import { Worker, isMainThread } from "node:worker_threads";
|
|
5
5
|
import path from "node:path";
|
|
@@ -209,8 +209,9 @@ const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new Signa
|
|
|
209
209
|
|
|
210
210
|
//#endregion
|
|
211
211
|
//#region src/setup.ts
|
|
212
|
+
var import_binding$8 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
212
213
|
if (isMainThread) {
|
|
213
|
-
const subscriberGuard = initTraceSubscriber();
|
|
214
|
+
const subscriberGuard = (0, import_binding$8.initTraceSubscriber)();
|
|
214
215
|
onExit(() => {
|
|
215
216
|
subscriberGuard?.close();
|
|
216
217
|
});
|
|
@@ -218,11 +219,12 @@ if (isMainThread) {
|
|
|
218
219
|
|
|
219
220
|
//#endregion
|
|
220
221
|
//#region package.json
|
|
221
|
-
var version = "1.0.0-beta.
|
|
222
|
+
var version = "1.0.0-beta.46";
|
|
222
223
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
223
224
|
|
|
224
225
|
//#endregion
|
|
225
226
|
//#region src/builtin-plugin/utils.ts
|
|
227
|
+
var import_binding$7 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
226
228
|
var BuiltinPlugin = class {
|
|
227
229
|
constructor(name, _options) {
|
|
228
230
|
this.name = name;
|
|
@@ -230,7 +232,7 @@ var BuiltinPlugin = class {
|
|
|
230
232
|
}
|
|
231
233
|
};
|
|
232
234
|
function makeBuiltinPluginCallable(plugin) {
|
|
233
|
-
let callablePlugin = new BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
235
|
+
let callablePlugin = new import_binding$7.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
234
236
|
const wrappedPlugin = plugin;
|
|
235
237
|
for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
|
|
236
238
|
try {
|
|
@@ -2137,19 +2139,63 @@ function getCliSchemaInfo() {
|
|
|
2137
2139
|
}
|
|
2138
2140
|
|
|
2139
2141
|
//#endregion
|
|
2140
|
-
//#region src/
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2142
|
+
//#region src/decorators/lazy.ts
|
|
2143
|
+
const LAZY_FIELDS_KEY = Symbol("__lazy_fields__");
|
|
2144
|
+
const LAZY_CACHE_PREFIX = "__cached_";
|
|
2145
|
+
/**
|
|
2146
|
+
* Legacy decorator that makes a getter lazy-evaluated and cached.
|
|
2147
|
+
* Also auto-registers the field for batch prefetching.
|
|
2148
|
+
*
|
|
2149
|
+
* @example
|
|
2150
|
+
* ```typescript
|
|
2151
|
+
* class MyClass {
|
|
2152
|
+
* @lazy
|
|
2153
|
+
* get expensiveValue() {
|
|
2154
|
+
* return someExpensiveComputation();
|
|
2155
|
+
* }
|
|
2156
|
+
* }
|
|
2157
|
+
* ```
|
|
2158
|
+
*/
|
|
2159
|
+
function lazy(target, propertyKey, descriptor) {
|
|
2160
|
+
if (!target.constructor[LAZY_FIELDS_KEY]) target.constructor[LAZY_FIELDS_KEY] = /* @__PURE__ */ new Set();
|
|
2161
|
+
target.constructor[LAZY_FIELDS_KEY].add(propertyKey);
|
|
2162
|
+
const originalGetter = descriptor.get;
|
|
2163
|
+
const cacheKey = LAZY_CACHE_PREFIX + propertyKey;
|
|
2164
|
+
descriptor.get = function() {
|
|
2165
|
+
if (!(cacheKey in this)) this[cacheKey] = originalGetter.call(this);
|
|
2166
|
+
return this[cacheKey];
|
|
2167
|
+
};
|
|
2168
|
+
return descriptor;
|
|
2169
|
+
}
|
|
2170
|
+
/**
|
|
2171
|
+
* Get all lazy field names from a class instance.
|
|
2172
|
+
*
|
|
2173
|
+
* @param instance - Instance to inspect
|
|
2174
|
+
* @returns Set of lazy property names
|
|
2175
|
+
*/
|
|
2176
|
+
function getLazyFields(instance$1) {
|
|
2177
|
+
return instance$1.constructor[LAZY_FIELDS_KEY] || /* @__PURE__ */ new Set();
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
//#endregion
|
|
2181
|
+
//#region src/decorators/non-enumerable.ts
|
|
2182
|
+
/**
|
|
2183
|
+
* Decorator that makes a property or method non-enumerable.
|
|
2184
|
+
* This hides the property from enumeration (e.g., Object.keys(), for...in loops).
|
|
2185
|
+
*
|
|
2186
|
+
* @example
|
|
2187
|
+
* ```typescript
|
|
2188
|
+
* class MyClass {
|
|
2189
|
+
* @nonEnumerable
|
|
2190
|
+
* hiddenMethod() {
|
|
2191
|
+
* return 'This method will not show up in Object.keys()';
|
|
2192
|
+
* }
|
|
2193
|
+
* }
|
|
2194
|
+
* ```
|
|
2195
|
+
*/
|
|
2196
|
+
function nonEnumerable(target, propertyKey, descriptor) {
|
|
2197
|
+
descriptor.enumerable = false;
|
|
2198
|
+
return descriptor;
|
|
2153
2199
|
}
|
|
2154
2200
|
|
|
2155
2201
|
//#endregion
|
|
@@ -2161,6 +2207,56 @@ function bindingAssetSource(source) {
|
|
|
2161
2207
|
return { inner: source };
|
|
2162
2208
|
}
|
|
2163
2209
|
|
|
2210
|
+
//#endregion
|
|
2211
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/decorate.js
|
|
2212
|
+
function __decorate(decorators, target, key, desc) {
|
|
2213
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2214
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2215
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2216
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
//#endregion
|
|
2220
|
+
//#region src/types/output-asset-impl.ts
|
|
2221
|
+
var OutputAssetImpl = class {
|
|
2222
|
+
type = "asset";
|
|
2223
|
+
constructor(bindingAsset) {
|
|
2224
|
+
this.bindingAsset = bindingAsset;
|
|
2225
|
+
}
|
|
2226
|
+
get fileName() {
|
|
2227
|
+
return this.bindingAsset.getFileName();
|
|
2228
|
+
}
|
|
2229
|
+
get originalFileName() {
|
|
2230
|
+
return this.bindingAsset.getOriginalFileName() || null;
|
|
2231
|
+
}
|
|
2232
|
+
get originalFileNames() {
|
|
2233
|
+
return this.bindingAsset.getOriginalFileNames();
|
|
2234
|
+
}
|
|
2235
|
+
get name() {
|
|
2236
|
+
return this.bindingAsset.getName() ?? void 0;
|
|
2237
|
+
}
|
|
2238
|
+
get names() {
|
|
2239
|
+
return this.bindingAsset.getNames();
|
|
2240
|
+
}
|
|
2241
|
+
get source() {
|
|
2242
|
+
return transformAssetSource(this.bindingAsset.getSource());
|
|
2243
|
+
}
|
|
2244
|
+
__rolldown_external_memory_handle__(keepDataAlive) {
|
|
2245
|
+
if (keepDataAlive) this.#evaluateAllLazyFields();
|
|
2246
|
+
return this.bindingAsset.dropInner();
|
|
2247
|
+
}
|
|
2248
|
+
#evaluateAllLazyFields() {
|
|
2249
|
+
for (const field of getLazyFields(this)) this[field];
|
|
2250
|
+
}
|
|
2251
|
+
};
|
|
2252
|
+
__decorate([lazy], OutputAssetImpl.prototype, "fileName", null);
|
|
2253
|
+
__decorate([lazy], OutputAssetImpl.prototype, "originalFileName", null);
|
|
2254
|
+
__decorate([lazy], OutputAssetImpl.prototype, "originalFileNames", null);
|
|
2255
|
+
__decorate([lazy], OutputAssetImpl.prototype, "name", null);
|
|
2256
|
+
__decorate([lazy], OutputAssetImpl.prototype, "names", null);
|
|
2257
|
+
__decorate([lazy], OutputAssetImpl.prototype, "source", null);
|
|
2258
|
+
__decorate([nonEnumerable], OutputAssetImpl.prototype, "__rolldown_external_memory_handle__", null);
|
|
2259
|
+
|
|
2164
2260
|
//#endregion
|
|
2165
2261
|
//#region src/utils/transform-rendered-module.ts
|
|
2166
2262
|
function transformToRenderedModule(bindingRenderedModule) {
|
|
@@ -2226,6 +2322,96 @@ function transformChunkModules(modules) {
|
|
|
2226
2322
|
return result;
|
|
2227
2323
|
}
|
|
2228
2324
|
|
|
2325
|
+
//#endregion
|
|
2326
|
+
//#region src/types/output-chunk-impl.ts
|
|
2327
|
+
var OutputChunkImpl = class {
|
|
2328
|
+
type = "chunk";
|
|
2329
|
+
constructor(bindingChunk) {
|
|
2330
|
+
this.bindingChunk = bindingChunk;
|
|
2331
|
+
}
|
|
2332
|
+
get fileName() {
|
|
2333
|
+
return this.bindingChunk.getFileName();
|
|
2334
|
+
}
|
|
2335
|
+
get name() {
|
|
2336
|
+
return this.bindingChunk.getName();
|
|
2337
|
+
}
|
|
2338
|
+
get exports() {
|
|
2339
|
+
return this.bindingChunk.getExports();
|
|
2340
|
+
}
|
|
2341
|
+
get isEntry() {
|
|
2342
|
+
return this.bindingChunk.getIsEntry();
|
|
2343
|
+
}
|
|
2344
|
+
get facadeModuleId() {
|
|
2345
|
+
return this.bindingChunk.getFacadeModuleId() || null;
|
|
2346
|
+
}
|
|
2347
|
+
get isDynamicEntry() {
|
|
2348
|
+
return this.bindingChunk.getIsDynamicEntry();
|
|
2349
|
+
}
|
|
2350
|
+
get sourcemapFileName() {
|
|
2351
|
+
return this.bindingChunk.getSourcemapFileName() || null;
|
|
2352
|
+
}
|
|
2353
|
+
get preliminaryFileName() {
|
|
2354
|
+
return this.bindingChunk.getPreliminaryFileName();
|
|
2355
|
+
}
|
|
2356
|
+
get code() {
|
|
2357
|
+
return this.bindingChunk.getCode();
|
|
2358
|
+
}
|
|
2359
|
+
get modules() {
|
|
2360
|
+
return transformChunkModules(this.bindingChunk.getModules());
|
|
2361
|
+
}
|
|
2362
|
+
get imports() {
|
|
2363
|
+
return this.bindingChunk.getImports();
|
|
2364
|
+
}
|
|
2365
|
+
get dynamicImports() {
|
|
2366
|
+
return this.bindingChunk.getDynamicImports();
|
|
2367
|
+
}
|
|
2368
|
+
get moduleIds() {
|
|
2369
|
+
return this.bindingChunk.getModuleIds();
|
|
2370
|
+
}
|
|
2371
|
+
get map() {
|
|
2372
|
+
const mapString = this.bindingChunk.getMap();
|
|
2373
|
+
return mapString ? transformToRollupSourceMap(mapString) : null;
|
|
2374
|
+
}
|
|
2375
|
+
__rolldown_external_memory_handle__(keepDataAlive) {
|
|
2376
|
+
if (keepDataAlive) this.#evaluateAllLazyFields();
|
|
2377
|
+
return this.bindingChunk.dropInner();
|
|
2378
|
+
}
|
|
2379
|
+
#evaluateAllLazyFields() {
|
|
2380
|
+
for (const field of getLazyFields(this)) this[field];
|
|
2381
|
+
}
|
|
2382
|
+
};
|
|
2383
|
+
__decorate([lazy], OutputChunkImpl.prototype, "fileName", null);
|
|
2384
|
+
__decorate([lazy], OutputChunkImpl.prototype, "name", null);
|
|
2385
|
+
__decorate([lazy], OutputChunkImpl.prototype, "exports", null);
|
|
2386
|
+
__decorate([lazy], OutputChunkImpl.prototype, "isEntry", null);
|
|
2387
|
+
__decorate([lazy], OutputChunkImpl.prototype, "facadeModuleId", null);
|
|
2388
|
+
__decorate([lazy], OutputChunkImpl.prototype, "isDynamicEntry", null);
|
|
2389
|
+
__decorate([lazy], OutputChunkImpl.prototype, "sourcemapFileName", null);
|
|
2390
|
+
__decorate([lazy], OutputChunkImpl.prototype, "preliminaryFileName", null);
|
|
2391
|
+
__decorate([lazy], OutputChunkImpl.prototype, "code", null);
|
|
2392
|
+
__decorate([lazy], OutputChunkImpl.prototype, "modules", null);
|
|
2393
|
+
__decorate([lazy], OutputChunkImpl.prototype, "imports", null);
|
|
2394
|
+
__decorate([lazy], OutputChunkImpl.prototype, "dynamicImports", null);
|
|
2395
|
+
__decorate([lazy], OutputChunkImpl.prototype, "moduleIds", null);
|
|
2396
|
+
__decorate([lazy], OutputChunkImpl.prototype, "map", null);
|
|
2397
|
+
__decorate([nonEnumerable], OutputChunkImpl.prototype, "__rolldown_external_memory_handle__", null);
|
|
2398
|
+
|
|
2399
|
+
//#endregion
|
|
2400
|
+
//#region src/types/sourcemap.ts
|
|
2401
|
+
function bindingifySourcemap$1(map) {
|
|
2402
|
+
if (map == null) return;
|
|
2403
|
+
return { inner: typeof map === "string" ? map : {
|
|
2404
|
+
file: map.file ?? void 0,
|
|
2405
|
+
mappings: map.mappings,
|
|
2406
|
+
sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
|
|
2407
|
+
sources: map.sources?.map((s) => s ?? void 0),
|
|
2408
|
+
sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
|
|
2409
|
+
names: map.names,
|
|
2410
|
+
x_google_ignoreList: map.x_google_ignoreList,
|
|
2411
|
+
debugId: "debugId" in map ? map.debugId : void 0
|
|
2412
|
+
} };
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2229
2415
|
//#endregion
|
|
2230
2416
|
//#region src/utils/transform-to-rollup-output.ts
|
|
2231
2417
|
function transformToRollupSourceMap(map) {
|
|
@@ -2241,78 +2427,38 @@ function transformToRollupSourceMap(map) {
|
|
|
2241
2427
|
return obj;
|
|
2242
2428
|
}
|
|
2243
2429
|
function transformToRollupOutputChunk(bindingChunk) {
|
|
2244
|
-
|
|
2245
|
-
type: "chunk",
|
|
2246
|
-
get code() {
|
|
2247
|
-
return bindingChunk.code;
|
|
2248
|
-
},
|
|
2249
|
-
fileName: bindingChunk.fileName,
|
|
2250
|
-
name: bindingChunk.name,
|
|
2251
|
-
get modules() {
|
|
2252
|
-
return transformChunkModules(bindingChunk.modules);
|
|
2253
|
-
},
|
|
2254
|
-
get imports() {
|
|
2255
|
-
return bindingChunk.imports;
|
|
2256
|
-
},
|
|
2257
|
-
get dynamicImports() {
|
|
2258
|
-
return bindingChunk.dynamicImports;
|
|
2259
|
-
},
|
|
2260
|
-
exports: bindingChunk.exports,
|
|
2261
|
-
isEntry: bindingChunk.isEntry,
|
|
2262
|
-
facadeModuleId: bindingChunk.facadeModuleId || null,
|
|
2263
|
-
isDynamicEntry: bindingChunk.isDynamicEntry,
|
|
2264
|
-
get moduleIds() {
|
|
2265
|
-
return bindingChunk.moduleIds;
|
|
2266
|
-
},
|
|
2267
|
-
get map() {
|
|
2268
|
-
return bindingChunk.map ? transformToRollupSourceMap(bindingChunk.map) : null;
|
|
2269
|
-
},
|
|
2270
|
-
sourcemapFileName: bindingChunk.sourcemapFileName || null,
|
|
2271
|
-
preliminaryFileName: bindingChunk.preliminaryFileName
|
|
2272
|
-
};
|
|
2273
|
-
const cache = {};
|
|
2274
|
-
return new Proxy(chunk, {
|
|
2275
|
-
get(target, p) {
|
|
2276
|
-
if (p in cache) return cache[p];
|
|
2277
|
-
const value = target[p];
|
|
2278
|
-
cache[p] = value;
|
|
2279
|
-
return value;
|
|
2280
|
-
},
|
|
2281
|
-
has(target, p) {
|
|
2282
|
-
if (p in cache) return true;
|
|
2283
|
-
return p in target;
|
|
2284
|
-
}
|
|
2285
|
-
});
|
|
2430
|
+
return new OutputChunkImpl(bindingChunk);
|
|
2286
2431
|
}
|
|
2287
2432
|
function transformToMutableRollupOutputChunk(bindingChunk, changed) {
|
|
2288
2433
|
const chunk = {
|
|
2289
2434
|
type: "chunk",
|
|
2290
2435
|
get code() {
|
|
2291
|
-
return bindingChunk.
|
|
2436
|
+
return bindingChunk.getCode();
|
|
2292
2437
|
},
|
|
2293
|
-
fileName: bindingChunk.
|
|
2294
|
-
name: bindingChunk.
|
|
2438
|
+
fileName: bindingChunk.getFileName(),
|
|
2439
|
+
name: bindingChunk.getName(),
|
|
2295
2440
|
get modules() {
|
|
2296
|
-
return transformChunkModules(bindingChunk.
|
|
2441
|
+
return transformChunkModules(bindingChunk.getModules());
|
|
2297
2442
|
},
|
|
2298
2443
|
get imports() {
|
|
2299
|
-
return bindingChunk.
|
|
2444
|
+
return bindingChunk.getImports();
|
|
2300
2445
|
},
|
|
2301
2446
|
get dynamicImports() {
|
|
2302
|
-
return bindingChunk.
|
|
2447
|
+
return bindingChunk.getDynamicImports();
|
|
2303
2448
|
},
|
|
2304
|
-
exports: bindingChunk.
|
|
2305
|
-
isEntry: bindingChunk.
|
|
2306
|
-
facadeModuleId: bindingChunk.
|
|
2307
|
-
isDynamicEntry: bindingChunk.
|
|
2449
|
+
exports: bindingChunk.getExports(),
|
|
2450
|
+
isEntry: bindingChunk.getIsEntry(),
|
|
2451
|
+
facadeModuleId: bindingChunk.getFacadeModuleId() || null,
|
|
2452
|
+
isDynamicEntry: bindingChunk.getIsDynamicEntry(),
|
|
2308
2453
|
get moduleIds() {
|
|
2309
|
-
return bindingChunk.
|
|
2454
|
+
return bindingChunk.getModuleIds();
|
|
2310
2455
|
},
|
|
2311
2456
|
get map() {
|
|
2312
|
-
|
|
2457
|
+
const map = bindingChunk.getMap();
|
|
2458
|
+
return map ? transformToRollupSourceMap(map) : null;
|
|
2313
2459
|
},
|
|
2314
|
-
sourcemapFileName: bindingChunk.
|
|
2315
|
-
preliminaryFileName: bindingChunk.
|
|
2460
|
+
sourcemapFileName: bindingChunk.getSourcemapFileName() || null,
|
|
2461
|
+
preliminaryFileName: bindingChunk.getPreliminaryFileName()
|
|
2316
2462
|
};
|
|
2317
2463
|
const cache = {};
|
|
2318
2464
|
return new Proxy(chunk, {
|
|
@@ -2324,7 +2470,7 @@ function transformToMutableRollupOutputChunk(bindingChunk, changed) {
|
|
|
2324
2470
|
},
|
|
2325
2471
|
set(_target, p, newValue) {
|
|
2326
2472
|
cache[p] = newValue;
|
|
2327
|
-
changed.updated.add(bindingChunk.
|
|
2473
|
+
changed.updated.add(bindingChunk.getFileName());
|
|
2328
2474
|
return true;
|
|
2329
2475
|
},
|
|
2330
2476
|
has(target, p) {
|
|
@@ -2334,36 +2480,19 @@ function transformToMutableRollupOutputChunk(bindingChunk, changed) {
|
|
|
2334
2480
|
});
|
|
2335
2481
|
}
|
|
2336
2482
|
function transformToRollupOutputAsset(bindingAsset) {
|
|
2337
|
-
|
|
2338
|
-
type: "asset",
|
|
2339
|
-
fileName: bindingAsset.fileName,
|
|
2340
|
-
originalFileName: bindingAsset.originalFileName || null,
|
|
2341
|
-
originalFileNames: bindingAsset.originalFileNames,
|
|
2342
|
-
get source() {
|
|
2343
|
-
return transformAssetSource(bindingAsset.source);
|
|
2344
|
-
},
|
|
2345
|
-
name: bindingAsset.name ?? void 0,
|
|
2346
|
-
names: bindingAsset.names
|
|
2347
|
-
};
|
|
2348
|
-
const cache = {};
|
|
2349
|
-
return new Proxy(asset, { get(target, p) {
|
|
2350
|
-
if (p in cache) return cache[p];
|
|
2351
|
-
const value = target[p];
|
|
2352
|
-
cache[p] = value;
|
|
2353
|
-
return value;
|
|
2354
|
-
} });
|
|
2483
|
+
return new OutputAssetImpl(bindingAsset);
|
|
2355
2484
|
}
|
|
2356
2485
|
function transformToMutableRollupOutputAsset(bindingAsset, changed) {
|
|
2357
2486
|
const asset = {
|
|
2358
2487
|
type: "asset",
|
|
2359
|
-
fileName: bindingAsset.
|
|
2360
|
-
originalFileName: bindingAsset.
|
|
2361
|
-
originalFileNames: bindingAsset.
|
|
2488
|
+
fileName: bindingAsset.getFileName(),
|
|
2489
|
+
originalFileName: bindingAsset.getOriginalFileName() || null,
|
|
2490
|
+
originalFileNames: bindingAsset.getOriginalFileNames(),
|
|
2362
2491
|
get source() {
|
|
2363
|
-
return transformAssetSource(bindingAsset.
|
|
2492
|
+
return transformAssetSource(bindingAsset.getSource());
|
|
2364
2493
|
},
|
|
2365
|
-
name: bindingAsset.
|
|
2366
|
-
names: bindingAsset.
|
|
2494
|
+
name: bindingAsset.getName() ?? void 0,
|
|
2495
|
+
names: bindingAsset.getNames()
|
|
2367
2496
|
};
|
|
2368
2497
|
const cache = {};
|
|
2369
2498
|
return new Proxy(asset, {
|
|
@@ -2375,7 +2504,7 @@ function transformToMutableRollupOutputAsset(bindingAsset, changed) {
|
|
|
2375
2504
|
},
|
|
2376
2505
|
set(_target, p, newValue) {
|
|
2377
2506
|
cache[p] = newValue;
|
|
2378
|
-
changed.updated.add(bindingAsset.
|
|
2507
|
+
changed.updated.add(bindingAsset.getFileName());
|
|
2379
2508
|
return true;
|
|
2380
2509
|
}
|
|
2381
2510
|
});
|
|
@@ -2452,7 +2581,20 @@ var RolldownOutputImpl = class {
|
|
|
2452
2581
|
get output() {
|
|
2453
2582
|
return transformToRollupOutput(this.bindingOutputs).output;
|
|
2454
2583
|
}
|
|
2584
|
+
__rolldown_external_memory_handle__(keepDataAlive) {
|
|
2585
|
+
const results = this.output.map((item) => item.__rolldown_external_memory_handle__(keepDataAlive));
|
|
2586
|
+
if (!results.every((r) => r.freed)) {
|
|
2587
|
+
const reasons = results.filter((r) => !r.freed).map((r) => r.reason).filter(Boolean);
|
|
2588
|
+
return {
|
|
2589
|
+
freed: false,
|
|
2590
|
+
reason: `Failed to free ${reasons.length} item(s): ${reasons.join("; ")}`
|
|
2591
|
+
};
|
|
2592
|
+
}
|
|
2593
|
+
return { freed: true };
|
|
2594
|
+
}
|
|
2455
2595
|
};
|
|
2596
|
+
__decorate([lazy], RolldownOutputImpl.prototype, "output", null);
|
|
2597
|
+
__decorate([nonEnumerable], RolldownOutputImpl.prototype, "__rolldown_external_memory_handle__", null);
|
|
2456
2598
|
|
|
2457
2599
|
//#endregion
|
|
2458
2600
|
//#region src/utils/error.ts
|
|
@@ -2721,13 +2863,14 @@ function bindingifyRenderChunkFilter(filterOption) {
|
|
|
2721
2863
|
|
|
2722
2864
|
//#endregion
|
|
2723
2865
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
2866
|
+
var import_binding$6 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
2724
2867
|
function bindingifyPluginHookMeta(options) {
|
|
2725
2868
|
return { order: bindingPluginOrder(options.order) };
|
|
2726
2869
|
}
|
|
2727
2870
|
function bindingPluginOrder(order) {
|
|
2728
2871
|
switch (order) {
|
|
2729
|
-
case "post": return BindingPluginOrder.Post;
|
|
2730
|
-
case "pre": return BindingPluginOrder.Pre;
|
|
2872
|
+
case "post": return import_binding$6.BindingPluginOrder.Post;
|
|
2873
|
+
case "pre": return import_binding$6.BindingPluginOrder.Pre;
|
|
2731
2874
|
case null:
|
|
2732
2875
|
case void 0: return;
|
|
2733
2876
|
default: throw new Error(`Unknown plugin order: ${order}`);
|
|
@@ -2888,6 +3031,7 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
2888
3031
|
|
|
2889
3032
|
//#endregion
|
|
2890
3033
|
//#region src/plugin/bindingify-build-hooks.ts
|
|
3034
|
+
var import_binding$5 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
2891
3035
|
function bindingifyBuildStart(args$1) {
|
|
2892
3036
|
const hook = args$1.plugin.buildStart;
|
|
2893
3037
|
if (!hook) return {};
|
|
@@ -2985,7 +3129,7 @@ function bindingifyTransform(args$1) {
|
|
|
2985
3129
|
plugin: async (ctx, code, id, meta$1) => {
|
|
2986
3130
|
Object.defineProperties(meta$1, {
|
|
2987
3131
|
magicString: { get() {
|
|
2988
|
-
return new BindingMagicString(code);
|
|
3132
|
+
return new import_binding$5.BindingMagicString(code);
|
|
2989
3133
|
} },
|
|
2990
3134
|
ast: { get() {
|
|
2991
3135
|
let lang = "js";
|
|
@@ -3016,7 +3160,7 @@ function bindingifyTransform(args$1) {
|
|
|
3016
3160
|
let normalizedCode = void 0;
|
|
3017
3161
|
let map = ret.map;
|
|
3018
3162
|
if (typeof ret.code === "string") normalizedCode = ret.code;
|
|
3019
|
-
else if (ret.code instanceof BindingMagicString) {
|
|
3163
|
+
else if (ret.code instanceof import_binding$5.BindingMagicString) {
|
|
3020
3164
|
let magicString = ret.code;
|
|
3021
3165
|
normalizedCode = magicString.toString();
|
|
3022
3166
|
let fallbackSourcemap = ctx.sendMagicString(magicString);
|
|
@@ -3745,6 +3889,7 @@ function normalizeTransformOptions(inputOptions, onLog) {
|
|
|
3745
3889
|
|
|
3746
3890
|
//#endregion
|
|
3747
3891
|
//#region src/utils/bindingify-input-options.ts
|
|
3892
|
+
var import_binding$4 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
3748
3893
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
3749
3894
|
const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedOutputPlugins);
|
|
3750
3895
|
const plugins = rawPlugins.map((plugin) => {
|
|
@@ -3814,9 +3959,9 @@ function bindingifyHmr(hmr) {
|
|
|
3814
3959
|
function bindingifyAttachDebugInfo(attachDebugInfo) {
|
|
3815
3960
|
switch (attachDebugInfo) {
|
|
3816
3961
|
case void 0: return;
|
|
3817
|
-
case "full": return BindingAttachDebugInfo.Full;
|
|
3818
|
-
case "simple": return BindingAttachDebugInfo.Simple;
|
|
3819
|
-
case "none": return BindingAttachDebugInfo.None;
|
|
3962
|
+
case "full": return import_binding$4.BindingAttachDebugInfo.Full;
|
|
3963
|
+
case "simple": return import_binding$4.BindingAttachDebugInfo.Simple;
|
|
3964
|
+
case "none": return import_binding$4.BindingAttachDebugInfo.None;
|
|
3820
3965
|
}
|
|
3821
3966
|
}
|
|
3822
3967
|
function bindingifyExternal(external) {
|
|
@@ -3829,13 +3974,13 @@ function bindingifyExternal(external) {
|
|
|
3829
3974
|
}
|
|
3830
3975
|
}
|
|
3831
3976
|
function bindingifyExperimental(experimental) {
|
|
3832
|
-
let chunkModulesOrder = BindingChunkModuleOrderBy.ExecOrder;
|
|
3977
|
+
let chunkModulesOrder = import_binding$4.BindingChunkModuleOrderBy.ExecOrder;
|
|
3833
3978
|
if (experimental?.chunkModulesOrder) switch (experimental.chunkModulesOrder) {
|
|
3834
3979
|
case "exec-order":
|
|
3835
|
-
chunkModulesOrder = BindingChunkModuleOrderBy.ExecOrder;
|
|
3980
|
+
chunkModulesOrder = import_binding$4.BindingChunkModuleOrderBy.ExecOrder;
|
|
3836
3981
|
break;
|
|
3837
3982
|
case "module-id":
|
|
3838
|
-
chunkModulesOrder = BindingChunkModuleOrderBy.ModuleId;
|
|
3983
|
+
chunkModulesOrder = import_binding$4.BindingChunkModuleOrderBy.ModuleId;
|
|
3839
3984
|
break;
|
|
3840
3985
|
default: throw new Error(`Unexpected chunkModulesOrder: ${experimental.chunkModulesOrder}`);
|
|
3841
3986
|
}
|
|
@@ -3895,10 +4040,10 @@ function bindingifyInject(inject) {
|
|
|
3895
4040
|
}
|
|
3896
4041
|
function bindingifyLogLevel(logLevel) {
|
|
3897
4042
|
switch (logLevel) {
|
|
3898
|
-
case "silent": return BindingLogLevel.Silent;
|
|
3899
|
-
case "debug": return BindingLogLevel.Debug;
|
|
3900
|
-
case "warn": return BindingLogLevel.Warn;
|
|
3901
|
-
case "info": return BindingLogLevel.Info;
|
|
4043
|
+
case "silent": return import_binding$4.BindingLogLevel.Silent;
|
|
4044
|
+
case "debug": return import_binding$4.BindingLogLevel.Debug;
|
|
4045
|
+
case "warn": return import_binding$4.BindingLogLevel.Warn;
|
|
4046
|
+
case "info": return import_binding$4.BindingLogLevel.Info;
|
|
3902
4047
|
default: throw new Error(`Unexpected log level: ${logLevel}`);
|
|
3903
4048
|
}
|
|
3904
4049
|
}
|
|
@@ -3934,19 +4079,19 @@ function bindingifyTreeshakeOptions(config) {
|
|
|
3934
4079
|
};
|
|
3935
4080
|
switch (config.propertyReadSideEffects) {
|
|
3936
4081
|
case "always":
|
|
3937
|
-
normalizedConfig.propertyReadSideEffects = BindingPropertyReadSideEffects.Always;
|
|
4082
|
+
normalizedConfig.propertyReadSideEffects = import_binding$4.BindingPropertyReadSideEffects.Always;
|
|
3938
4083
|
break;
|
|
3939
4084
|
case false:
|
|
3940
|
-
normalizedConfig.propertyReadSideEffects = BindingPropertyReadSideEffects.False;
|
|
4085
|
+
normalizedConfig.propertyReadSideEffects = import_binding$4.BindingPropertyReadSideEffects.False;
|
|
3941
4086
|
break;
|
|
3942
4087
|
default:
|
|
3943
4088
|
}
|
|
3944
4089
|
switch (config.propertyWriteSideEffects) {
|
|
3945
4090
|
case "always":
|
|
3946
|
-
normalizedConfig.propertyWriteSideEffects = BindingPropertyWriteSideEffects.Always;
|
|
4091
|
+
normalizedConfig.propertyWriteSideEffects = import_binding$4.BindingPropertyWriteSideEffects.Always;
|
|
3947
4092
|
break;
|
|
3948
4093
|
case false:
|
|
3949
|
-
normalizedConfig.propertyWriteSideEffects = BindingPropertyWriteSideEffects.False;
|
|
4094
|
+
normalizedConfig.propertyWriteSideEffects = import_binding$4.BindingPropertyWriteSideEffects.False;
|
|
3950
4095
|
break;
|
|
3951
4096
|
default:
|
|
3952
4097
|
}
|
|
@@ -4106,6 +4251,7 @@ function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
|
|
|
4106
4251
|
|
|
4107
4252
|
//#endregion
|
|
4108
4253
|
//#region src/utils/initialize-parallel-plugins.ts
|
|
4254
|
+
var import_binding$3 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
4109
4255
|
async function initializeParallelPlugins(plugins) {
|
|
4110
4256
|
const pluginInfos = [];
|
|
4111
4257
|
for (const [index, plugin] of plugins.entries()) if ("_parallel" in plugin) {
|
|
@@ -4118,7 +4264,7 @@ async function initializeParallelPlugins(plugins) {
|
|
|
4118
4264
|
}
|
|
4119
4265
|
if (pluginInfos.length <= 0) return;
|
|
4120
4266
|
const count = availableParallelism();
|
|
4121
|
-
const parallelJsPluginRegistry = new ParallelJsPluginRegistry(count);
|
|
4267
|
+
const parallelJsPluginRegistry = new import_binding$3.ParallelJsPluginRegistry(count);
|
|
4122
4268
|
const registryId = parallelJsPluginRegistry.id;
|
|
4123
4269
|
const workers = await initializeWorkers(registryId, count, pluginInfos);
|
|
4124
4270
|
const stopWorkers = async () => {
|
|
@@ -4196,6 +4342,7 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
|
4196
4342
|
|
|
4197
4343
|
//#endregion
|
|
4198
4344
|
//#region src/api/rolldown/rolldown-build.ts
|
|
4345
|
+
var import_binding$2 = /* @__PURE__ */ __toESM(require_binding());
|
|
4199
4346
|
Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
|
|
4200
4347
|
var RolldownBuild = class RolldownBuild {
|
|
4201
4348
|
#inputOptions;
|
|
@@ -4204,7 +4351,7 @@ var RolldownBuild = class RolldownBuild {
|
|
|
4204
4351
|
static asyncRuntimeShutdown = false;
|
|
4205
4352
|
constructor(inputOptions) {
|
|
4206
4353
|
this.#inputOptions = inputOptions;
|
|
4207
|
-
this.#bundler = new BindingBundler();
|
|
4354
|
+
this.#bundler = new import_binding$2.BindingBundler();
|
|
4208
4355
|
}
|
|
4209
4356
|
get closed() {
|
|
4210
4357
|
return this.#bundlerImpl?.impl.closed ?? true;
|
|
@@ -4212,13 +4359,13 @@ var RolldownBuild = class RolldownBuild {
|
|
|
4212
4359
|
async #getBundlerWithStopWorker(outputOptions) {
|
|
4213
4360
|
if (this.#bundlerImpl) await this.#bundlerImpl.stopWorkers?.();
|
|
4214
4361
|
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
|
|
4215
|
-
if (RolldownBuild.asyncRuntimeShutdown) startAsyncRuntime();
|
|
4362
|
+
if (RolldownBuild.asyncRuntimeShutdown) (0, import_binding$2.startAsyncRuntime)();
|
|
4216
4363
|
try {
|
|
4217
4364
|
return this.#bundlerImpl = {
|
|
4218
4365
|
impl: this.#bundler.createImpl(option.bundlerOptions),
|
|
4219
4366
|
stopWorkers: option.stopWorkers,
|
|
4220
4367
|
shutdown: () => {
|
|
4221
|
-
shutdownAsyncRuntime();
|
|
4368
|
+
(0, import_binding$2.shutdownAsyncRuntime)();
|
|
4222
4369
|
RolldownBuild.asyncRuntimeShutdown = true;
|
|
4223
4370
|
}
|
|
4224
4371
|
};
|
|
@@ -4241,6 +4388,9 @@ var RolldownBuild = class RolldownBuild {
|
|
|
4241
4388
|
const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
|
|
4242
4389
|
return new RolldownOutputImpl(unwrapBindingResult(await impl.write()));
|
|
4243
4390
|
}
|
|
4391
|
+
/**
|
|
4392
|
+
* Close the build and free resources.
|
|
4393
|
+
*/
|
|
4244
4394
|
async close() {
|
|
4245
4395
|
if (this.#bundlerImpl) {
|
|
4246
4396
|
await this.#bundlerImpl.stopWorkers?.();
|
|
@@ -4355,6 +4505,7 @@ var WatcherEmitter = class {
|
|
|
4355
4505
|
|
|
4356
4506
|
//#endregion
|
|
4357
4507
|
//#region src/api/watch/watcher.ts
|
|
4508
|
+
var import_binding$1 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
4358
4509
|
var Watcher = class {
|
|
4359
4510
|
closed;
|
|
4360
4511
|
inner;
|
|
@@ -4376,7 +4527,7 @@ var Watcher = class {
|
|
|
4376
4527
|
this.closed = true;
|
|
4377
4528
|
for (const stop of this.stopWorkers) await stop?.();
|
|
4378
4529
|
await this.inner.close();
|
|
4379
|
-
shutdownAsyncRuntime();
|
|
4530
|
+
(0, import_binding$1.shutdownAsyncRuntime)();
|
|
4380
4531
|
}
|
|
4381
4532
|
start() {
|
|
4382
4533
|
process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
|
|
@@ -4388,7 +4539,7 @@ async function createWatcher(emitter, input) {
|
|
|
4388
4539
|
return createBundlerOptions(await PluginDriver.callOptionsHook(option, true), output, true);
|
|
4389
4540
|
})).flat());
|
|
4390
4541
|
const notifyOptions = getValidNotifyOption(bundlerOptions);
|
|
4391
|
-
new Watcher(emitter, new BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions), bundlerOptions.map((option) => option.stopWorkers)).start();
|
|
4542
|
+
new Watcher(emitter, new import_binding$1.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions), bundlerOptions.map((option) => option.stopWorkers)).start();
|
|
4392
4543
|
}
|
|
4393
4544
|
function getValidNotifyOption(bundlerOptions) {
|
|
4394
4545
|
let result;
|
|
@@ -4417,7 +4568,8 @@ function defineConfig(config) {
|
|
|
4417
4568
|
|
|
4418
4569
|
//#endregion
|
|
4419
4570
|
//#region src/index.ts
|
|
4571
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
4420
4572
|
const VERSION = version;
|
|
4421
4573
|
|
|
4422
4574
|
//#endregion
|
|
4423
|
-
export {
|
|
4575
|
+
export { version as C, description$1 as S, getOutputCliKeys as _, build as a, BuiltinPlugin as b, createBundlerOptions as c, bindingifyPlugin as d, normalizeBindingResult as f, getInputCliKeys as g, getCliSchemaInfo as h, watch as i, normalizedStringOrRegex as l, bindingifySourcemap$1 as m, import_binding as n, rolldown as o, transformToRollupOutput as p, defineConfig as r, RolldownBuild as s, VERSION as t, PluginContextData as u, validateCliOptions as v, onExit as w, makeBuiltinPluginCallable as x, PluginDriver as y };
|