Update app and tooling

This commit is contained in:
Lawrence Chen 2026-01-29 17:36:26 -08:00
parent 3046531bdd
commit e620ec7349
4950 changed files with 2975120 additions and 10 deletions

25
node_modules/rolldown/LICENSE generated vendored Normal file
View file

@ -0,0 +1,25 @@
MIT License
Copyright (c) 2024-present VoidZero Inc. & Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
end of terms and conditions
The licenses of externally maintained libraries from which parts of the Software is derived are listed [here](https://github.com/rolldown/rolldown/blob/main/THIRD-PARTY-LICENSE).

11
node_modules/rolldown/README.md generated vendored Normal file
View file

@ -0,0 +1,11 @@
# Rolldown
> Fast Rust-based bundler for JavaScript with Rollup-compatible API
- ⚡️ Lightning Fast Performance
- 🔌 Rollup-Compatible APIs
- ⏩ esbuild Feature Parity
Rolldown is primarily designed to serve as the underlying bundler in [Vite](https://vite.dev/), with the goal to replace esbuild and Rollup with one unified build tool. Although designed for Vite, Rolldown is also fully capable of being used as a standalone, general-purpose bundler. It can serve as a drop-in replacement for Rollup in most cases, and can also be used as an esbuild alternative when better chunking control is needed.
[Read the Docs to Learn More](https://rolldown.rs).

3
node_modules/rolldown/bin/cli.mjs generated vendored Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env node
import '../dist/cli-setup.mjs';
import '../dist/cli.mjs';

1
node_modules/rolldown/dist/cli-setup.d.mts generated vendored Normal file
View file

@ -0,0 +1 @@
export { };

17
node_modules/rolldown/dist/cli-setup.mjs generated vendored Normal file
View file

@ -0,0 +1,17 @@
import { n as __toESM, t as require_binding } from "./shared/binding-QUhP-0wQ.mjs";
//#region src/cli/setup-index.ts
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
let isWatchMode = false;
for (let i = 0; i < process.argv.length; i++) {
const arg = process.argv[i];
if (arg === "--watch" || arg === "-w") {
isWatchMode = true;
break;
}
}
if (isWatchMode) (0, import_binding.createTokioRuntime)(32);
else (0, import_binding.createTokioRuntime)(4);
//#endregion
export { };

1
node_modules/rolldown/dist/cli.d.mts generated vendored Normal file
View file

@ -0,0 +1 @@
export { };

1581
node_modules/rolldown/dist/cli.mjs generated vendored Normal file

File diff suppressed because one or more lines are too long

10
node_modules/rolldown/dist/config.d.mts generated vendored Normal file
View file

@ -0,0 +1,10 @@
import "./shared/binding-MAEzB4KA.mjs";
import { n as ConfigExport, t as defineConfig } from "./shared/define-config-Cg9apQLa.mjs";
//#region src/utils/load-config.d.ts
declare function loadConfig(configPath: string): Promise<ConfigExport>;
//#endregion
//#region src/config.d.ts
declare const VERSION: string;
//#endregion
export { VERSION, defineConfig, loadConfig };

14
node_modules/rolldown/dist/config.mjs generated vendored Normal file
View file

@ -0,0 +1,14 @@
import "./shared/binding-QUhP-0wQ.mjs";
import { x as version } from "./shared/normalize-string-or-regex-DbyImenn.mjs";
import "./shared/rolldown-build-ciWo5RN-.mjs";
import "./shared/bindingify-input-options-CJ8NjPpl.mjs";
import "./shared/parse-ast-index-Dxd6PXtU.mjs";
import "./shared/rolldown-BR9L9ovo.mjs";
import { t as defineConfig } from "./shared/define-config-BF4P-Pum.mjs";
import { t as loadConfig } from "./shared/load-config-BY_fkh6T.mjs";
//#region src/config.ts
const VERSION = version;
//#endregion
export { VERSION, defineConfig, loadConfig };

239
node_modules/rolldown/dist/experimental-index.d.mts generated vendored Normal file
View file

@ -0,0 +1,239 @@
import { $ as transformSync, B as ParserOptions, C as BindingViteManifestPluginConfig, G as TransformResult, H as ResolveResult, I as MinifyOptions, J as isolatedDeclarationSync, K as createTokioRuntime, L as MinifyResult, N as IsolatedDeclarationsOptions, O as BindingViteTransformPluginConfig, P as IsolatedDeclarationsResult, Q as transform, R as NapiResolveOptions, U as ResolverFactory, W as TransformOptions, X as minifySync, Y as minify, Z as moduleRunnerTransform, _ as BindingViteCssPostPluginConfig, b as BindingViteHtmlPluginConfig, c as BindingRebuildStrategy, f as BindingUrlResolver, g as BindingViteCssPluginConfig, m as BindingViteAssetPluginConfig, n as BindingBundleState, q as isolatedDeclaration, r as BindingClientHmrUpdate, z as ParseResult } from "./shared/binding-MAEzB4KA.mjs";
import { A as BuiltinPlugin, F as OutputBundle, G as MinimalPluginContext, N as SourceMapInput, Nt as freeExternalMemory, Ot as OutputChunk, St as OutputOptions, W as defineParallelPlugin, jt as RolldownOutput, o as InputOptions, tt as NormalizedOutputOptions } from "./shared/define-config-Cg9apQLa.mjs";
import { a as viteDynamicImportVarsPlugin, c as viteJsonPlugin, d as viteReactRefreshWrapperPlugin, f as viteReporterPlugin, g as viteWebWorkerPostPlugin, h as viteWasmHelperPlugin, i as viteBuildImportAnalysisPlugin, l as viteLoadFallbackPlugin, m as viteWasmFallbackPlugin, n as isolatedDeclarationPlugin, o as viteHtmlInlineProxyPlugin, p as viteResolvePlugin, r as viteAssetImportMetaUrlPlugin, s as viteImportGlobPlugin, u as viteModulePreloadPolyfillPlugin } from "./shared/constructors-DcGyaGNV.mjs";
//#region src/api/dev/dev-options.d.ts
type DevOnHmrUpdates = (result: Error | {
updates: BindingClientHmrUpdate[];
changedFiles: string[];
}) => void | Promise<void>;
type DevOnOutput = (result: Error | RolldownOutput) => void | Promise<void>;
interface DevWatchOptions {
/**
* If `true`, files are not written to disk.
* @default false
*/
skipWrite?: boolean;
/**
* If `true`, use polling instead of native file system events for watching.
* @default false
*/
usePolling?: boolean;
/**
* Poll interval in milliseconds (only used when usePolling is true).
* @default 100
*/
pollInterval?: number;
/**
* If `true`, use debounced watcher. If `false`, use non-debounced watcher for immediate responses.
* @default true
*/
useDebounce?: boolean;
/**
* Debounce duration in milliseconds (only used when useDebounce is true).
* @default 10
*/
debounceDuration?: number;
/**
* Whether to compare file contents for poll-based watchers (only used when usePolling is true).
* When enabled, poll watchers will check file contents to determine if they actually changed.
* @default false
*/
compareContentsForPolling?: boolean;
/**
* Tick rate in milliseconds for debounced watchers (only used when useDebounce is true).
* Controls how frequently the debouncer checks for events to process.
* When not specified, the debouncer will auto-select an appropriate tick rate (1/4 of the debounce duration).
* @default undefined (auto-select)
*/
debounceTickRate?: number;
}
interface DevOptions {
onHmrUpdates?: DevOnHmrUpdates;
onOutput?: DevOnOutput;
/**
* Strategy for triggering rebuilds after HMR updates.
* - `'always'`: Always trigger a rebuild after HMR updates
* - `'auto'`: Trigger rebuild only if HMR updates contain full reload updates
* - `'never'`: Never trigger rebuild after HMR updates (default)
* @default 'auto'
*/
rebuildStrategy?: "always" | "auto" | "never";
watch?: DevWatchOptions;
}
//#endregion
//#region src/api/dev/dev-engine.d.ts
declare class DevEngine {
#private;
static create(inputOptions: InputOptions, outputOptions?: OutputOptions, devOptions?: DevOptions): Promise<DevEngine>;
private constructor();
run(): Promise<void>;
ensureCurrentBuildFinish(): Promise<void>;
getBundleState(): Promise<BindingBundleState>;
ensureLatestBuildOutput(): Promise<void>;
invalidate(file: string, firstInvalidatedBy?: string): Promise<BindingClientHmrUpdate[]>;
registerModules(clientId: string, modules: string[]): Promise<void>;
removeClient(clientId: string): Promise<void>;
close(): Promise<void>;
/**
* Compile a lazy entry module and return HMR-style patch code.
*
* This is called when a dynamically imported module is first requested at runtime.
* The module was previously stubbed with a proxy, and now we need to compile the
* actual module and its dependencies.
*
* @param moduleId - The absolute file path of the module to compile
* @param clientId - The client ID requesting this compilation
* @returns The compiled JavaScript code as a string (HMR patch format)
*/
compileEntry(moduleId: string, clientId: string): Promise<string>;
}
//#endregion
//#region src/api/dev/index.d.ts
declare const dev: typeof DevEngine.create;
//#endregion
//#region src/api/experimental.d.ts
/**
* This is an experimental API. Its behavior may change in the future.
*
* - Calling this API will only execute the `scan/build` stage of rolldown.
* - `scan` will clean up all resources automatically, but if you want to ensure timely cleanup, you need to wait for the returned promise to resolve.
*
* @example To ensure cleanup of resources, use the returned promise to wait for the scan to complete.
* ```ts
* import { scan } from 'rolldown/api/experimental';
*
* const cleanupPromise = await scan(...);
* await cleanupPromise;
* // Now all resources have been cleaned up.
* ```
*/
declare const scan: (rawInputOptions: InputOptions, rawOutputOptions?: {}) => Promise<Promise<void>>;
//#endregion
//#region src/utils/parse.d.ts
/**
* Parse asynchronously.
*
* Note: This function can be slower than `parseSync` due to the overhead of spawning a thread.
*/
declare function parse(filename: string, sourceText: string, options?: ParserOptions | null): Promise<ParseResult>;
/** Parse synchronously. */
declare function parseSync(filename: string, sourceText: string, options?: ParserOptions | null): ParseResult;
//#endregion
//#region src/builtin-plugin/alias-plugin.d.ts
type ViteAliasPluginConfig = {
entries: {
find: string | RegExp;
replacement: string;
}[];
};
declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
//#endregion
//#region src/builtin-plugin/asset-plugin.d.ts
declare function viteAssetPlugin(config: BindingViteAssetPluginConfig): BuiltinPlugin;
//#endregion
//#region src/builtin-plugin/transform-plugin.d.ts
type TransformPattern = string | RegExp | readonly (RegExp | string)[];
type TransformPluginConfig = Omit<BindingViteTransformPluginConfig, "include" | "exclude" | "jsxRefreshInclude" | "jsxRefreshExclude" | "yarnPnp"> & {
include?: TransformPattern;
exclude?: TransformPattern;
jsxRefreshInclude?: TransformPattern;
jsxRefreshExclude?: TransformPattern;
};
declare function viteTransformPlugin(config: TransformPluginConfig): BuiltinPlugin;
//#endregion
//#region src/builtin-plugin/vite-css-plugin.d.ts
type ViteCssPluginConfig = Omit<BindingViteCssPluginConfig, "compileCSS"> & {
compileCSS: (url: string, importer: string, resolver: BindingUrlResolver) => Promise<{
code: string;
map?: SourceMapInput;
modules?: Record<string, string>;
deps?: Set<string>;
}>;
};
declare function viteCSSPlugin(config: ViteCssPluginConfig): BuiltinPlugin;
//#endregion
//#region src/builtin-plugin/vite-css-post-plugin.d.ts
type ViteCssPostPluginConfig = Omit<BindingViteCssPostPluginConfig, "cssScopeTo" | "isLegacy"> & {
isOutputOptionsForLegacyChunks?: (outputOptions: NormalizedOutputOptions) => boolean;
};
declare function viteCSSPostPlugin(config: ViteCssPostPluginConfig): BuiltinPlugin;
//#endregion
//#region src/builtin-plugin/vite-html-plugin.d.ts
interface HtmlTagDescriptor {
tag: string;
/**
* attribute values will be escaped automatically if needed
*/
attrs?: Record<string, string | boolean | undefined>;
children?: string | HtmlTagDescriptor[];
/**
* default: 'head-prepend'
*/
injectTo?: "head" | "body" | "head-prepend" | "body-prepend";
}
type IndexHtmlTransformResult = string | HtmlTagDescriptor[] | {
html: string;
tags: HtmlTagDescriptor[];
};
type IndexHtmlTransformHook = (this: MinimalPluginContext, html: string, ctx: IndexHtmlTransformContext) => IndexHtmlTransformResult | void | Promise<IndexHtmlTransformResult | void>;
interface IndexHtmlTransformContext {
/**
* public path when served
*/
path: string;
/**
* filename on disk
*/
filename: string;
bundle?: OutputBundle;
chunk?: OutputChunk;
}
interface ViteHtmlPluginOptions extends Omit<BindingViteHtmlPluginConfig, "transformIndexHtml" | "setModuleSideEffects"> {
preHooks: IndexHtmlTransformHook[];
normalHooks: IndexHtmlTransformHook[];
postHooks: IndexHtmlTransformHook[];
applyHtmlTransforms: (html: string, hooks: IndexHtmlTransformHook[], pluginContext: MinimalPluginContext, ctx: IndexHtmlTransformContext) => Promise<string>;
}
declare function viteHtmlPlugin(config: ViteHtmlPluginOptions): BuiltinPlugin;
//#endregion
//#region src/builtin-plugin/vite-manifest-plugin.d.ts
type ViteManifestPluginConfig = Omit<BindingViteManifestPluginConfig, "isLegacy"> & {
isOutputOptionsForLegacyChunks?: (outputOptions: NormalizedOutputOptions) => boolean;
};
declare function viteManifestPlugin(config: ViteManifestPluginConfig): BuiltinPlugin;
//#endregion
//#region src/experimental-index.d.ts
/**
* In-memory file system for browser builds.
*
* This is a re-export of the {@link https://github.com/streamich/memfs | memfs} package used by the WASI runtime.
* It allows you to read and write files to a virtual filesystem when using rolldown in browser environments.
*
* - `fs`: A Node.js-compatible filesystem API (`IFs` from memfs)
* - `volume`: The underlying `Volume` instance that stores the filesystem state
*
* Returns `undefined` in Node.js builds (only available in browser builds via `@rolldown/browser`).
*
* @example
* ```typescript
* import { memfs } from 'rolldown/experimental';
*
* // Write files to virtual filesystem before bundling
* memfs?.volume.fromJSON({
* '/src/index.js': 'export const foo = 42;',
* '/package.json': '{"name": "my-app"}'
* });
*
* // Read files from the virtual filesystem
* const content = memfs?.fs.readFileSync('/src/index.js', 'utf8');
* ```
*
* @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
*/
declare const memfs: {
fs: any;
volume: any;
} | undefined;
//#endregion
export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type MinifyOptions, type MinifyResult, type ParseResult, type ParserOptions, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, type ViteHtmlPluginOptions, createTokioRuntime, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin, viteAssetImportMetaUrlPlugin, viteAssetPlugin, viteBuildImportAnalysisPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlInlineProxyPlugin, viteHtmlPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWasmHelperPlugin, viteWebWorkerPostPlugin };

299
node_modules/rolldown/dist/experimental-index.mjs generated vendored Normal file
View file

@ -0,0 +1,299 @@
import { n as __toESM, t as require_binding } from "./shared/binding-QUhP-0wQ.mjs";
import { d as bindingifySourcemap, n as BuiltinPlugin, t as normalizedStringOrRegex, u as transformToRollupOutput } from "./shared/normalize-string-or-regex-DbyImenn.mjs";
import { l as PluginDriver, n as createBundlerOptions, s as validateOption, t as RolldownBuild } from "./shared/rolldown-build-ciWo5RN-.mjs";
import { o as normalizeBindingResult, s as unwrapBindingResult } from "./shared/bindingify-input-options-CJ8NjPpl.mjs";
import { i as parseSync, r as parse } from "./shared/parse-ast-index-Dxd6PXtU.mjs";
import { a as viteDynamicImportVarsPlugin, c as viteJsonPlugin, d as viteReactRefreshWrapperPlugin, f as viteReporterPlugin, g as viteWebWorkerPostPlugin, h as viteWasmHelperPlugin, i as viteBuildImportAnalysisPlugin, l as viteLoadFallbackPlugin, m as viteWasmFallbackPlugin, n as isolatedDeclarationPlugin, o as viteHtmlInlineProxyPlugin, p as viteResolvePlugin, r as viteAssetImportMetaUrlPlugin, s as viteImportGlobPlugin, u as viteModulePreloadPolyfillPlugin } from "./shared/constructors-Ckn63GYh.mjs";
import { pathToFileURL } from "node:url";
//#region src/api/dev/dev-engine.ts
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
var DevEngine = class DevEngine {
#inner;
#cachedBuildFinishPromise = null;
static async create(inputOptions, outputOptions = {}, devOptions = {}) {
inputOptions = await PluginDriver.callOptionsHook(inputOptions);
const options = await createBundlerOptions(inputOptions, outputOptions, false);
const userOnHmrUpdates = devOptions.onHmrUpdates;
const bindingOnHmrUpdates = userOnHmrUpdates ? function(rawResult) {
const result = normalizeBindingResult(rawResult);
if (result instanceof Error) {
userOnHmrUpdates(result);
return;
}
const [updates, changedFiles] = result;
userOnHmrUpdates({
updates,
changedFiles
});
} : void 0;
const userOnOutput = devOptions.onOutput;
const bindingDevOptions = {
onHmrUpdates: bindingOnHmrUpdates,
onOutput: userOnOutput ? function(rawResult) {
const result = normalizeBindingResult(rawResult);
if (result instanceof Error) {
userOnOutput(result);
return;
}
userOnOutput(transformToRollupOutput(result));
} : void 0,
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? import_binding.BindingRebuildStrategy.Always : devOptions.rebuildStrategy === "auto" ? import_binding.BindingRebuildStrategy.Auto : import_binding.BindingRebuildStrategy.Never : void 0,
watch: devOptions.watch && {
skipWrite: devOptions.watch.skipWrite,
usePolling: devOptions.watch.usePolling,
pollInterval: devOptions.watch.pollInterval,
useDebounce: devOptions.watch.useDebounce,
debounceDuration: devOptions.watch.debounceDuration,
compareContentsForPolling: devOptions.watch.compareContentsForPolling,
debounceTickRate: devOptions.watch.debounceTickRate
}
};
return new DevEngine(new import_binding.BindingDevEngine(options.bundlerOptions, bindingDevOptions));
}
constructor(inner) {
this.#inner = inner;
}
async run() {
await this.#inner.run();
}
async ensureCurrentBuildFinish() {
if (this.#cachedBuildFinishPromise) return this.#cachedBuildFinishPromise;
const promise = this.#inner.ensureCurrentBuildFinish().then(() => {
this.#cachedBuildFinishPromise = null;
});
this.#cachedBuildFinishPromise = promise;
return promise;
}
async getBundleState() {
return this.#inner.getBundleState();
}
async ensureLatestBuildOutput() {
await this.#inner.ensureLatestBuildOutput();
}
async invalidate(file, firstInvalidatedBy) {
return this.#inner.invalidate(file, firstInvalidatedBy);
}
async registerModules(clientId, modules) {
await this.#inner.registerModules(clientId, modules);
}
async removeClient(clientId) {
await this.#inner.removeClient(clientId);
}
async close() {
await this.#inner.close();
}
/**
* Compile a lazy entry module and return HMR-style patch code.
*
* This is called when a dynamically imported module is first requested at runtime.
* The module was previously stubbed with a proxy, and now we need to compile the
* actual module and its dependencies.
*
* @param moduleId - The absolute file path of the module to compile
* @param clientId - The client ID requesting this compilation
* @returns The compiled JavaScript code as a string (HMR patch format)
*/
async compileEntry(moduleId, clientId) {
return this.#inner.compileEntry(moduleId, clientId);
}
};
//#endregion
//#region src/api/dev/index.ts
const dev = (...args) => DevEngine.create(...args);
//#endregion
//#region src/types/external-memory-handle.ts
const symbolForExternalMemoryHandle = "__rolldown_external_memory_handle__";
/**
* Frees the external memory held by the given handle.
*
* This is useful when you want to manually release memory held by Rust objects
* (like `OutputChunk` or `OutputAsset`) before they are garbage collected.
*
* @param handle - The object with external memory to free
* @param keepDataAlive - If true, evaluates all lazy fields before freeing memory (default: false).
* This will take time to copy data from Rust to JavaScript, but prevents errors
* when accessing properties after the memory is freed.
* @returns Status object with `freed` boolean and optional `reason` string.
* - `{ freed: true }` if memory was successfully freed
* - `{ freed: false, reason: "..." }` if memory couldn't be freed (e.g., already freed or other references exist)
*
* @example
* ```typescript
* import { freeExternalMemory } from 'rolldown/experimental';
*
* const output = await bundle.generate();
* const chunk = output.output[0];
*
* // Use the chunk...
*
* // Manually free the memory (fast, but accessing properties after will throw)
* const status = freeExternalMemory(chunk); // { freed: true }
* const statusAgain = freeExternalMemory(chunk); // { freed: false, reason: "Memory has already been freed" }
*
* // Keep data alive before freeing (slower, but data remains accessible)
* freeExternalMemory(chunk, true); // Evaluates all lazy fields first
* console.log(chunk.code); // OK - data was copied to JavaScript before freeing
*
* // Without keepDataAlive, accessing chunk properties after freeing will throw an error
* ```
*/
function freeExternalMemory(handle, keepDataAlive = false) {
return handle[symbolForExternalMemoryHandle](keepDataAlive);
}
//#endregion
//#region src/api/experimental.ts
/**
* This is an experimental API. Its behavior may change in the future.
*
* - Calling this API will only execute the `scan/build` stage of rolldown.
* - `scan` will clean up all resources automatically, but if you want to ensure timely cleanup, you need to wait for the returned promise to resolve.
*
* @example To ensure cleanup of resources, use the returned promise to wait for the scan to complete.
* ```ts
* import { scan } from 'rolldown/api/experimental';
*
* const cleanupPromise = await scan(...);
* await cleanupPromise;
* // Now all resources have been cleaned up.
* ```
*/
const scan = async (rawInputOptions, rawOutputOptions = {}) => {
validateOption("input", rawInputOptions);
validateOption("output", rawOutputOptions);
const ret = await createBundlerOptions(await PluginDriver.callOptionsHook(rawInputOptions), rawOutputOptions, false);
const bundler = new import_binding.BindingBundler();
if (RolldownBuild.asyncRuntimeShutdown) (0, import_binding.startAsyncRuntime)();
async function cleanup() {
await bundler.close();
await ret.stopWorkers?.();
(0, import_binding.shutdownAsyncRuntime)();
RolldownBuild.asyncRuntimeShutdown = true;
}
let cleanupPromise = Promise.resolve();
try {
unwrapBindingResult(await bundler.scan(ret.bundlerOptions));
} catch (err) {
await cleanup();
throw err;
} finally {
cleanupPromise = cleanup();
}
return cleanupPromise;
};
//#endregion
//#region src/plugin/parallel-plugin.ts
function defineParallelPlugin(pluginPath) {
return (options) => {
return { _parallel: {
fileUrl: pathToFileURL(pluginPath).href,
options
} };
};
}
//#endregion
//#region src/builtin-plugin/alias-plugin.ts
function viteAliasPlugin(config) {
return new BuiltinPlugin("builtin:vite-alias", config);
}
//#endregion
//#region src/builtin-plugin/asset-plugin.ts
function viteAssetPlugin(config) {
return new BuiltinPlugin("builtin:vite-asset", config);
}
//#endregion
//#region src/builtin-plugin/transform-plugin.ts
function viteTransformPlugin(config) {
return new BuiltinPlugin("builtin:vite-transform", {
...config,
include: normalizedStringOrRegex(config.include),
exclude: normalizedStringOrRegex(config.exclude),
jsxRefreshInclude: normalizedStringOrRegex(config.jsxRefreshInclude),
jsxRefreshExclude: normalizedStringOrRegex(config.jsxRefreshExclude),
yarnPnp: typeof process === "object" && !!process.versions?.pnp
});
}
//#endregion
//#region src/builtin-plugin/vite-css-plugin.ts
function viteCSSPlugin(config) {
return new BuiltinPlugin("builtin:vite-css", config ? {
...config,
async compileCSS(url, importer, resolver) {
let result = await config.compileCSS(url, importer, resolver);
return {
...result,
map: bindingifySourcemap(result.map)
};
}
} : void 0);
}
//#endregion
//#region src/builtin-plugin/vite-css-post-plugin.ts
function viteCSSPostPlugin(config) {
return new BuiltinPlugin("builtin:vite-css-post", config);
}
//#endregion
//#region src/builtin-plugin/vite-html-plugin.ts
function viteHtmlPlugin(config) {
return new BuiltinPlugin("builtin:vite-html", config);
}
//#endregion
//#region src/builtin-plugin/vite-manifest-plugin.ts
function viteManifestPlugin(config) {
return new BuiltinPlugin("builtin:vite-manifest", config);
}
//#endregion
//#region src/experimental-index.ts
/**
* In-memory file system for browser builds.
*
* This is a re-export of the {@link https://github.com/streamich/memfs | memfs} package used by the WASI runtime.
* It allows you to read and write files to a virtual filesystem when using rolldown in browser environments.
*
* - `fs`: A Node.js-compatible filesystem API (`IFs` from memfs)
* - `volume`: The underlying `Volume` instance that stores the filesystem state
*
* Returns `undefined` in Node.js builds (only available in browser builds via `@rolldown/browser`).
*
* @example
* ```typescript
* import { memfs } from 'rolldown/experimental';
*
* // Write files to virtual filesystem before bundling
* memfs?.volume.fromJSON({
* '/src/index.js': 'export const foo = 42;',
* '/package.json': '{"name": "my-app"}'
* });
*
* // Read files from the virtual filesystem
* const content = memfs?.fs.readFileSync('/src/index.js', 'utf8');
* ```
*
* @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
*/
const memfs = void 0;
//#endregion
var BindingRebuildStrategy = import_binding.BindingRebuildStrategy;
var ResolverFactory = import_binding.ResolverFactory;
var createTokioRuntime = import_binding.createTokioRuntime;
var isolatedDeclaration = import_binding.isolatedDeclaration;
var isolatedDeclarationSync = import_binding.isolatedDeclarationSync;
var minify = import_binding.minify;
var minifySync = import_binding.minifySync;
var moduleRunnerTransform = import_binding.moduleRunnerTransform;
var transform = import_binding.transform;
var transformSync = import_binding.transformSync;
export { BindingRebuildStrategy, DevEngine, ResolverFactory, createTokioRuntime, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin, viteAssetImportMetaUrlPlugin, viteAssetPlugin, viteBuildImportAnalysisPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlInlineProxyPlugin, viteHtmlPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWasmHelperPlugin, viteWebWorkerPostPlugin };

View file

@ -0,0 +1,92 @@
/**
* @typedef {{ type: 'hmr:module-registered', modules: string[] }} DevRuntimeMessage
* @typedef {{ send(message: DevRuntimeMessage): void }} Messenger
*/
export class DevRuntime {
/**
* @param {Messenger} messenger
*/
constructor(messenger: Messenger);
messenger: Messenger;
/**
* @type {Record<string, Module>}
*/
modules: Record<string, Module>;
/**
* @param {string} _moduleId
*/
createModuleHotContext(_moduleId: string): void;
/**
* @param {[string, string][]} _boundaries
*/
applyUpdates(_boundaries: [string, string][]): void;
/**
* @param {string} id
* @param {{ exports: any }} exportsHolder
*/
registerModule(id: string, exportsHolder: {
exports: any;
}): void;
/**
* @param {string} id
*/
loadExports(id: string): any;
/**
* __esmMin
*
* @type {<T>(fn: any, res: T) => () => T}
* @internal
*/
createEsmInitializer: <T>(fn: any, res: T) => () => T;
/**
* __commonJSMin
*
* @type {<T extends { exports: any }>(cb: any, mod: { exports: any }) => () => T}
* @internal
*/
createCjsInitializer: <T extends {
exports: any;
}>(cb: any, mod: {
exports: any;
}) => () => T;
/** @internal */
__toESM: any;
/** @internal */
__toCommonJS: any;
/** @internal */
__exportAll: any;
/**
* @param {boolean} [isNodeMode]
* @returns {(mod: any) => any}
* @internal
*/
__toDynamicImportESM: (isNodeMode?: boolean) => (mod: any) => any;
/** @internal */
__reExport: any;
sendModuleRegisteredMessage: (module: string) => void;
}
export type DevRuntimeMessage = {
type: "hmr:module-registered";
modules: string[];
};
export type Messenger = {
send(message: DevRuntimeMessage): void;
};
declare class Module {
/**
* @param {string} id
*/
constructor(id: string);
/**
* @type {{ exports: any }}
*/
exportsHolder: {
exports: any;
};
/**
* @type {string}
*/
id: string;
get exports(): any;
}
export {};

4
node_modules/rolldown/dist/filter-index.d.mts generated vendored Normal file
View file

@ -0,0 +1,4 @@
import "./shared/binding-MAEzB4KA.mjs";
import { k as withFilter } from "./shared/define-config-Cg9apQLa.mjs";
export * from "@rolldown/pluginutils/filter";
export { withFilter };

369
node_modules/rolldown/dist/filter-index.mjs generated vendored Normal file
View file

@ -0,0 +1,369 @@
import { n as isPromiseLike, t as arraify } from "./shared/misc-DpjTMcQQ.mjs";
//#region ../pluginutils/dist/utils.js
const postfixRE = /[?#].*$/;
function cleanUrl(url) {
return url.replace(postfixRE, "");
}
function extractQueryWithoutFragment(url) {
const questionMarkIndex = url.indexOf("?");
if (questionMarkIndex === -1) return "";
const fragmentIndex = url.indexOf("#", questionMarkIndex);
if (fragmentIndex === -1) return url.substring(questionMarkIndex);
else return url.substring(questionMarkIndex, fragmentIndex);
}
//#endregion
//#region ../pluginutils/dist/filter/composable-filters.js
var And = class {
kind;
args;
constructor(...args) {
if (args.length === 0) throw new Error("`And` expects at least one operand");
this.args = args;
this.kind = "and";
}
};
var Or = class {
kind;
args;
constructor(...args) {
if (args.length === 0) throw new Error("`Or` expects at least one operand");
this.args = args;
this.kind = "or";
}
};
var Not = class {
kind;
expr;
constructor(expr) {
this.expr = expr;
this.kind = "not";
}
};
var Id = class {
kind;
pattern;
params;
constructor(pattern, params) {
this.pattern = pattern;
this.kind = "id";
this.params = params ?? { cleanUrl: false };
}
};
var ImporterId = class {
kind;
pattern;
params;
constructor(pattern, params) {
this.pattern = pattern;
this.kind = "importerId";
this.params = params ?? { cleanUrl: false };
}
};
var ModuleType = class {
kind;
pattern;
constructor(pattern) {
this.pattern = pattern;
this.kind = "moduleType";
}
};
var Code = class {
kind;
pattern;
constructor(expr) {
this.pattern = expr;
this.kind = "code";
}
};
var Query = class {
kind;
key;
pattern;
constructor(key, pattern) {
this.pattern = pattern;
this.key = key;
this.kind = "query";
}
};
var Include = class {
kind;
expr;
constructor(expr) {
this.expr = expr;
this.kind = "include";
}
};
var Exclude = class {
kind;
expr;
constructor(expr) {
this.expr = expr;
this.kind = "exclude";
}
};
function and(...args) {
return new And(...args);
}
function or(...args) {
return new Or(...args);
}
function not(expr) {
return new Not(expr);
}
function id(pattern, params) {
return new Id(pattern, params);
}
function importerId(pattern, params) {
return new ImporterId(pattern, params);
}
function moduleType(pattern) {
return new ModuleType(pattern);
}
function code(pattern) {
return new Code(pattern);
}
function query(key, pattern) {
return new Query(key, pattern);
}
function include(expr) {
return new Include(expr);
}
function exclude(expr) {
return new Exclude(expr);
}
/**
* convert a queryObject to FilterExpression like
* ```js
* and(query(k1, v1), query(k2, v2))
* ```
* @param queryFilterObject The query filter object needs to be matched.
* @returns a `And` FilterExpression
*/
function queries(queryFilter) {
return and(...Object.entries(queryFilter).map(([key, value]) => {
return new Query(key, value);
}));
}
function interpreter(exprs, code$1, id$1, moduleType$1, importerId$1) {
let arr = [];
if (Array.isArray(exprs)) arr = exprs;
else arr = [exprs];
return interpreterImpl(arr, code$1, id$1, moduleType$1, importerId$1);
}
function interpreterImpl(expr, code$1, id$1, moduleType$1, importerId$1, ctx = {}) {
let hasInclude = false;
for (const e of expr) switch (e.kind) {
case "include":
hasInclude = true;
if (exprInterpreter(e.expr, code$1, id$1, moduleType$1, importerId$1, ctx)) return true;
break;
case "exclude":
if (exprInterpreter(e.expr, code$1, id$1, moduleType$1, importerId$1, ctx)) return false;
break;
}
return !hasInclude;
}
function exprInterpreter(expr, code$1, id$1, moduleType$1, importerId$1, ctx = {}) {
switch (expr.kind) {
case "and": return expr.args.every((e) => exprInterpreter(e, code$1, id$1, moduleType$1, importerId$1, ctx));
case "or": return expr.args.some((e) => exprInterpreter(e, code$1, id$1, moduleType$1, importerId$1, ctx));
case "not": return !exprInterpreter(expr.expr, code$1, id$1, moduleType$1, importerId$1, ctx);
case "id": {
if (id$1 === void 0) throw new Error("`id` is required for `id` expression");
let idToMatch = id$1;
if (expr.params.cleanUrl) idToMatch = cleanUrl(idToMatch);
return typeof expr.pattern === "string" ? idToMatch === expr.pattern : expr.pattern.test(idToMatch);
}
case "importerId": {
if (importerId$1 === void 0) return false;
let importerIdToMatch = importerId$1;
if (expr.params.cleanUrl) importerIdToMatch = cleanUrl(importerIdToMatch);
return typeof expr.pattern === "string" ? importerIdToMatch === expr.pattern : expr.pattern.test(importerIdToMatch);
}
case "moduleType":
if (moduleType$1 === void 0) throw new Error("`moduleType` is required for `moduleType` expression");
return moduleType$1 === expr.pattern;
case "code":
if (code$1 === void 0) throw new Error("`code` is required for `code` expression");
return typeof expr.pattern === "string" ? code$1.includes(expr.pattern) : expr.pattern.test(code$1);
case "query": {
if (id$1 === void 0) throw new Error("`id` is required for `Query` expression");
if (!ctx.urlSearchParamsCache) {
let queryString = extractQueryWithoutFragment(id$1);
ctx.urlSearchParamsCache = new URLSearchParams(queryString);
}
let urlParams = ctx.urlSearchParamsCache;
if (typeof expr.pattern === "boolean") if (expr.pattern) return urlParams.has(expr.key);
else return !urlParams.has(expr.key);
else if (typeof expr.pattern === "string") return urlParams.get(expr.key) === expr.pattern;
else return expr.pattern.test(urlParams.get(expr.key) ?? "");
}
default: throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`);
}
}
//#endregion
//#region ../pluginutils/dist/filter/filter-vite-plugins.js
/**
* Filters out Vite plugins that have `apply: 'serve'` set.
*
* Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
* are intended only for Vite's dev server and should be excluded from the build process.
*
* @param plugins - Array of plugins (can include nested arrays)
* @returns Filtered array with serve-only plugins removed
*
* @example
* ```ts
* import { defineConfig } from 'rolldown';
* import { filterVitePlugins } from '@rolldown/pluginutils';
* import viteReact from '@vitejs/plugin-react';
*
* export default defineConfig({
* plugins: filterVitePlugins([
* viteReact(),
* {
* name: 'dev-only',
* apply: 'serve', // This will be filtered out
* // ...
* }
* ])
* });
* ```
*/
function filterVitePlugins(plugins) {
if (!plugins) return [];
const pluginArray = Array.isArray(plugins) ? plugins : [plugins];
const result = [];
for (const plugin of pluginArray) {
if (!plugin) continue;
if (Array.isArray(plugin)) {
result.push(...filterVitePlugins(plugin));
continue;
}
const pluginWithApply = plugin;
if ("apply" in pluginWithApply) {
const applyValue = pluginWithApply.apply;
if (typeof applyValue === "function") try {
if (applyValue({}, {
command: "build",
mode: "production"
})) result.push(plugin);
} catch {
result.push(plugin);
}
else if (applyValue === "serve") continue;
else result.push(plugin);
} else result.push(plugin);
}
return result;
}
//#endregion
//#region ../pluginutils/dist/filter/simple-filters.js
/**
* Constructs a RegExp that matches the exact string specified.
*
* This is useful for plugin hook filters.
*
* @param str the string to match.
* @param flags flags for the RegExp.
*
* @example
* ```ts
* import { exactRegex } from '@rolldown/pluginutils';
* const plugin = {
* name: 'plugin',
* resolveId: {
* filter: { id: exactRegex('foo') },
* handler(id) {} // will only be called for `foo`
* }
* }
* ```
*/
function exactRegex(str, flags) {
return new RegExp(`^${escapeRegex(str)}$`, flags);
}
/**
* Constructs a RegExp that matches a value that has the specified prefix.
*
* This is useful for plugin hook filters.
*
* @param str the string to match.
* @param flags flags for the RegExp.
*
* @example
* ```ts
* import { prefixRegex } from '@rolldown/pluginutils';
* const plugin = {
* name: 'plugin',
* resolveId: {
* filter: { id: prefixRegex('foo') },
* handler(id) {} // will only be called for IDs starting with `foo`
* }
* }
* ```
*/
function prefixRegex(str, flags) {
return new RegExp(`^${escapeRegex(str)}`, flags);
}
const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
function escapeRegex(str) {
return str.replace(escapeRegexRE, "\\$&");
}
function makeIdFiltersToMatchWithQuery(input) {
if (!Array.isArray(input)) return makeIdFilterToMatchWithQuery(input);
return input.map((i) => makeIdFilterToMatchWithQuery(i));
}
function makeIdFilterToMatchWithQuery(input) {
if (typeof input === "string") return `${input}{?*,}`;
return makeRegexIdFilterToMatchWithQuery(input);
}
function makeRegexIdFilterToMatchWithQuery(input) {
return new RegExp(input.source.replace(/(?<!\\)\$/g, "(?:\\?.*)?$"), input.flags);
}
//#endregion
//#region src/plugin/with-filter.ts
function withFilterImpl(pluginOption, filterObjectList) {
if (isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
if (pluginOption == false || pluginOption == null) return pluginOption;
if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
let plugin = pluginOption;
let filterObjectIndex = findMatchedFilterObject(plugin.name, filterObjectList);
if (filterObjectIndex === -1) return plugin;
let filterObject = filterObjectList[filterObjectIndex];
Object.keys(plugin).forEach((key) => {
switch (key) {
case "transform":
case "resolveId":
case "load":
if (!plugin[key]) return;
if (typeof plugin[key] === "object") plugin[key].filter = filterObject[key] ?? plugin[key].filter;
else plugin[key] = {
handler: plugin[key],
filter: filterObject[key]
};
break;
default: break;
}
});
return plugin;
}
function withFilter(pluginOption, filterObject) {
return withFilterImpl(pluginOption, arraify(filterObject));
}
function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
for (let i = 0; i < overrideFilterObjectList.length; i++) for (let j = 0; j < (overrideFilterObjectList[i].pluginNamePattern ?? []).length; j++) {
let pattern = overrideFilterObjectList[i].pluginNamePattern[j];
if (typeof pattern === "string" && pattern === pluginName) return i;
else if (pattern instanceof RegExp && pattern.test(pluginName)) return i;
}
return -1;
}
//#endregion
export { and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query, withFilter };

7
node_modules/rolldown/dist/get-log-filter.d.mts generated vendored Normal file
View file

@ -0,0 +1,7 @@
import { a as RollupLog } from "./shared/logging-B4x9qar8.mjs";
//#region src/get-log-filter.d.ts
type GetLogFilter = (filters: string[]) => (log: RollupLog) => boolean;
declare const getLogFilter: GetLogFilter;
//#endregion
export { GetLogFilter, type RollupLog, getLogFilter as default };

48
node_modules/rolldown/dist/get-log-filter.mjs generated vendored Normal file
View file

@ -0,0 +1,48 @@
//#region src/get-log-filter.ts
const getLogFilter = (filters) => {
if (filters.length === 0) return () => true;
const normalizedFilters = filters.map((filter) => filter.split("&").map((subFilter) => {
const inverted = subFilter.startsWith("!");
if (inverted) subFilter = subFilter.slice(1);
const [key, ...value] = subFilter.split(":");
return {
inverted,
key: key.split("."),
parts: value.join(":").split("*")
};
}));
return (log) => {
nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) {
for (const { inverted, key, parts } of intersectedFilters) {
const isFilterSatisfied = testFilter(log, key, parts);
if (inverted ? isFilterSatisfied : !isFilterSatisfied) continue nextIntersectedFilter;
}
return true;
}
return false;
};
};
const testFilter = (log, key, parts) => {
let rawValue = log;
for (let index = 0; index < key.length; index++) {
if (!rawValue) return false;
const part = key[index];
if (!(part in rawValue)) return false;
rawValue = rawValue[part];
}
let value = typeof rawValue === "object" ? JSON.stringify(rawValue) : String(rawValue);
if (parts.length === 1) return value === parts[0];
if (!value.startsWith(parts[0])) return false;
const lastPartIndex = parts.length - 1;
for (let index = 1; index < lastPartIndex; index++) {
const part = parts[index];
const position = value.indexOf(part);
if (position === -1) return false;
value = value.slice(position + part.length);
}
return value.endsWith(parts[lastPartIndex]);
};
var get_log_filter_default = getLogFilter;
//#endregion
export { get_log_filter_default as default };

4
node_modules/rolldown/dist/index.d.mts generated vendored Normal file
View file

@ -0,0 +1,4 @@
import { a as RollupLog, i as RollupError, n as LogLevelOption, o as RollupLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-B4x9qar8.mjs";
import { V as PreRenderedChunk, s as BindingMagicString } from "./shared/binding-MAEzB4KA.mjs";
import { $ as RolldownFsModule, At as RenderedModule, B as EmittedPrebuiltChunk, C as ResolveIdResult, Ct as PreRenderedAsset, D as SourceDescription, Dt as OutputAsset, E as RolldownPluginOption, F as OutputBundle, Ft as SourcemapIgnoreListOption, G as MinimalPluginContext, H as PluginContext, I as TreeshakingOptions, J as HookFilter, K as PluginContextMeta, L as TransformPluginContext, M as ExistingRawSourceMap, Mt as SourceMap, N as SourceMapInput, O as TransformResult, Ot as OutputChunk, P as RolldownOptionsFunction, Pt as ModuleInfo, Q as RolldownFileStats, R as EmittedAsset, S as ResolveIdExtraOptions, St as OutputOptions, T as RolldownPlugin, Tt as PartialNull, U as DefineParallelPluginResult, V as GetModuleInfo, X as BufferEncoding, Y as ModuleTypeFilter, Z as RolldownDirectoryEntry, _ as ModuleType, _t as GeneratedCodeOptions, a as InputOption, at as WarningHandlerWithDefault, b as PartialResolvedId, bt as MinifyOptions, c as OptimizationOptions, ct as RolldownWatcherEvent, d as CustomPluginOptions, dt as RolldownBuild, et as InternalModuleFormat, f as FunctionPluginHooks, ft as BuildOptions, g as ModuleOptions, gt as ChunkingContext, h as LoadResult, ht as ChunkFileNamesFunction, i as ExternalOption, it as LoggingFunction, j as VERSION, jt as RolldownOutput, kt as RenderedChunk, l as WatcherOptions, lt as WatchOptions, m as ImportKind, mt as AddonFunction, n as ConfigExport, nt as NormalizedInputOptions, o as InputOptions, ot as watch, p as HookFilterExtension, pt as build, q as GeneralHookFilter, r as RolldownOptions, rt as ChecksOptions, s as ModuleTypes, st as RolldownWatcher, t as defineConfig, tt as NormalizedOutputOptions, u as AsyncPluginHooks, ut as rolldown, v as ObjectHook, vt as GeneratedCodePreset, w as ResolvedId, x as Plugin, xt as ModuleFormat, y as ParallelPluginHooks, yt as GlobalsFunction, z as EmittedFile } from "./shared/define-config-Cg9apQLa.mjs";
export { AddonFunction, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, ChecksOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, EmittedPrebuiltChunk, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };

38
node_modules/rolldown/dist/index.mjs generated vendored Normal file
View file

@ -0,0 +1,38 @@
import { n as __toESM, t as require_binding } from "./shared/binding-QUhP-0wQ.mjs";
import { n as onExit, t as watch } from "./shared/watch-CN4zUkzW.mjs";
import { y as VERSION } from "./shared/normalize-string-or-regex-DbyImenn.mjs";
import "./shared/rolldown-build-ciWo5RN-.mjs";
import "./shared/bindingify-input-options-CJ8NjPpl.mjs";
import "./shared/parse-ast-index-Dxd6PXtU.mjs";
import { t as rolldown } from "./shared/rolldown-BR9L9ovo.mjs";
import { t as defineConfig } from "./shared/define-config-BF4P-Pum.mjs";
import { isMainThread } from "node:worker_threads";
//#region src/setup.ts
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
if (isMainThread) {
const subscriberGuard = (0, import_binding.initTraceSubscriber)();
onExit(() => {
subscriberGuard?.close();
});
}
//#endregion
//#region src/api/build.ts
async function build(options) {
if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
else {
const { output, write = true, ...inputOptions } = options;
const build$1 = await rolldown(inputOptions);
try {
if (write) return await build$1.write(output);
else return await build$1.generate(output);
} finally {
await build$1.close();
}
}
}
//#endregion
var BindingMagicString = import_binding.BindingMagicString;
export { BindingMagicString, VERSION, build, defineConfig, rolldown, watch };

View file

@ -0,0 +1 @@
export { };

32
node_modules/rolldown/dist/parallel-plugin-worker.mjs generated vendored Normal file
View file

@ -0,0 +1,32 @@
import { n as __toESM, t as require_binding } from "./shared/binding-QUhP-0wQ.mjs";
import "./shared/normalize-string-or-regex-DbyImenn.mjs";
import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-CJ8NjPpl.mjs";
import "./shared/parse-ast-index-Dxd6PXtU.mjs";
import { parentPort, workerData } from "node:worker_threads";
//#region src/parallel-plugin-worker.ts
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
const { registryId, pluginInfos, threadNumber } = workerData;
(async () => {
try {
(0, import_binding.registerPlugins)(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {
const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
return {
index: pluginInfo.index,
plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, []), [], () => {}, "info", false)
};
})));
parentPort.postMessage({ type: "success" });
} catch (error) {
parentPort.postMessage({
type: "error",
error
});
} finally {
parentPort.unref();
}
})();
//#endregion
export { };

14
node_modules/rolldown/dist/parallel-plugin.d.mts generated vendored Normal file
View file

@ -0,0 +1,14 @@
import "./shared/binding-MAEzB4KA.mjs";
import { wt as MaybePromise, x as Plugin } from "./shared/define-config-Cg9apQLa.mjs";
//#region src/plugin/parallel-plugin-implementation.d.ts
type ParallelPluginImplementation = Plugin;
type Context = {
/**
* Thread number
*/
threadNumber: number;
};
declare function defineParallelPluginImplementation<Options>(plugin: (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>): (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>;
//#endregion
export { type Context, type ParallelPluginImplementation, defineParallelPluginImplementation };

7
node_modules/rolldown/dist/parallel-plugin.mjs generated vendored Normal file
View file

@ -0,0 +1,7 @@
//#region src/plugin/parallel-plugin-implementation.ts
function defineParallelPluginImplementation(plugin) {
return plugin;
}
//#endregion
export { defineParallelPluginImplementation };

8
node_modules/rolldown/dist/parse-ast-index.d.mts generated vendored Normal file
View file

@ -0,0 +1,8 @@
import { B as ParserOptions, z as ParseResult } from "./shared/binding-MAEzB4KA.mjs";
import { Program } from "@oxc-project/types";
//#region src/parse-ast-index.d.ts
declare function parseAst(sourceText: string, options?: ParserOptions | null, filename?: string): Program;
declare function parseAstAsync(sourceText: string, options?: ParserOptions | null, filename?: string): Promise<Program>;
//#endregion
export { type ParseResult, type ParserOptions, parseAst, parseAstAsync };

4
node_modules/rolldown/dist/parse-ast-index.mjs generated vendored Normal file
View file

@ -0,0 +1,4 @@
import "./shared/binding-QUhP-0wQ.mjs";
import { n as parseAstAsync, t as parseAst } from "./shared/parse-ast-index-Dxd6PXtU.mjs";
export { parseAst, parseAstAsync };

31
node_modules/rolldown/dist/plugins-index.d.mts generated vendored Normal file
View file

@ -0,0 +1,31 @@
import { u as BindingReplacePluginConfig } from "./shared/binding-MAEzB4KA.mjs";
import { A as BuiltinPlugin } from "./shared/define-config-Cg9apQLa.mjs";
import { t as esmExternalRequirePlugin } from "./shared/constructors-DcGyaGNV.mjs";
//#region src/builtin-plugin/replace-plugin.d.ts
/**
* Replaces targeted strings in files while bundling.
*
* @example
* // Basic usage
* ```js
* replacePlugin({
* 'process.env.NODE_ENV': JSON.stringify('production'),
* __buildVersion: 15
* })
* ```
* @example
* // With options
* ```js
* replacePlugin({
* 'process.env.NODE_ENV': JSON.stringify('production'),
* __buildVersion: 15
* }, {
* preventAssignment: false,
* })
* ```
*/
declare function replacePlugin(values?: BindingReplacePluginConfig["values"], options?: Omit<BindingReplacePluginConfig, "values">): BuiltinPlugin;
//#endregion
export { esmExternalRequirePlugin, replacePlugin };

40
node_modules/rolldown/dist/plugins-index.mjs generated vendored Normal file
View file

@ -0,0 +1,40 @@
import "./shared/binding-QUhP-0wQ.mjs";
import { n as BuiltinPlugin, s as makeBuiltinPluginCallable } from "./shared/normalize-string-or-regex-DbyImenn.mjs";
import { t as esmExternalRequirePlugin } from "./shared/constructors-Ckn63GYh.mjs";
//#region src/builtin-plugin/replace-plugin.ts
/**
* Replaces targeted strings in files while bundling.
*
* @example
* // Basic usage
* ```js
* replacePlugin({
* 'process.env.NODE_ENV': JSON.stringify('production'),
* __buildVersion: 15
* })
* ```
* @example
* // With options
* ```js
* replacePlugin({
* 'process.env.NODE_ENV': JSON.stringify('production'),
* __buildVersion: 15
* }, {
* preventAssignment: false,
* })
* ```
*/
function replacePlugin(values = {}, options = {}) {
Object.keys(values).forEach((key) => {
const value = values[key];
if (typeof value !== "string") values[key] = String(value);
});
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:replace", {
...options,
values
}));
}
//#endregion
export { esmExternalRequirePlugin, replacePlugin };

1733
node_modules/rolldown/dist/shared/binding-MAEzB4KA.d.mts generated vendored Normal file

File diff suppressed because it is too large Load diff

584
node_modules/rolldown/dist/shared/binding-QUhP-0wQ.mjs generated vendored Normal file
View file

@ -0,0 +1,584 @@
import { createRequire } from "node:module";
//#region rolldown:runtime
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) {
__defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
}
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
var __require = /* @__PURE__ */ createRequire(import.meta.url);
//#endregion
//#region src/webcontainer-fallback.cjs
var require_webcontainer_fallback = /* @__PURE__ */ __commonJSMin(((exports, module) => {
const fs = __require("node:fs");
const childProcess = __require("node:child_process");
const version = JSON.parse(fs.readFileSync(__require.resolve("rolldown/package.json"), "utf-8")).version;
const baseDir = `/tmp/rolldown-${version}`;
const bindingEntry = `${baseDir}/node_modules/@rolldown/binding-wasm32-wasi/rolldown-binding.wasi.cjs`;
if (!fs.existsSync(bindingEntry)) {
const bindingPkg = `@rolldown/binding-wasm32-wasi@${version}`;
fs.rmSync(baseDir, {
recursive: true,
force: true
});
fs.mkdirSync(baseDir, { recursive: true });
console.log(`[rolldown] Downloading ${bindingPkg} on WebContainer...`);
childProcess.execFileSync("pnpm", ["i", bindingPkg], {
cwd: baseDir,
stdio: "inherit"
});
}
module.exports = __require(bindingEntry);
}));
//#endregion
//#region src/binding.cjs
var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
const { readFileSync } = __require("node:fs");
let nativeBinding = null;
const loadErrors = [];
const isMusl = () => {
let musl = false;
if (process.platform === "linux") {
musl = isMuslFromFilesystem();
if (musl === null) musl = isMuslFromReport();
if (musl === null) musl = isMuslFromChildProcess();
}
return musl;
};
const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
const isMuslFromFilesystem = () => {
try {
return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
} catch {
return null;
}
};
const isMuslFromReport = () => {
let report = null;
if (typeof process.report?.getReport === "function") {
process.report.excludeNetwork = true;
report = process.report.getReport();
}
if (!report) return null;
if (report.header && report.header.glibcVersionRuntime) return false;
if (Array.isArray(report.sharedObjects)) {
if (report.sharedObjects.some(isFileMusl)) return true;
}
return false;
};
const isMuslFromChildProcess = () => {
try {
return __require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
} catch (e) {
return false;
}
};
function requireNative() {
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) try {
return __require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
} catch (err) {
loadErrors.push(err);
}
else if (process.platform === "android") if (process.arch === "arm64") {
try {
return __require("./rolldown-binding.android-arm64.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-android-arm64");
const bindingPackageVersion = __require("@rolldown/binding-android-arm64/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else if (process.arch === "arm") {
try {
return __require("./rolldown-binding.android-arm-eabi.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-android-arm-eabi");
const bindingPackageVersion = __require("@rolldown/binding-android-arm-eabi/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Android ${process.arch}`));
else if (process.platform === "win32") if (process.arch === "x64") if (process.config?.variables?.shlib_suffix === "dll.a" || process.config?.variables?.node_target_type === "shared_library") {
try {
return __require("./rolldown-binding.win32-x64-gnu.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-win32-x64-gnu");
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-gnu/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else {
try {
return __require("./rolldown-binding.win32-x64-msvc.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-win32-x64-msvc");
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-msvc/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
}
else if (process.arch === "ia32") {
try {
return __require("./rolldown-binding.win32-ia32-msvc.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-win32-ia32-msvc");
const bindingPackageVersion = __require("@rolldown/binding-win32-ia32-msvc/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else if (process.arch === "arm64") {
try {
return __require("./rolldown-binding.win32-arm64-msvc.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-win32-arm64-msvc");
const bindingPackageVersion = __require("@rolldown/binding-win32-arm64-msvc/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Windows: ${process.arch}`));
else if (process.platform === "darwin") {
try {
return __require("./rolldown-binding.darwin-universal.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-darwin-universal");
const bindingPackageVersion = __require("@rolldown/binding-darwin-universal/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
if (process.arch === "x64") {
try {
return __require("./rolldown-binding.darwin-x64.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-darwin-x64");
const bindingPackageVersion = __require("@rolldown/binding-darwin-x64/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else if (process.arch === "arm64") {
try {
return __require("./rolldown-binding.darwin-arm64.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-darwin-arm64");
const bindingPackageVersion = __require("@rolldown/binding-darwin-arm64/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on macOS: ${process.arch}`));
} else if (process.platform === "freebsd") if (process.arch === "x64") {
try {
return __require("./rolldown-binding.freebsd-x64.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-freebsd-x64");
const bindingPackageVersion = __require("@rolldown/binding-freebsd-x64/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else if (process.arch === "arm64") {
try {
return __require("./rolldown-binding.freebsd-arm64.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-freebsd-arm64");
const bindingPackageVersion = __require("@rolldown/binding-freebsd-arm64/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
else if (process.platform === "linux") if (process.arch === "x64") if (isMusl()) {
try {
return __require("./rolldown-binding.linux-x64-musl.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-linux-x64-musl");
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-musl/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else {
try {
return __require("../rolldown-binding.linux-x64-gnu.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-linux-x64-gnu");
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-gnu/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
}
else if (process.arch === "arm64") if (isMusl()) {
try {
return __require("./rolldown-binding.linux-arm64-musl.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-linux-arm64-musl");
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-musl/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else {
try {
return __require("./rolldown-binding.linux-arm64-gnu.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-linux-arm64-gnu");
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-gnu/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
}
else if (process.arch === "arm") if (isMusl()) {
try {
return __require("./rolldown-binding.linux-arm-musleabihf.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-linux-arm-musleabihf");
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-musleabihf/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else {
try {
return __require("./rolldown-binding.linux-arm-gnueabihf.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-linux-arm-gnueabihf");
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-gnueabihf/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
}
else if (process.arch === "loong64") if (isMusl()) {
try {
return __require("./rolldown-binding.linux-loong64-musl.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-linux-loong64-musl");
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-musl/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else {
try {
return __require("./rolldown-binding.linux-loong64-gnu.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-linux-loong64-gnu");
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-gnu/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
}
else if (process.arch === "riscv64") if (isMusl()) {
try {
return __require("./rolldown-binding.linux-riscv64-musl.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-linux-riscv64-musl");
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-musl/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else {
try {
return __require("./rolldown-binding.linux-riscv64-gnu.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-linux-riscv64-gnu");
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-gnu/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
}
else if (process.arch === "ppc64") {
try {
return __require("./rolldown-binding.linux-ppc64-gnu.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-linux-ppc64-gnu");
const bindingPackageVersion = __require("@rolldown/binding-linux-ppc64-gnu/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else if (process.arch === "s390x") {
try {
return __require("./rolldown-binding.linux-s390x-gnu.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-linux-s390x-gnu");
const bindingPackageVersion = __require("@rolldown/binding-linux-s390x-gnu/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Linux: ${process.arch}`));
else if (process.platform === "openharmony") if (process.arch === "arm64") {
try {
return __require("./rolldown-binding.openharmony-arm64.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-openharmony-arm64");
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm64/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else if (process.arch === "x64") {
try {
return __require("./rolldown-binding.openharmony-x64.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-openharmony-x64");
const bindingPackageVersion = __require("@rolldown/binding-openharmony-x64/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else if (process.arch === "arm") {
try {
return __require("./rolldown-binding.openharmony-arm.node");
} catch (e) {
loadErrors.push(e);
}
try {
const binding = __require("@rolldown/binding-openharmony-arm");
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm/package.json").version;
if (bindingPackageVersion !== "1.0.0-beta.59" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.59 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
return binding;
} catch (e) {
loadErrors.push(e);
}
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
}
nativeBinding = requireNative();
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
let wasiBinding = null;
let wasiBindingError = null;
try {
wasiBinding = __require("../rolldown-binding.wasi.cjs");
nativeBinding = wasiBinding;
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) wasiBindingError = err;
}
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) try {
wasiBinding = __require("@rolldown/binding-wasm32-wasi");
nativeBinding = wasiBinding;
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
if (!wasiBindingError) wasiBindingError = err;
else wasiBindingError.cause = err;
loadErrors.push(err);
}
}
if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
const error = /* @__PURE__ */ new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
error.cause = wasiBindingError;
throw error;
}
}
if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) try {
nativeBinding = require_webcontainer_fallback();
} catch (err) {
loadErrors.push(err);
}
if (!nativeBinding) {
if (loadErrors.length > 0) throw new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.", { cause: loadErrors.reduce((err, cur) => {
cur.cause = err;
return cur;
}) });
throw new Error(`Failed to load native binding`);
}
module.exports = nativeBinding;
module.exports.minify = nativeBinding.minify;
module.exports.minifySync = nativeBinding.minifySync;
module.exports.Severity = nativeBinding.Severity;
module.exports.ParseResult = nativeBinding.ParseResult;
module.exports.ExportExportNameKind = nativeBinding.ExportExportNameKind;
module.exports.ExportImportNameKind = nativeBinding.ExportImportNameKind;
module.exports.ExportLocalNameKind = nativeBinding.ExportLocalNameKind;
module.exports.ImportNameKind = nativeBinding.ImportNameKind;
module.exports.parse = nativeBinding.parse;
module.exports.parseSync = nativeBinding.parseSync;
module.exports.rawTransferSupported = nativeBinding.rawTransferSupported;
module.exports.ResolverFactory = nativeBinding.ResolverFactory;
module.exports.EnforceExtension = nativeBinding.EnforceExtension;
module.exports.ModuleType = nativeBinding.ModuleType;
module.exports.sync = nativeBinding.sync;
module.exports.HelperMode = nativeBinding.HelperMode;
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration;
module.exports.isolatedDeclarationSync = nativeBinding.isolatedDeclarationSync;
module.exports.moduleRunnerTransform = nativeBinding.moduleRunnerTransform;
module.exports.moduleRunnerTransformSync = nativeBinding.moduleRunnerTransformSync;
module.exports.transform = nativeBinding.transform;
module.exports.transformSync = nativeBinding.transformSync;
module.exports.BindingBundleEndEventData = nativeBinding.BindingBundleEndEventData;
module.exports.BindingBundleErrorEventData = nativeBinding.BindingBundleErrorEventData;
module.exports.BindingBundler = nativeBinding.BindingBundler;
module.exports.BindingCallableBuiltinPlugin = nativeBinding.BindingCallableBuiltinPlugin;
module.exports.BindingChunkingContext = nativeBinding.BindingChunkingContext;
module.exports.BindingDevEngine = nativeBinding.BindingDevEngine;
module.exports.BindingMagicString = nativeBinding.BindingMagicString;
module.exports.BindingModuleInfo = nativeBinding.BindingModuleInfo;
module.exports.BindingNormalizedOptions = nativeBinding.BindingNormalizedOptions;
module.exports.BindingOutputAsset = nativeBinding.BindingOutputAsset;
module.exports.BindingOutputChunk = nativeBinding.BindingOutputChunk;
module.exports.BindingPluginContext = nativeBinding.BindingPluginContext;
module.exports.BindingRenderedChunk = nativeBinding.BindingRenderedChunk;
module.exports.BindingRenderedChunkMeta = nativeBinding.BindingRenderedChunkMeta;
module.exports.BindingRenderedModule = nativeBinding.BindingRenderedModule;
module.exports.BindingTransformPluginContext = nativeBinding.BindingTransformPluginContext;
module.exports.BindingUrlResolver = nativeBinding.BindingUrlResolver;
module.exports.BindingWatcher = nativeBinding.BindingWatcher;
module.exports.BindingWatcherBundler = nativeBinding.BindingWatcherBundler;
module.exports.BindingWatcherChangeData = nativeBinding.BindingWatcherChangeData;
module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
module.exports.ParallelJsPluginRegistry = nativeBinding.ParallelJsPluginRegistry;
module.exports.ScheduledBuild = nativeBinding.ScheduledBuild;
module.exports.TraceSubscriberGuard = nativeBinding.TraceSubscriberGuard;
module.exports.BindingAttachDebugInfo = nativeBinding.BindingAttachDebugInfo;
module.exports.BindingBuiltinPluginName = nativeBinding.BindingBuiltinPluginName;
module.exports.BindingChunkModuleOrderBy = nativeBinding.BindingChunkModuleOrderBy;
module.exports.BindingLogLevel = nativeBinding.BindingLogLevel;
module.exports.BindingPluginOrder = nativeBinding.BindingPluginOrder;
module.exports.BindingPropertyReadSideEffects = nativeBinding.BindingPropertyReadSideEffects;
module.exports.BindingPropertyWriteSideEffects = nativeBinding.BindingPropertyWriteSideEffects;
module.exports.BindingRebuildStrategy = nativeBinding.BindingRebuildStrategy;
module.exports.createTokioRuntime = nativeBinding.createTokioRuntime;
module.exports.FilterTokenKind = nativeBinding.FilterTokenKind;
module.exports.initTraceSubscriber = nativeBinding.initTraceSubscriber;
module.exports.registerPlugins = nativeBinding.registerPlugins;
module.exports.shutdownAsyncRuntime = nativeBinding.shutdownAsyncRuntime;
module.exports.startAsyncRuntime = nativeBinding.startAsyncRuntime;
}));
//#endregion
export { __toESM as n, require_binding as t };

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,67 @@
import { n as BuiltinPlugin, s as makeBuiltinPluginCallable, t as normalizedStringOrRegex } from "./normalize-string-or-regex-DbyImenn.mjs";
//#region src/builtin-plugin/constructors.ts
function viteModulePreloadPolyfillPlugin(config) {
return new BuiltinPlugin("builtin:vite-module-preload-polyfill", config);
}
function viteDynamicImportVarsPlugin(config) {
if (config) {
config.include = normalizedStringOrRegex(config.include);
config.exclude = normalizedStringOrRegex(config.exclude);
}
return new BuiltinPlugin("builtin:vite-dynamic-import-vars", config);
}
function viteImportGlobPlugin(config) {
return new BuiltinPlugin("builtin:vite-import-glob", config);
}
function viteReporterPlugin(config) {
return new BuiltinPlugin("builtin:vite-reporter", config);
}
function viteWasmHelperPlugin(config) {
return new BuiltinPlugin("builtin:vite-wasm-helper", config);
}
function viteWasmFallbackPlugin() {
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-wasm-fallback"));
}
function viteLoadFallbackPlugin() {
return new BuiltinPlugin("builtin:vite-load-fallback");
}
function viteJsonPlugin(config) {
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-json", config));
}
function viteBuildImportAnalysisPlugin(config) {
return new BuiltinPlugin("builtin:vite-build-import-analysis", config);
}
function viteResolvePlugin(config) {
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-resolve", {
...config,
yarnPnp: typeof process === "object" && !!process.versions?.pnp
}));
}
function isolatedDeclarationPlugin(config) {
return new BuiltinPlugin("builtin:isolated-declaration", config);
}
function viteWebWorkerPostPlugin() {
return new BuiltinPlugin("builtin:vite-web-worker-post");
}
function esmExternalRequirePlugin(config) {
const plugin = new BuiltinPlugin("builtin:esm-external-require", config);
plugin.enforce = "pre";
return plugin;
}
function viteReactRefreshWrapperPlugin(config) {
if (config) {
config.include = normalizedStringOrRegex(config.include);
config.exclude = normalizedStringOrRegex(config.exclude);
}
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-react-refresh-wrapper", config));
}
function viteHtmlInlineProxyPlugin(config) {
return new BuiltinPlugin("builtin:vite-html-inline-proxy", config);
}
function viteAssetImportMetaUrlPlugin(config) {
return new BuiltinPlugin("builtin:vite-asset-import-meta-url", config);
}
//#endregion
export { viteDynamicImportVarsPlugin as a, viteJsonPlugin as c, viteReactRefreshWrapperPlugin as d, viteReporterPlugin as f, viteWebWorkerPostPlugin as g, viteWasmHelperPlugin as h, viteBuildImportAnalysisPlugin as i, viteLoadFallbackPlugin as l, viteWasmFallbackPlugin as m, isolatedDeclarationPlugin as n, viteHtmlInlineProxyPlugin as o, viteResolvePlugin as p, viteAssetImportMetaUrlPlugin as r, viteImportGlobPlugin as s, esmExternalRequirePlugin as t, viteModulePreloadPolyfillPlugin as u };

View file

@ -0,0 +1,30 @@
import { D as BindingViteResolvePluginConfig, E as BindingViteReporterPluginConfig, S as BindingViteJsonPluginConfig, T as BindingViteReactRefreshWrapperPluginConfig, h as BindingViteBuildImportAnalysisPluginConfig, i as BindingEsmExternalRequirePluginConfig, k as BindingViteWasmHelperPluginConfig, o as BindingIsolatedDeclarationPluginConfig, p as BindingViteAssetImportMetaUrlPluginConfig, v as BindingViteDynamicImportVarsPluginConfig, w as BindingViteModulePreloadPolyfillPluginConfig, x as BindingViteImportGlobPluginConfig, y as BindingViteHtmlInlineProxyPluginConfig } from "./binding-MAEzB4KA.mjs";
import { A as BuiltinPlugin, Et as StringOrRegExp } from "./define-config-Cg9apQLa.mjs";
//#region src/builtin-plugin/constructors.d.ts
declare function viteModulePreloadPolyfillPlugin(config?: BindingViteModulePreloadPolyfillPluginConfig): BuiltinPlugin;
type DynamicImportVarsPluginConfig = Omit<BindingViteDynamicImportVarsPluginConfig, "include" | "exclude"> & {
include?: StringOrRegExp | StringOrRegExp[];
exclude?: StringOrRegExp | StringOrRegExp[];
};
declare function viteDynamicImportVarsPlugin(config?: DynamicImportVarsPluginConfig): BuiltinPlugin;
declare function viteImportGlobPlugin(config?: BindingViteImportGlobPluginConfig): BuiltinPlugin;
declare function viteReporterPlugin(config: BindingViteReporterPluginConfig): BuiltinPlugin;
declare function viteWasmHelperPlugin(config: BindingViteWasmHelperPluginConfig): BuiltinPlugin;
declare function viteWasmFallbackPlugin(): BuiltinPlugin;
declare function viteLoadFallbackPlugin(): BuiltinPlugin;
declare function viteJsonPlugin(config: BindingViteJsonPluginConfig): BuiltinPlugin;
declare function viteBuildImportAnalysisPlugin(config: BindingViteBuildImportAnalysisPluginConfig): BuiltinPlugin;
declare function viteResolvePlugin(config: Omit<BindingViteResolvePluginConfig, "yarnPnp">): BuiltinPlugin;
declare function isolatedDeclarationPlugin(config?: BindingIsolatedDeclarationPluginConfig): BuiltinPlugin;
declare function viteWebWorkerPostPlugin(): BuiltinPlugin;
declare function esmExternalRequirePlugin(config?: BindingEsmExternalRequirePluginConfig): BuiltinPlugin;
type ViteReactRefreshWrapperPluginConfig = Omit<BindingViteReactRefreshWrapperPluginConfig, "include" | "exclude"> & {
include?: StringOrRegExp | StringOrRegExp[];
exclude?: StringOrRegExp | StringOrRegExp[];
};
declare function viteReactRefreshWrapperPlugin(config: ViteReactRefreshWrapperPluginConfig): BuiltinPlugin;
declare function viteHtmlInlineProxyPlugin(config: BindingViteHtmlInlineProxyPluginConfig): BuiltinPlugin;
declare function viteAssetImportMetaUrlPlugin(config: BindingViteAssetImportMetaUrlPluginConfig): BuiltinPlugin;
//#endregion
export { viteDynamicImportVarsPlugin as a, viteJsonPlugin as c, viteReactRefreshWrapperPlugin as d, viteReporterPlugin as f, viteWebWorkerPostPlugin as g, viteWasmHelperPlugin as h, viteBuildImportAnalysisPlugin as i, viteLoadFallbackPlugin as l, viteWasmFallbackPlugin as m, isolatedDeclarationPlugin as n, viteHtmlInlineProxyPlugin as o, viteResolvePlugin as p, viteAssetImportMetaUrlPlugin as r, viteImportGlobPlugin as s, esmExternalRequirePlugin as t, viteModulePreloadPolyfillPlugin as u };

View file

@ -0,0 +1,7 @@
//#region src/utils/define-config.ts
function defineConfig(config) {
return config;
}
//#endregion
export { defineConfig as t };

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,114 @@
import { t as rolldown } from "./rolldown-BR9L9ovo.mjs";
import fs from "node:fs";
import path from "node:path";
import { readdir } from "node:fs/promises";
import { pathToFileURL } from "node:url";
import { cwd } from "node:process";
//#region src/utils/load-config.ts
async function bundleTsConfig(configFile, isEsm) {
const dirnameVarName = "injected_original_dirname";
const filenameVarName = "injected_original_filename";
const importMetaUrlVarName = "injected_original_import_meta_url";
const bundle = await rolldown({
input: configFile,
platform: "node",
resolve: { mainFields: ["main"] },
transform: { define: {
__dirname: dirnameVarName,
__filename: filenameVarName,
"import.meta.url": importMetaUrlVarName,
"import.meta.dirname": dirnameVarName,
"import.meta.filename": filenameVarName
} },
treeshake: false,
external: [/^[\w@][^:]/],
plugins: [{
name: "inject-file-scope-variables",
transform: {
filter: { id: /\.[cm]?[jt]s$/ },
async handler(code, id) {
return {
code: `const ${dirnameVarName} = ${JSON.stringify(path.dirname(id))};const ${filenameVarName} = ${JSON.stringify(id)};const ${importMetaUrlVarName} = ${JSON.stringify(pathToFileURL(id).href)};` + code,
map: null
};
}
}
}]
});
const outputDir = path.dirname(configFile);
const fileName = (await bundle.write({
dir: outputDir,
format: isEsm ? "esm" : "cjs",
sourcemap: "inline",
entryFileNames: `rolldown.config.[hash]${path.extname(configFile).replace("ts", "js")}`
})).output.find((chunk) => chunk.type === "chunk" && chunk.isEntry).fileName;
return path.join(outputDir, fileName);
}
const SUPPORTED_JS_CONFIG_FORMATS = [
".js",
".mjs",
".cjs"
];
const SUPPORTED_TS_CONFIG_FORMATS = [
".ts",
".mts",
".cts"
];
const SUPPORTED_CONFIG_FORMATS = [...SUPPORTED_JS_CONFIG_FORMATS, ...SUPPORTED_TS_CONFIG_FORMATS];
const DEFAULT_CONFIG_BASE = "rolldown.config";
async function findConfigFileNameInCwd() {
const filesInWorkingDirectory = new Set(await readdir(cwd()));
for (const extension of SUPPORTED_CONFIG_FORMATS) {
const fileName = `${DEFAULT_CONFIG_BASE}${extension}`;
if (filesInWorkingDirectory.has(fileName)) return fileName;
}
throw new Error("No `rolldown.config` configuration file found.");
}
async function loadTsConfig(configFile) {
const file = await bundleTsConfig(configFile, isFilePathESM(configFile));
try {
return (await import(pathToFileURL(file).href)).default;
} finally {
fs.unlink(file, () => {});
}
}
function isFilePathESM(filePath) {
if (/\.m[jt]s$/.test(filePath)) return true;
else if (/\.c[jt]s$/.test(filePath)) return false;
else {
const pkg = findNearestPackageData(path.dirname(filePath));
if (pkg) return pkg.type === "module";
return false;
}
}
function findNearestPackageData(basedir) {
while (basedir) {
const pkgPath = path.join(basedir, "package.json");
if (tryStatSync(pkgPath)?.isFile()) try {
return JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
} catch {}
const nextBasedir = path.dirname(basedir);
if (nextBasedir === basedir) break;
basedir = nextBasedir;
}
return null;
}
function tryStatSync(file) {
try {
return fs.statSync(file, { throwIfNoEntry: false });
} catch {}
}
async function loadConfig(configPath) {
const ext = path.extname(configPath = configPath || await findConfigFileNameInCwd());
try {
if (SUPPORTED_JS_CONFIG_FORMATS.includes(ext) || process.env.NODE_OPTIONS?.includes("--import=tsx") && SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return (await import(pathToFileURL(configPath).href)).default;
else if (SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return await loadTsConfig(path.resolve(configPath));
else throw new Error(`Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${ext}\``);
} catch (err) {
throw new Error("Error happened while loading config.", { cause: err });
}
}
//#endregion
export { loadConfig as t };

View file

@ -0,0 +1,38 @@
//#region src/log/logging.d.ts
type LogLevel = "info" | "debug" | "warn";
type LogLevelOption = LogLevel | "silent";
type LogLevelWithError = LogLevel | "error";
interface RollupLog {
binding?: string;
cause?: unknown;
code?: string;
exporter?: string;
frame?: string;
hook?: string;
id?: string;
ids?: string[];
loc?: {
column: number;
file?: string;
line: number;
};
message: string;
meta?: any;
names?: string[];
plugin?: string;
pluginCode?: unknown;
pos?: number;
reexporter?: string;
stack?: string;
url?: string;
}
type RollupLogWithString = RollupLog | string;
/** @category Plugin APIs */
interface RollupError extends RollupLog {
name?: string;
stack?: string;
watchFiles?: string[];
}
type LogOrStringHandler = (level: LogLevelWithError, log: RollupLogWithString) => void;
//#endregion
export { RollupLog as a, RollupError as i, LogLevelOption as n, RollupLogWithString as o, LogOrStringHandler as r, LogLevel as t };

183
node_modules/rolldown/dist/shared/logs-Up1RAnkl.mjs generated vendored Normal file
View file

@ -0,0 +1,183 @@
//#region src/utils/code-frame.ts
function spaces(index) {
let result = "";
while (index--) result += " ";
return result;
}
function tabsToSpaces(value) {
return value.replace(/^\t+/, (match) => match.split(" ").join(" "));
}
const LINE_TRUNCATE_LENGTH = 120;
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
const ELLIPSIS = "...";
function getCodeFrame(source, line, column) {
let lines = source.split("\n");
if (line > lines.length) return "";
const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + 3, LINE_TRUNCATE_LENGTH);
const frameStart = Math.max(0, line - 3);
let frameEnd = Math.min(line + 2, lines.length);
lines = lines.slice(frameStart, frameEnd);
while (!/\S/.test(lines[lines.length - 1])) {
lines.pop();
frameEnd -= 1;
}
const digits = String(frameEnd).length;
return lines.map((sourceLine, index) => {
const isErrorLine = frameStart + index + 1 === line;
let lineNumber = String(index + frameStart + 1);
while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
let displayedLine = tabsToSpaces(sourceLine);
if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - 3)}${ELLIPSIS}`;
if (isErrorLine) {
const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
return `${lineNumber}: ${displayedLine}\n${indicator}`;
}
return `${lineNumber}: ${displayedLine}`;
}).join("\n");
}
//#endregion
//#region src/log/locate-character/index.js
/** @typedef {import('./types').Location} Location */
/**
* @param {import('./types').Range} range
* @param {number} index
*/
function rangeContains(range, index) {
return range.start <= index && index < range.end;
}
/**
* @param {string} source
* @param {import('./types').Options} [options]
*/
function getLocator(source, options = {}) {
const { offsetLine = 0, offsetColumn = 0 } = options;
let start = 0;
const ranges = source.split("\n").map((line, i$1) => {
const end = start + line.length + 1;
/** @type {import('./types').Range} */
const range = {
start,
end,
line: i$1
};
start = end;
return range;
});
let i = 0;
/**
* @param {string | number} search
* @param {number} [index]
* @returns {Location | undefined}
*/
function locator(search, index) {
if (typeof search === "string") search = source.indexOf(search, index ?? 0);
if (search === -1) return void 0;
let range = ranges[i];
const d = search >= range.end ? 1 : -1;
while (range) {
if (rangeContains(range, search)) return {
line: offsetLine + range.line,
column: offsetColumn + search - range.start,
character: search
};
i += d;
range = ranges[i];
}
}
return locator;
}
/**
* @param {string} source
* @param {string | number} search
* @param {import('./types').Options} [options]
* @returns {Location | undefined}
*/
function locate(source, search, options) {
return getLocator(source, options)(search, options && options.startIndex);
}
//#endregion
//#region src/log/logs.ts
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
function logParseError(message, id, pos) {
return {
code: PARSE_ERROR,
id,
message,
pos
};
}
function logInvalidLogPosition(pluginName) {
return {
code: INVALID_LOG_POSITION,
message: `Plugin "${pluginName}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.`
};
}
function logInputHookInOutputPlugin(pluginName, hookName) {
return {
code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
};
}
function logCycleLoading(pluginName, moduleId) {
return {
code: CYCLE_LOADING,
message: `Found the module "${moduleId}" cycle loading at ${pluginName} plugin, it maybe blocking fetching modules.`
};
}
function logMultiplyNotifyOption() {
return {
code: MULTIPLY_NOTIFY_OPTION,
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
};
}
function logPluginError(error$1, plugin, { hook, id } = {}) {
try {
const code = error$1.code;
if (!error$1.pluginCode && code != null && (typeof code !== "string" || !code.startsWith("PLUGIN_"))) error$1.pluginCode = code;
error$1.code = PLUGIN_ERROR;
error$1.plugin = plugin;
if (hook) error$1.hook = hook;
if (id) error$1.id = id;
} catch (_) {} finally {
return error$1;
}
}
function error(base) {
if (!(base instanceof Error)) {
base = Object.assign(new Error(base.message), base);
Object.defineProperty(base, "name", {
value: "RollupError",
writable: true
});
}
throw base;
}
function augmentCodeLocation(properties, pos, source, id) {
if (typeof pos === "object") {
const { line, column } = pos;
properties.loc = {
column,
file: id,
line
};
} else {
properties.pos = pos;
const location = locate(source, pos, { offsetLine: 1 });
if (!location) return;
const { line, column } = location;
properties.loc = {
column,
file: id,
line
};
}
if (properties.frame === void 0) {
const { line, column } = properties.loc;
properties.frame = getCodeFrame(source, line, column);
}
}
//#endregion
export { logInvalidLogPosition as a, logPluginError as c, logInputHookInOutputPlugin as i, locate as l, error as n, logMultiplyNotifyOption as o, logCycleLoading as r, logParseError as s, augmentCodeLocation as t, getCodeFrame as u };

22
node_modules/rolldown/dist/shared/misc-DpjTMcQQ.mjs generated vendored Normal file
View file

@ -0,0 +1,22 @@
//#region src/utils/misc.ts
function arraify(value) {
return Array.isArray(value) ? value : [value];
}
function isPromiseLike(value) {
return value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
}
function unimplemented(info) {
if (info) throw new Error(`unimplemented: ${info}`);
throw new Error("unimplemented");
}
function unreachable(info) {
if (info) throw new Error(`unreachable: ${info}`);
throw new Error("unreachable");
}
function unsupported(info) {
throw new Error(`UNSUPPORTED: ${info}`);
}
function noop(..._args) {}
//#endregion
export { unreachable as a, unimplemented as i, isPromiseLike as n, unsupported as o, noop as r, arraify as t };

View file

@ -0,0 +1,670 @@
import { n as __toESM, t as require_binding } from "./binding-QUhP-0wQ.mjs";
import { a as logInvalidLogPosition, c as logPluginError, n as error } from "./logs-Up1RAnkl.mjs";
import { r as noop } from "./misc-DpjTMcQQ.mjs";
//#region src/log/logging.ts
const LOG_LEVEL_SILENT = "silent";
const LOG_LEVEL_ERROR = "error";
const LOG_LEVEL_WARN = "warn";
const LOG_LEVEL_INFO = "info";
const LOG_LEVEL_DEBUG = "debug";
const logLevelPriority = {
[LOG_LEVEL_DEBUG]: 0,
[LOG_LEVEL_INFO]: 1,
[LOG_LEVEL_WARN]: 2,
[LOG_LEVEL_SILENT]: 3
};
//#endregion
//#region src/log/log-handler.ts
const normalizeLog = (log) => typeof log === "string" ? { message: log } : typeof log === "function" ? normalizeLog(log()) : log;
function getLogHandler(level, code, logger, pluginName, logLevel) {
if (logLevelPriority[level] < logLevelPriority[logLevel]) return noop;
return (log, pos) => {
if (pos != null) logger(LOG_LEVEL_WARN, logInvalidLogPosition(pluginName));
log = normalizeLog(log);
if (log.code && !log.pluginCode) log.pluginCode = log.code;
log.code = code;
log.plugin = pluginName;
logger(level, log);
};
}
//#endregion
//#region package.json
var version = "1.0.0-beta.59";
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
//#endregion
//#region src/version.ts
/** @category Plugin APIs */
const VERSION = version;
//#endregion
//#region src/plugin/minimal-plugin-context.ts
var MinimalPluginContextImpl = class {
info;
warn;
debug;
meta;
constructor(onLog, logLevel, pluginName, watchMode, hookName) {
this.pluginName = pluginName;
this.hookName = hookName;
this.debug = getLogHandler(LOG_LEVEL_DEBUG, "PLUGIN_LOG", onLog, pluginName, logLevel);
this.info = getLogHandler(LOG_LEVEL_INFO, "PLUGIN_LOG", onLog, pluginName, logLevel);
this.warn = getLogHandler(LOG_LEVEL_WARN, "PLUGIN_WARNING", onLog, pluginName, logLevel);
this.meta = {
rollupVersion: "4.23.0",
rolldownVersion: VERSION,
watchMode
};
}
error(e) {
return error(logPluginError(normalizeLog(e), this.pluginName, { hook: this.hookName }));
}
};
//#endregion
//#region src/types/plain-object-like.ts
const LAZY_FIELDS_KEY = Symbol("__lazy_fields__");
/**
* Base class for classes that use `@lazyProp` decorated properties.
*
* **Design Pattern in Rolldown:**
* This is a common pattern in Rolldown due to its three-layer architecture:
* TypeScript API NAPI Bindings Rust Core
*
* **Why we use getters:**
* For performance - to lazily fetch data from Rust bindings only when needed,
* rather than eagerly fetching all data during object construction.
*
* **The problem:**
* Getters defined on class prototypes are non-enumerable by default, which breaks:
* - Object spread operators ({...obj})
* - Object.keys() and similar methods
* - Standard JavaScript object semantics
*
* **The solution:**
* This base class automatically converts `@lazyProp` decorated getters into
* own enumerable getters on each instance during construction.
*
* **Result:**
* Objects get both lazy-loading performance benefits AND plain JavaScript object behavior.
*
* @example
* ```typescript
* class MyClass extends PlainObjectLike {
* @lazyProp
* get myProp() {
* return fetchFromRustBinding();
* }
* }
* ```
*/
var PlainObjectLike = class {
constructor() {
setupLazyProperties(this);
}
};
/**
* Set up lazy properties as own getters on an instance.
* This is called automatically by the `PlainObjectLike` base class constructor.
*
* @param instance - The instance to set up lazy properties on
* @internal
*/
function setupLazyProperties(instance) {
const lazyFields = instance.constructor[LAZY_FIELDS_KEY];
if (!lazyFields) return;
for (const [propertyKey, originalGetter] of lazyFields.entries()) {
let cachedValue;
let hasValue = false;
Object.defineProperty(instance, propertyKey, {
get() {
if (!hasValue) {
cachedValue = originalGetter.call(this);
hasValue = true;
}
return cachedValue;
},
enumerable: true,
configurable: true
});
}
}
/**
* Get all lazy field names from a class instance.
*
* @param instance - Instance to inspect
* @returns Set of lazy property names
*/
function getLazyFields(instance) {
const lazyFields = instance.constructor[LAZY_FIELDS_KEY];
return lazyFields ? new Set(lazyFields.keys()) : /* @__PURE__ */ new Set();
}
//#endregion
//#region src/decorators/lazy.ts
/**
* Decorator that marks a getter as lazy-evaluated and cached.
*
* **What "lazy" means here:**
* 1. Data is lazily fetched from Rust bindings only when the property is accessed (not eagerly on construction)
* 2. Once fetched, the data is cached for subsequent accesses (performance optimization)
* 3. Despite being a getter, it behaves like a plain object property (enumerable, appears in Object.keys())
*
* **Important**: Properties decorated with `@lazyProp` are defined as own enumerable
* properties on each instance (not on the prototype). This ensures they:
* - Appear in Object.keys() and Object.getOwnPropertyNames()
* - Are included in object spreads ({...obj})
* - Are enumerable in for...in loops
*
* Classes using this decorator must extend `PlainObjectLike` base class.
*
* @example
* ```typescript
* class MyClass extends PlainObjectLike {
* @lazyProp
* get expensiveValue() {
* return someExpensiveComputation();
* }
* }
* ```
*/
function lazyProp(target, propertyKey, descriptor) {
if (!target.constructor[LAZY_FIELDS_KEY]) target.constructor[LAZY_FIELDS_KEY] = /* @__PURE__ */ new Map();
const originalGetter = descriptor.get;
target.constructor[LAZY_FIELDS_KEY].set(propertyKey, originalGetter);
return {
enumerable: false,
configurable: true
};
}
//#endregion
//#region src/utils/asset-source.ts
function transformAssetSource(bindingAssetSource$1) {
return bindingAssetSource$1.inner;
}
function bindingAssetSource(source) {
return { inner: source };
}
//#endregion
//#region \0@oxc-project+runtime@0.107.0/helpers/decorate.js
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
//#endregion
//#region src/types/output-asset-impl.ts
var OutputAssetImpl = class extends PlainObjectLike {
type = "asset";
constructor(bindingAsset) {
super();
this.bindingAsset = bindingAsset;
}
get fileName() {
return this.bindingAsset.getFileName();
}
get originalFileName() {
return this.bindingAsset.getOriginalFileName() || null;
}
get originalFileNames() {
return this.bindingAsset.getOriginalFileNames();
}
get name() {
return this.bindingAsset.getName() ?? void 0;
}
get names() {
return this.bindingAsset.getNames();
}
get source() {
return transformAssetSource(this.bindingAsset.getSource());
}
__rolldown_external_memory_handle__(keepDataAlive) {
if (keepDataAlive) this.#evaluateAllLazyFields();
return this.bindingAsset.dropInner();
}
#evaluateAllLazyFields() {
for (const field of getLazyFields(this)) this[field];
}
};
__decorate([lazyProp], OutputAssetImpl.prototype, "fileName", null);
__decorate([lazyProp], OutputAssetImpl.prototype, "originalFileName", null);
__decorate([lazyProp], OutputAssetImpl.prototype, "originalFileNames", null);
__decorate([lazyProp], OutputAssetImpl.prototype, "name", null);
__decorate([lazyProp], OutputAssetImpl.prototype, "names", null);
__decorate([lazyProp], OutputAssetImpl.prototype, "source", null);
//#endregion
//#region src/utils/transform-rendered-module.ts
function transformToRenderedModule(bindingRenderedModule) {
return {
get code() {
return bindingRenderedModule.code;
},
get renderedLength() {
return bindingRenderedModule.code?.length || 0;
},
get renderedExports() {
return bindingRenderedModule.renderedExports;
}
};
}
//#endregion
//#region src/utils/transform-rendered-chunk.ts
function transformRenderedChunk(chunk) {
let modules = null;
return {
type: "chunk",
get name() {
return chunk.name;
},
get isEntry() {
return chunk.isEntry;
},
get isDynamicEntry() {
return chunk.isDynamicEntry;
},
get facadeModuleId() {
return chunk.facadeModuleId;
},
get moduleIds() {
return chunk.moduleIds;
},
get exports() {
return chunk.exports;
},
get fileName() {
return chunk.fileName;
},
get imports() {
return chunk.imports;
},
get dynamicImports() {
return chunk.dynamicImports;
},
get modules() {
if (!modules) modules = transformChunkModules(chunk.modules);
return modules;
}
};
}
function transformChunkModules(modules) {
const result = {};
for (let i = 0; i < modules.values.length; i++) {
let key = modules.keys[i];
const mod = modules.values[i];
result[key] = transformToRenderedModule(mod);
}
return result;
}
//#endregion
//#region src/types/output-chunk-impl.ts
var OutputChunkImpl = class extends PlainObjectLike {
type = "chunk";
constructor(bindingChunk) {
super();
this.bindingChunk = bindingChunk;
}
get fileName() {
return this.bindingChunk.getFileName();
}
get name() {
return this.bindingChunk.getName();
}
get exports() {
return this.bindingChunk.getExports();
}
get isEntry() {
return this.bindingChunk.getIsEntry();
}
get facadeModuleId() {
return this.bindingChunk.getFacadeModuleId() || null;
}
get isDynamicEntry() {
return this.bindingChunk.getIsDynamicEntry();
}
get sourcemapFileName() {
return this.bindingChunk.getSourcemapFileName() || null;
}
get preliminaryFileName() {
return this.bindingChunk.getPreliminaryFileName();
}
get code() {
return this.bindingChunk.getCode();
}
get modules() {
return transformChunkModules(this.bindingChunk.getModules());
}
get imports() {
return this.bindingChunk.getImports();
}
get dynamicImports() {
return this.bindingChunk.getDynamicImports();
}
get moduleIds() {
return this.bindingChunk.getModuleIds();
}
get map() {
const mapString = this.bindingChunk.getMap();
return mapString ? transformToRollupSourceMap(mapString) : null;
}
__rolldown_external_memory_handle__(keepDataAlive) {
if (keepDataAlive) this.#evaluateAllLazyFields();
return this.bindingChunk.dropInner();
}
#evaluateAllLazyFields() {
for (const field of getLazyFields(this)) this[field];
}
};
__decorate([lazyProp], OutputChunkImpl.prototype, "fileName", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "name", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "exports", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "isEntry", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "facadeModuleId", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "isDynamicEntry", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "sourcemapFileName", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "preliminaryFileName", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "code", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "modules", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "imports", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "dynamicImports", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "moduleIds", null);
__decorate([lazyProp], OutputChunkImpl.prototype, "map", null);
//#endregion
//#region src/types/sourcemap.ts
function bindingifySourcemap(map) {
if (map == null) return;
return { inner: typeof map === "string" ? map : {
file: map.file ?? void 0,
mappings: map.mappings,
sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
sources: map.sources?.map((s) => s ?? void 0),
sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
names: map.names,
x_google_ignoreList: map.x_google_ignoreList,
debugId: "debugId" in map ? map.debugId : void 0
} };
}
//#endregion
//#region src/utils/transform-to-rollup-output.ts
function transformToRollupSourceMap(map) {
const obj = {
...JSON.parse(map),
toString() {
return JSON.stringify(obj);
},
toUrl() {
return `data:application/json;charset=utf-8;base64,${Buffer.from(obj.toString(), "utf-8").toString("base64")}`;
}
};
return obj;
}
function transformToRollupOutputChunk(bindingChunk) {
return new OutputChunkImpl(bindingChunk);
}
function transformToMutableRollupOutputChunk(bindingChunk, changed) {
const chunk = {
type: "chunk",
get code() {
return bindingChunk.getCode();
},
fileName: bindingChunk.getFileName(),
name: bindingChunk.getName(),
get modules() {
return transformChunkModules(bindingChunk.getModules());
},
get imports() {
return bindingChunk.getImports();
},
get dynamicImports() {
return bindingChunk.getDynamicImports();
},
exports: bindingChunk.getExports(),
isEntry: bindingChunk.getIsEntry(),
facadeModuleId: bindingChunk.getFacadeModuleId() || null,
isDynamicEntry: bindingChunk.getIsDynamicEntry(),
get moduleIds() {
return bindingChunk.getModuleIds();
},
get map() {
const map = bindingChunk.getMap();
return map ? transformToRollupSourceMap(map) : null;
},
sourcemapFileName: bindingChunk.getSourcemapFileName() || null,
preliminaryFileName: bindingChunk.getPreliminaryFileName()
};
const cache = {};
return new Proxy(chunk, {
get(target, p) {
if (p in cache) return cache[p];
const value = target[p];
cache[p] = value;
return value;
},
set(_target, p, newValue) {
cache[p] = newValue;
changed.updated.add(bindingChunk.getFileName());
return true;
},
has(target, p) {
if (p in cache) return true;
return p in target;
}
});
}
function transformToRollupOutputAsset(bindingAsset) {
return new OutputAssetImpl(bindingAsset);
}
function transformToMutableRollupOutputAsset(bindingAsset, changed) {
const asset = {
type: "asset",
fileName: bindingAsset.getFileName(),
originalFileName: bindingAsset.getOriginalFileName() || null,
originalFileNames: bindingAsset.getOriginalFileNames(),
get source() {
return transformAssetSource(bindingAsset.getSource());
},
name: bindingAsset.getName() ?? void 0,
names: bindingAsset.getNames()
};
const cache = {};
return new Proxy(asset, {
get(target, p) {
if (p in cache) return cache[p];
const value = target[p];
cache[p] = value;
return value;
},
set(_target, p, newValue) {
cache[p] = newValue;
changed.updated.add(bindingAsset.getFileName());
return true;
}
});
}
function transformToRollupOutput(output) {
const { chunks, assets } = output;
return { output: [...chunks.map((chunk) => transformToRollupOutputChunk(chunk)), ...assets.map((asset) => transformToRollupOutputAsset(asset))] };
}
function transformToMutableRollupOutput(output, changed) {
const { chunks, assets } = output;
return { output: [...chunks.map((chunk) => transformToMutableRollupOutputChunk(chunk, changed)), ...assets.map((asset) => transformToMutableRollupOutputAsset(asset, changed))] };
}
function transformToOutputBundle(context, output, changed) {
const bundle = Object.fromEntries(transformToMutableRollupOutput(output, changed).output.map((item) => [item.fileName, item]));
return new Proxy(bundle, {
set(_target, _p, _newValue, _receiver) {
const originalStackTraceLimit = Error.stackTraceLimit;
Error.stackTraceLimit = 2;
const message = "This plugin assigns to bundle variable. This is discouraged by Rollup and is not supported by Rolldown. This will be ignored. https://rollupjs.org/plugin-development/#generatebundle:~:text=DANGER,this.emitFile.";
const stack = new Error(message).stack ?? message;
Error.stackTraceLimit = originalStackTraceLimit;
context.warn({
message: stack,
code: "UNSUPPORTED_BUNDLE_ASSIGNMENT"
});
return true;
},
deleteProperty(target, property) {
if (typeof property === "string") changed.deleted.add(property);
return true;
}
});
}
function collectChangedBundle(changed, bundle) {
const changes = {};
for (const key in bundle) {
if (changed.deleted.has(key) || !changed.updated.has(key)) continue;
const item = bundle[key];
if (item.type === "asset") changes[key] = {
filename: item.fileName,
originalFileNames: item.originalFileNames,
source: bindingAssetSource(item.source),
names: item.names
};
else changes[key] = {
code: item.code,
filename: item.fileName,
name: item.name,
isEntry: item.isEntry,
exports: item.exports,
modules: {},
imports: item.imports,
dynamicImports: item.dynamicImports,
facadeModuleId: item.facadeModuleId || void 0,
isDynamicEntry: item.isDynamicEntry,
moduleIds: item.moduleIds,
map: bindingifySourcemap(item.map),
sourcemapFilename: item.sourcemapFileName || void 0,
preliminaryFilename: item.preliminaryFileName
};
}
return {
changes,
deleted: changed.deleted
};
}
//#endregion
//#region src/builtin-plugin/utils.ts
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
var BuiltinPlugin = class {
/** Vite-specific option to control plugin ordering */
enforce;
constructor(name, _options) {
this.name = name;
this._options = _options;
}
};
function makeBuiltinPluginCallable(plugin) {
let callablePlugin = new import_binding.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
const wrappedPlugin = plugin;
for (const key in callablePlugin) wrappedPlugin[key] = async function(...args) {
try {
return await callablePlugin[key](...args);
} catch (e) {
if (e instanceof Error && !e.stack?.includes("at ")) Error.captureStackTrace(e, wrappedPlugin[key]);
return error(logPluginError(e, plugin.name, {
hook: key,
id: key === "transform" ? args[2] : void 0
}));
}
};
return wrappedPlugin;
}
function bindingifyBuiltInPlugin(plugin) {
return {
__name: plugin.name,
options: plugin._options
};
}
function bindingifyManifestPlugin(plugin, pluginContextData) {
const { isOutputOptionsForLegacyChunks, ...options } = plugin._options;
return {
__name: plugin.name,
options: {
...options,
isLegacy: isOutputOptionsForLegacyChunks ? (opts) => {
return isOutputOptionsForLegacyChunks(pluginContextData.getOutputOptions(opts));
} : void 0
}
};
}
function bindingifyCSSPostPlugin(plugin, pluginContextData) {
const { isOutputOptionsForLegacyChunks, ...options } = plugin._options;
return {
__name: plugin.name,
options: {
...options,
isLegacy: isOutputOptionsForLegacyChunks ? (opts) => {
return isOutputOptionsForLegacyChunks(pluginContextData.getOutputOptions(opts));
} : void 0,
cssScopeTo() {
const cssScopeTo = {};
for (const [id, opts] of pluginContextData.moduleOptionMap.entries()) if (opts?.meta.vite?.cssScopeTo) cssScopeTo[id] = opts.meta.vite.cssScopeTo;
return cssScopeTo;
}
}
};
}
function bindingifyViteHtmlPlugin(plugin, onLog, logLevel, watchMode, pluginContextData) {
const { preHooks, normalHooks, postHooks, applyHtmlTransforms, ...options } = plugin._options;
if (preHooks.length + normalHooks.length + postHooks.length > 0) return {
__name: plugin.name,
options: {
...options,
transformIndexHtml: async (html, path, filename, hook, output, chunk) => {
const pluginContext = new MinimalPluginContextImpl(onLog, logLevel, plugin.name, watchMode, "transformIndexHtml");
const context = {
path,
filename,
bundle: output ? transformToOutputBundle(pluginContext, output, {
updated: /* @__PURE__ */ new Set(),
deleted: /* @__PURE__ */ new Set()
}) : void 0,
chunk: chunk ? transformToRollupOutputChunk(chunk) : void 0
};
switch (hook) {
case "transform": return await applyHtmlTransforms(html, preHooks, pluginContext, context);
case "generateBundle": return await applyHtmlTransforms(html, [...normalHooks, ...postHooks], pluginContext, context);
}
},
setModuleSideEffects(id) {
let opts = pluginContextData.getModuleOption(id);
pluginContextData.updateModuleOption(id, {
moduleSideEffects: true,
meta: opts.meta,
invalidate: true
});
}
}
};
return {
__name: plugin.name,
options: plugin._options
};
}
//#endregion
//#region src/utils/normalize-string-or-regex.ts
function normalizedStringOrRegex(pattern) {
if (!pattern) return;
if (!isReadonlyArray(pattern)) return [pattern];
return pattern;
}
function isReadonlyArray(input) {
return Array.isArray(input);
}
//#endregion
export { LOG_LEVEL_DEBUG as C, logLevelPriority as D, LOG_LEVEL_WARN as E, normalizeLog as S, LOG_LEVEL_INFO as T, PlainObjectLike as _, bindingifyManifestPlugin as a, description as b, collectChangedBundle as c, bindingifySourcemap as d, transformRenderedChunk as f, lazyProp as g, transformAssetSource as h, bindingifyCSSPostPlugin as i, transformToOutputBundle as l, bindingAssetSource as m, BuiltinPlugin as n, bindingifyViteHtmlPlugin as o, __decorate as p, bindingifyBuiltInPlugin as r, makeBuiltinPluginCallable as s, normalizedStringOrRegex as t, transformToRollupOutput as u, MinimalPluginContextImpl as v, LOG_LEVEL_ERROR as w, version as x, VERSION as y };

View file

@ -0,0 +1,99 @@
import { n as __toESM, t as require_binding } from "./binding-QUhP-0wQ.mjs";
import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./logs-Up1RAnkl.mjs";
//#region ../../node_modules/.pnpm/oxc-parser@0.107.0/node_modules/oxc-parser/src-js/wrap.js
function wrap$1(result) {
let program, module, comments, errors;
return {
get program() {
if (!program) program = jsonParseAst(result.program);
return program;
},
get module() {
if (!module) module = result.module;
return module;
},
get comments() {
if (!comments) comments = result.comments;
return comments;
},
get errors() {
if (!errors) errors = result.errors;
return errors;
}
};
}
function jsonParseAst(programJson) {
const { node: program, fixes } = JSON.parse(programJson);
for (const fixPath of fixes) applyFix(program, fixPath);
return program;
}
function applyFix(program, fixPath) {
let node = program;
for (const key of fixPath) node = node[key];
if (node.bigint) node.value = BigInt(node.bigint);
else try {
node.value = RegExp(node.regex.pattern, node.regex.flags);
} catch {}
}
//#endregion
//#region src/utils/parse.ts
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
/**
* Parse asynchronously.
*
* Note: This function can be slower than `parseSync` due to the overhead of spawning a thread.
*/
async function parse(filename, sourceText, options) {
return wrap$1(await (0, import_binding.parse)(filename, sourceText, options));
}
/** Parse synchronously. */
function parseSync(filename, sourceText, options) {
return wrap$1((0, import_binding.parseSync)(filename, sourceText, options));
}
//#endregion
//#region src/parse-ast-index.ts
function wrap(result, filename, sourceText) {
if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
return result.program;
}
function normalizeParseError(filename, sourceText, errors) {
let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
const pos = errors[0]?.labels?.[0]?.start;
for (let i = 0; i < errors.length; i++) {
if (i >= 5) {
message += "\n...";
break;
}
const e = errors[i];
message += e.message + "\n" + e.labels.map((label) => {
const location = locate(sourceText, label.start, { offsetLine: 1 });
if (!location) return;
return getCodeFrame(sourceText, location.line, location.column);
}).filter(Boolean).join("\n");
}
const log = logParseError(message, filename, pos);
if (pos !== void 0 && filename) augmentCodeLocation(log, pos, sourceText, filename);
return error(log);
}
const defaultParserOptions = {
lang: "js",
preserveParens: false
};
function parseAst(sourceText, options, filename) {
return wrap(parseSync(filename ?? "file.js", sourceText, {
...defaultParserOptions,
...options
}), filename, sourceText);
}
async function parseAstAsync(sourceText, options, filename) {
return wrap(await parse(filename ?? "file.js", sourceText, {
...defaultParserOptions,
...options
}), filename, sourceText);
}
//#endregion
export { parseSync as i, parseAstAsync as n, parse as r, parseAst as t };

847
node_modules/rolldown/dist/shared/prompt-CNt8OM9C.mjs generated vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,11 @@
import { l as PluginDriver, s as validateOption, t as RolldownBuild } from "./rolldown-build-ciWo5RN-.mjs";
//#region src/api/rolldown/index.ts
/** @category Programmatic APIs */
const rolldown = async (input) => {
validateOption("input", input);
return new RolldownBuild(await PluginDriver.callOptionsHook(input));
};
//#endregion
export { rolldown as t };

File diff suppressed because it is too large Load diff

352
node_modules/rolldown/dist/shared/watch-CN4zUkzW.mjs generated vendored Normal file
View file

@ -0,0 +1,352 @@
import { n as __toESM, t as require_binding } from "./binding-QUhP-0wQ.mjs";
import { o as logMultiplyNotifyOption } from "./logs-Up1RAnkl.mjs";
import { t as arraify } from "./misc-DpjTMcQQ.mjs";
import { E as LOG_LEVEL_WARN } from "./normalize-string-or-regex-DbyImenn.mjs";
import { l as PluginDriver, n as createBundlerOptions } from "./rolldown-build-ciWo5RN-.mjs";
import { a as aggregateBindingErrorsIntoJsError } from "./bindingify-input-options-CJ8NjPpl.mjs";
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
/**
* This is not the set of all possible signals.
*
* It IS, however, the set of all signals that trigger
* an exit on either Linux or BSD systems. Linux is a
* superset of the signal names supported on BSD, and
* the unknown signals just fail to register, so we can
* catch that easily enough.
*
* Windows signals are a different set, since there are
* signals that terminate Windows processes, but don't
* terminate (or don't even exist) on Posix systems.
*
* Don't bother with SIGKILL. It's uncatchable, which
* means that we can't fire any callbacks anyway.
*
* If a user does happen to register a handler on a non-
* fatal signal like SIGWINCH or something, and then
* exit, it'll end up firing `process.emit('exit')`, so
* the handler will be fired anyway.
*
* SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
* artificially, inherently leave the process in a
* state from which it is not safe to try and enter JS
* listeners.
*/
const signals = [];
signals.push("SIGHUP", "SIGINT", "SIGTERM");
if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
//#endregion
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
const processOk = (process$2) => !!process$2 && typeof process$2 === "object" && typeof process$2.removeListener === "function" && typeof process$2.emit === "function" && typeof process$2.reallyExit === "function" && typeof process$2.listeners === "function" && typeof process$2.kill === "function" && typeof process$2.pid === "number" && typeof process$2.on === "function";
const kExitEmitter = Symbol.for("signal-exit emitter");
const global = globalThis;
const ObjectDefineProperty = Object.defineProperty.bind(Object);
var Emitter = class {
emitted = {
afterExit: false,
exit: false
};
listeners = {
afterExit: [],
exit: []
};
count = 0;
id = Math.random();
constructor() {
if (global[kExitEmitter]) return global[kExitEmitter];
ObjectDefineProperty(global, kExitEmitter, {
value: this,
writable: false,
enumerable: false,
configurable: false
});
}
on(ev, fn) {
this.listeners[ev].push(fn);
}
removeListener(ev, fn) {
const list = this.listeners[ev];
const i = list.indexOf(fn);
/* c8 ignore start */
if (i === -1) return;
/* c8 ignore stop */
if (i === 0 && list.length === 1) list.length = 0;
else list.splice(i, 1);
}
emit(ev, code, signal) {
if (this.emitted[ev]) return false;
this.emitted[ev] = true;
let ret = false;
for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
return ret;
}
};
var SignalExitBase = class {};
const signalExitWrap = (handler) => {
return {
onExit(cb, opts) {
return handler.onExit(cb, opts);
},
load() {
return handler.load();
},
unload() {
return handler.unload();
}
};
};
var SignalExitFallback = class extends SignalExitBase {
onExit() {
return () => {};
}
load() {}
unload() {}
};
var SignalExit = class extends SignalExitBase {
/* c8 ignore start */
#hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
/* c8 ignore stop */
#emitter = new Emitter();
#process;
#originalProcessEmit;
#originalProcessReallyExit;
#sigListeners = {};
#loaded = false;
constructor(process$2) {
super();
this.#process = process$2;
this.#sigListeners = {};
for (const sig of signals) this.#sigListeners[sig] = () => {
const listeners = this.#process.listeners(sig);
let { count } = this.#emitter;
/* c8 ignore start */
const p = process$2;
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
/* c8 ignore stop */
if (listeners.length === count) {
this.unload();
const ret = this.#emitter.emit("exit", null, sig);
/* c8 ignore start */
const s = sig === "SIGHUP" ? this.#hupSig : sig;
if (!ret) process$2.kill(process$2.pid, s);
}
};
this.#originalProcessReallyExit = process$2.reallyExit;
this.#originalProcessEmit = process$2.emit;
}
onExit(cb, opts) {
/* c8 ignore start */
if (!processOk(this.#process)) return () => {};
/* c8 ignore stop */
if (this.#loaded === false) this.load();
const ev = opts?.alwaysLast ? "afterExit" : "exit";
this.#emitter.on(ev, cb);
return () => {
this.#emitter.removeListener(ev, cb);
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
};
}
load() {
if (this.#loaded) return;
this.#loaded = true;
this.#emitter.count += 1;
for (const sig of signals) try {
const fn = this.#sigListeners[sig];
if (fn) this.#process.on(sig, fn);
} catch (_) {}
this.#process.emit = (ev, ...a) => {
return this.#processEmit(ev, ...a);
};
this.#process.reallyExit = (code) => {
return this.#processReallyExit(code);
};
}
unload() {
if (!this.#loaded) return;
this.#loaded = false;
signals.forEach((sig) => {
const listener = this.#sigListeners[sig];
/* c8 ignore start */
if (!listener) throw new Error("Listener not defined for signal: " + sig);
/* c8 ignore stop */
try {
this.#process.removeListener(sig, listener);
} catch (_) {}
/* c8 ignore stop */
});
this.#process.emit = this.#originalProcessEmit;
this.#process.reallyExit = this.#originalProcessReallyExit;
this.#emitter.count -= 1;
}
#processReallyExit(code) {
/* c8 ignore start */
if (!processOk(this.#process)) return 0;
this.#process.exitCode = code || 0;
/* c8 ignore stop */
this.#emitter.emit("exit", this.#process.exitCode, null);
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
}
#processEmit(ev, ...args) {
const og = this.#originalProcessEmit;
if (ev === "exit" && processOk(this.#process)) {
if (typeof args[0] === "number") this.#process.exitCode = args[0];
/* c8 ignore start */
const ret = og.call(this.#process, ev, ...args);
/* c8 ignore start */
this.#emitter.emit("exit", this.#process.exitCode, null);
/* c8 ignore stop */
return ret;
} else return og.call(this.#process, ev, ...args);
}
};
const process$1 = globalThis.process;
const { onExit: onExit$1, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
//#endregion
//#region src/utils/signal-exit.ts
function onExit(...args) {
if (typeof process === "object" && process.versions.webcontainer) {
process.on("exit", (code) => {
args[0](code, null);
});
return;
}
onExit$1(...args);
}
//#endregion
//#region src/api/watch/watch-emitter.ts
var WatcherEmitter = class {
listeners = /* @__PURE__ */ new Map();
timer;
constructor() {
this.timer = setInterval(() => {}, 1e9);
}
on(event, listener) {
const listeners = this.listeners.get(event);
if (listeners) listeners.push(listener);
else this.listeners.set(event, [listener]);
return this;
}
off(event, listener) {
const listeners = this.listeners.get(event);
if (listeners) {
const index = listeners.indexOf(listener);
if (index !== -1) listeners.splice(index, 1);
}
return this;
}
clear(event) {
if (this.listeners.has(event)) this.listeners.delete(event);
}
async onEvent(event) {
const listeners = this.listeners.get(event.eventKind());
if (listeners) switch (event.eventKind()) {
case "close":
case "restart":
for (const listener of listeners) await listener();
break;
case "event":
for (const listener of listeners) {
const code = event.bundleEventKind();
switch (code) {
case "BUNDLE_END":
const { duration, output, result } = event.bundleEndData();
await listener({
code: "BUNDLE_END",
duration,
output: [output],
result
});
break;
case "ERROR":
const data = event.bundleErrorData();
await listener({
code: "ERROR",
error: aggregateBindingErrorsIntoJsError(data.error),
result: data.result
});
break;
default:
await listener({ code });
break;
}
}
break;
case "change":
for (const listener of listeners) {
const { path, kind } = event.watchChangeData();
await listener(path, { event: kind });
}
break;
default: throw new Error(`Unknown event: ${event}`);
}
}
async close() {
clearInterval(this.timer);
}
};
//#endregion
//#region src/api/watch/watcher.ts
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
var Watcher = class {
closed;
inner;
emitter;
stopWorkers;
constructor(emitter, inner, stopWorkers) {
this.closed = false;
this.inner = inner;
this.emitter = emitter;
const originClose = emitter.close.bind(emitter);
emitter.close = async () => {
await this.close();
originClose();
};
this.stopWorkers = stopWorkers;
}
async close() {
if (this.closed) return;
this.closed = true;
for (const stop of this.stopWorkers) await stop?.();
await this.inner.close();
(0, import_binding.shutdownAsyncRuntime)();
}
start() {
process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
}
};
async function createWatcher(emitter, input) {
const options = arraify(input);
const bundlerOptions = await Promise.all(options.map((option) => arraify(option.output || {}).map(async (output) => {
return createBundlerOptions(await PluginDriver.callOptionsHook(option, true), output, true);
})).flat());
const notifyOptions = getValidNotifyOption(bundlerOptions);
new Watcher(emitter, new import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions), bundlerOptions.map((option) => option.stopWorkers)).start();
}
function getValidNotifyOption(bundlerOptions) {
let result;
for (const option of bundlerOptions) if (option.inputOptions.watch) {
const notifyOption = option.inputOptions.watch.notify;
if (notifyOption) if (result) {
option.onLog(LOG_LEVEL_WARN, logMultiplyNotifyOption());
return result;
} else result = notifyOption;
}
}
//#endregion
//#region src/api/watch/index.ts
/** @category Programmatic APIs */
const watch = (input) => {
const emitter = new WatcherEmitter();
createWatcher(emitter, input);
return emitter;
};
//#endregion
export { onExit as n, watch as t };

145
node_modules/rolldown/package.json generated vendored Normal file
View file

@ -0,0 +1,145 @@
{
"name": "rolldown",
"version": "1.0.0-beta.59",
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
"keywords": [
"bundler",
"esbuild",
"parcel",
"rolldown",
"rollup",
"webpack"
],
"homepage": "https://rolldown.rs/",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/rolldown/rolldown.git",
"directory": "packages/rolldown"
},
"bin": {
"rolldown": "./bin/cli.mjs"
},
"files": [
"bin",
"cli",
"dist",
"!dist/*.node"
],
"type": "module",
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.mts",
"imports": {
"#parallel-plugin-worker": "./dist/parallel-plugin-worker.mjs"
},
"exports": {
".": "./dist/index.mjs",
"./config": "./dist/config.mjs",
"./experimental": "./dist/experimental-index.mjs",
"./experimental/runtime-types": {
"types": "./dist/experimental-runtime-types.d.ts"
},
"./filter": "./dist/filter-index.mjs",
"./getLogFilter": "./dist/get-log-filter.mjs",
"./parallelPlugin": "./dist/parallel-plugin.mjs",
"./parseAst": "./dist/parse-ast-index.mjs",
"./package.json": "./package.json",
"./plugins": "./dist/plugins-index.mjs"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"dependencies": {
"@oxc-project/types": "=0.107.0",
"@rolldown/pluginutils": "1.0.0-beta.59"
},
"devDependencies": {
"@napi-rs/cli": "^3.4.1",
"@napi-rs/wasm-runtime": "^1.0.0",
"@oxc-node/cli": "^0.0.35",
"@rollup/plugin-json": "^6.1.0",
"buble": "^0.20.0",
"consola": "^3.4.2",
"execa": "^9.2.0",
"glob": "^13.0.0",
"oxc-parser": "=0.107.0",
"pathe": "^2.0.3",
"remeda": "^2.10.0",
"rolldown-plugin-dts": "^0.20.0",
"rollup": "^4.18.0",
"signal-exit": "4.1.0",
"source-map": "^0.7.6",
"typescript": "^5.8.3",
"valibot": "1.2.0",
"rolldown": "1.0.0-beta.59"
},
"napi": {
"binaryName": "rolldown-binding",
"dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\ntype BindingResult<T> = { errors: BindingError[], isBindingErrors: boolean } | T\n\n",
"packageName": "@rolldown/binding",
"targets": [
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
"x86_64-unknown-freebsd",
"armv7-unknown-linux-gnueabihf",
"aarch64-unknown-linux-gnu",
"aarch64-apple-darwin",
"aarch64-unknown-linux-musl",
"aarch64-unknown-linux-ohos",
"aarch64-pc-windows-msvc",
"aarch64-linux-android",
"wasm32-wasip1-threads"
],
"wasm": {
"initialMemory": 16384,
"browser": {
"fs": true,
"asyncInit": true
}
}
},
"engines": {
"node": "^20.19.0 || >=22.12.0"
},
"optionalDependencies": {
"@rolldown/binding-darwin-x64": "1.0.0-beta.59",
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.59",
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.59",
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.59",
"@rolldown/binding-freebsd-x64": "1.0.0-beta.59",
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.59",
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.59",
"@rolldown/binding-darwin-arm64": "1.0.0-beta.59",
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.59",
"@rolldown/binding-openharmony-arm64": "1.0.0-beta.59",
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.59",
"@rolldown/binding-android-arm64": "1.0.0-beta.59",
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.59"
},
"scripts": {
"# Scrips for binding #": "_",
"artifacts": "napi artifacts --cwd ./src --package-json-path ../package.json -o=../artifacts --npm-dir ../npm",
"build-binding": "oxnode ./build-binding.ts",
"build-binding:release": "pnpm build-binding --release",
"build-binding:profile": "pnpm build-binding --profile profile",
"build-binding:wasi": "pnpm build-binding --target wasm32-wasip1-threads",
"build-binding:wasi:release": "pnpm build-binding --profile release-wasi --target wasm32-wasip1-threads",
"# Scrips for node #": "_",
"build-node": "oxnode -C dev ./build.ts",
"build-types-check": "tsc -p ./tsconfig.check.json",
"build-js-glue": "pnpm run --sequential '/^build-(node|types-check)$/'",
"build-native:debug": "pnpm run --sequential '/^build-(binding|js-glue)$/'",
"build-native:release": "pnpm run --sequential '/^build-(binding:release|js-glue)$/'",
"build-native:profile": "pnpm run build-binding:profile && pnpm run build-js-glue",
"build-native:memory-profile": "pnpm run build-binding:profile --features default_global_allocator && pnpm run build-js-glue",
"build-wasi:debug": "TARGET='rolldown-wasi' pnpm run --sequential '/^build-(binding|binding:wasi|node)$/'",
"build-wasi:release": "TARGET='rolldown-wasi' pnpm run --sequential '/^build-(binding|binding:wasi:release|node)$/'",
"build-browser-pkg:debug": "TARGET='browser' pnpm run --sequential '/^build-(binding|binding:wasi|node)$/'",
"build-browser-pkg:release": "TARGET='browser' pnpm run --sequential '/^build-(binding|binding:wasi:release|node)$/'",
"# Scrips for docs #": "_"
}
}