rolldown 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/prompt.cjs +6 -1
- package/dist/chunks/prompt.cjs.map +1 -1
- package/dist/chunks/prompt.mjs +6 -1
- package/dist/chunks/prompt.mjs.map +1 -1
- package/dist/cli.cjs +7 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +7 -2
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +13 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1099
- package/dist/index.d.mts +10 -1099
- package/dist/index.d.ts +10 -1099
- package/dist/index.mjs +13 -2
- package/dist/index.mjs.map +1 -1
- package/dist/parallel-plugin-worker.cjs +34 -0
- package/dist/parallel-plugin-worker.cjs.map +1 -0
- package/dist/parallel-plugin-worker.d.cts +2 -0
- package/dist/parallel-plugin-worker.d.mts +2 -0
- package/dist/parallel-plugin-worker.d.ts +2 -0
- package/dist/parallel-plugin-worker.mjs +32 -0
- package/dist/parallel-plugin-worker.mjs.map +1 -0
- package/dist/parallel-plugin.cjs +8 -0
- package/dist/parallel-plugin.cjs.map +1 -0
- package/dist/parallel-plugin.d.cts +12 -0
- package/dist/parallel-plugin.d.mts +12 -0
- package/dist/parallel-plugin.d.ts +12 -0
- package/dist/parallel-plugin.mjs +6 -0
- package/dist/parallel-plugin.mjs.map +1 -0
- package/dist/shared/rolldown-binding.wasi.cjs +109 -0
- package/dist/shared/rolldown.1ea1dc1e.d.cts +1160 -0
- package/dist/shared/rolldown.1ea1dc1e.d.mts +1160 -0
- package/dist/shared/rolldown.1ea1dc1e.d.ts +1160 -0
- package/dist/shared/rolldown.4d4592d7.cjs +348 -0
- package/dist/shared/rolldown.4d4592d7.cjs.map +1 -0
- package/dist/shared/{rolldown.ee864e8d.cjs → rolldown.65028ebe.cjs} +126 -307
- package/dist/shared/rolldown.65028ebe.cjs.map +1 -0
- package/dist/shared/{rolldown.04482f71.mjs → rolldown.7d1ce9fc.mjs} +122 -304
- package/dist/shared/rolldown.7d1ce9fc.mjs.map +1 -0
- package/dist/shared/rolldown.b914368a.mjs +340 -0
- package/dist/shared/rolldown.b914368a.mjs.map +1 -0
- package/dist/shared/wasi-worker-browser.mjs +40 -0
- package/dist/shared/wasi-worker.mjs +60 -0
- package/package.json +41 -21
- package/dist/shared/rolldown.04482f71.mjs.map +0 -1
- package/dist/shared/rolldown.ee864e8d.cjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rolldown.04482f71.mjs","sources":["../../src/utils/async-flatten.ts","../../src/utils/transform-to-rollup-output.ts","../../src/utils/normalize-plugin-option.ts","../../src/utils/ensure-array.ts","../../src/binding.js","../../src/options/input-options.ts","../../src/utils/normalize-hook.ts","../../src/plugin/bindingify-build-hooks.ts","../../src/plugin/bindingify-output-hooks.ts","../../src/plugin/bindingify-plugin.ts","../../src/options/input-options-adapter.ts","../../src/options/output-options.ts","../../src/utils/create-bundler.ts","../../src/utils/index.ts","../../src/rolldown-build.ts","../../src/rolldown.ts"],"sourcesContent":["// Copied from https://github.com/rollup/rollup/blob/3b560f7c889a63968dabc9b6970aabf52a77d3fd/src/utils/asyncFlatten.ts\n\nexport async function asyncFlatten<T>(array: T[]): Promise<T[]> {\n do {\n array = (await Promise.all(array)).flat(Infinity) as any\n } while (array.some((v: any) => v?.then))\n return array\n}\n","import {\n RolldownOutput,\n RolldownOutputAsset,\n RolldownOutputChunk,\n} from '../types/rolldown-output'\nimport { OutputBundle } from '../types/output-bundle'\nimport {\n BindingOutputAsset,\n BindingOutputChunk,\n BindingOutputs,\n} from '../binding'\n\nfunction transformToRollupOutputChunk(\n chunk: BindingOutputChunk,\n): RolldownOutputChunk {\n return {\n type: 'chunk',\n get code() {\n return chunk.code\n },\n fileName: chunk.fileName,\n get modules() {\n return Object.fromEntries(\n Object.entries(chunk.modules).map(([key, _]) => [key, {}]),\n )\n },\n exports: chunk.exports,\n isEntry: chunk.isEntry,\n facadeModuleId: chunk.facadeModuleId || null,\n isDynamicEntry: chunk.isDynamicEntry,\n get moduleIds() {\n return chunk.moduleIds\n },\n get map() {\n return chunk.map ? JSON.parse(chunk.map) : null\n },\n sourcemapFileName: chunk.sourcemapFileName || null,\n }\n}\n\nfunction transformToRollupOutputAsset(\n asset: BindingOutputAsset,\n): RolldownOutputAsset {\n return {\n type: 'asset',\n fileName: asset.fileName,\n get source() {\n return asset.source\n },\n }\n}\n\nexport function transformToRollupOutput(\n output: BindingOutputs,\n): RolldownOutput {\n const { chunks, assets } = output\n const [firstChunk, ...restChunks] = chunks\n return {\n output: [\n transformToRollupOutputChunk(firstChunk),\n ...restChunks.map(transformToRollupOutputChunk),\n ...assets.map(transformToRollupOutputAsset),\n ],\n }\n}\n\nexport function transformToOutputBundle(output: BindingOutputs): OutputBundle {\n return Object.fromEntries(\n transformToRollupOutput(output).output.map((item) => [item.fileName, item]),\n )\n}\n","import type {\n InputOptions,\n OutputOptions,\n Plugin,\n OutputPlugin,\n} from '../rollup-types'\nimport { asyncFlatten } from './async-flatten'\n\nexport const normalizePluginOption: {\n (plugins: InputOptions['plugins']): Promise<Plugin[]>\n (plugins: OutputOptions['plugins']): Promise<OutputPlugin[]>\n (plugins: unknown): Promise<any[]>\n} = async (plugins: any) => (await asyncFlatten([plugins])).filter(Boolean)\n","export function ensureArray<T>(\n items: (T | false | null | undefined)[] | T | false | null | undefined,\n): T[] {\n if (Array.isArray(items)) {\n return items.filter(Boolean) as T[]\n }\n if (items) {\n return [items]\n }\n return []\n}\n","// prettier-ignore\n/* eslint-disable */\n/* auto-generated by NAPI-RS */\n\nconst { readFileSync } = require('fs')\n\nlet nativeBinding = null\nconst loadErrors = []\n\nconst isMusl = () => {\n let musl = false\n if (process.platform === 'linux') {\n musl = isMuslFromFilesystem()\n if (musl === null) {\n musl = isMuslFromReport()\n }\n if (musl === null) {\n musl = isMuslFromChildProcess()\n }\n }\n return musl\n}\n\nconst isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')\n\nconst isMuslFromFilesystem = () => {\n try {\n return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')\n } catch {\n return null\n }\n}\n\nconst isMuslFromReport = () => {\n const report =\n typeof process.report.getReport === 'function'\n ? process.report.getReport()\n : null\n if (!report) {\n return null\n }\n if (report.header && report.header.glibcVersionRuntime) {\n return false\n }\n if (Array.isArray(report.sharedObjects)) {\n if (report.sharedObjects.some(isFileMusl)) {\n return true\n }\n }\n return false\n}\n\nconst isMuslFromChildProcess = () => {\n try {\n return require('child_process')\n .execSync('ldd --version', { encoding: 'utf8' })\n .includes('musl')\n } catch (e) {\n // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false\n return false\n }\n}\n\nfunction requireNative() {\n if (process.platform === 'android') {\n if (process.arch === 'arm64') {\n try {\n return require('./rolldown-binding.android-arm64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-android-arm64')\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm') {\n try {\n return require('./rolldown-binding.android-arm-eabi.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-android-arm-eabi')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(\n new Error(`Unsupported architecture on Android ${process.arch}`),\n )\n }\n } else if (process.platform === 'win32') {\n if (process.arch === 'x64') {\n try {\n return require('./rolldown-binding.win32-x64-msvc.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-win32-x64-msvc')\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'ia32') {\n try {\n return require('./rolldown-binding.win32-ia32-msvc.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-win32-ia32-msvc')\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm64') {\n try {\n return require('./rolldown-binding.win32-arm64-msvc.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-win32-arm64-msvc')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(\n new Error(`Unsupported architecture on Windows: ${process.arch}`),\n )\n }\n } else if (process.platform === 'darwin') {\n try {\n return require('./rolldown-binding.darwin-universal.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-darwin-universal')\n } catch (e) {\n loadErrors.push(e)\n }\n\n if (process.arch === 'x64') {\n try {\n return require('./rolldown-binding.darwin-x64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-darwin-x64')\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm64') {\n try {\n return require('./rolldown-binding.darwin-arm64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-darwin-arm64')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(\n new Error(`Unsupported architecture on macOS: ${process.arch}`),\n )\n }\n } else if (process.platform === 'freebsd') {\n if (process.arch === 'x64') {\n try {\n return require('./rolldown-binding.freebsd-x64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-freebsd-x64')\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm64') {\n try {\n return require('./rolldown-binding.freebsd-arm64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-freebsd-arm64')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(\n new Error(`Unsupported architecture on FreeBSD: ${process.arch}`),\n )\n }\n } else if (process.platform === 'linux') {\n if (process.arch === 'x64') {\n if (isMusl()) {\n try {\n return require('./rolldown-binding.linux-x64-musl.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-x64-musl')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n try {\n return require('./rolldown-binding.linux-x64-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-x64-gnu')\n } catch (e) {\n loadErrors.push(e)\n }\n }\n } else if (process.arch === 'arm64') {\n if (isMusl()) {\n try {\n return require('./rolldown-binding.linux-arm64-musl.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-arm64-musl')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n try {\n return require('./rolldown-binding.linux-arm64-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-arm64-gnu')\n } catch (e) {\n loadErrors.push(e)\n }\n }\n } else if (process.arch === 'arm') {\n try {\n return require('./rolldown-binding.linux-arm-gnueabihf.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-arm-gnueabihf')\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'riscv64') {\n if (isMusl()) {\n try {\n return require('./rolldown-binding.linux-riscv64-musl.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-riscv64-musl')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n try {\n return require('./rolldown-binding.linux-riscv64-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-riscv64-gnu')\n } catch (e) {\n loadErrors.push(e)\n }\n }\n } else if (process.arch === 's390x') {\n try {\n return require('./rolldown-binding.linux-s390x-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-s390x-gnu')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(\n new Error(`Unsupported architecture on Linux: ${process.arch}`),\n )\n }\n } else {\n loadErrors.push(\n new Error(\n `Unsupported OS: ${process.platform}, architecture: ${process.arch}`,\n ),\n )\n }\n}\n\nnativeBinding = requireNative()\n\nif (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {\n try {\n nativeBinding = require('./rolldown-binding.wasi.cjs')\n } catch (err) {\n if (process.env.NAPI_RS_FORCE_WASI) {\n console.error(err)\n }\n }\n if (!nativeBinding) {\n try {\n nativeBinding = require('@rolldown/binding-wasm32-wasi')\n } catch (err) {\n if (process.env.NAPI_RS_FORCE_WASI) {\n console.error(err)\n }\n }\n }\n}\n\nif (!nativeBinding) {\n if (loadErrors.length > 0) {\n // TODO Link to documentation with potential fixes\n // - The package owner could build/publish bindings for this arch\n // - The user may need to bundle the correct files\n // - The user may need to re-install node_modules to get new packages\n throw new Error('Failed to load native binding', { cause: loadErrors })\n }\n throw new Error(`Failed to load native binding`)\n}\n\nmodule.exports.BindingOutputAsset = nativeBinding.BindingOutputAsset\nmodule.exports.BindingOutputChunk = nativeBinding.BindingOutputChunk\nmodule.exports.BindingOutputs = nativeBinding.BindingOutputs\nmodule.exports.BindingPluginContext = nativeBinding.BindingPluginContext\nmodule.exports.Bundler = nativeBinding.Bundler\n","import {\n NormalizedInputOptions,\n InputOptions as RollupInputOptions,\n} from '../rollup-types'\nimport { ensureArray, normalizePluginOption } from '../utils'\nimport { BindingResolveOptions } from '../binding'\nimport { Plugin } from '../plugin'\n\n// TODO export compat plugin type\nexport interface InputOptions {\n input?: RollupInputOptions['input']\n plugins?: Plugin[]\n external?: RollupInputOptions['external']\n resolve?: RolldownResolveOptions\n cwd?: string\n}\n\nexport type RolldownResolveOptions = Omit<BindingResolveOptions, 'alias'> & {\n alias?: Record<string, string>\n}\n\nexport type RolldownNormalizedInputOptions = NormalizedInputOptions & {\n resolve?: BindingResolveOptions\n}\n\nexport async function normalizeInputOptions(\n config: InputOptions,\n): Promise<RolldownNormalizedInputOptions> {\n // @ts-expect-error\n return {\n input: getInput(config),\n plugins: await normalizePluginOption(config.plugins),\n external: getIdMatcher(config.external),\n resolve: getResolve(config.resolve),\n }\n}\n\nfunction getInput(config: InputOptions): NormalizedInputOptions['input'] {\n const configInput = config.input\n return configInput == null\n ? []\n : typeof configInput === 'string'\n ? [configInput]\n : configInput\n}\n\nconst getIdMatcher = <T extends Array<any>>(\n option:\n | undefined\n // | boolean\n | string\n | RegExp\n | (string | RegExp)[]\n | ((id: string, ...parameters: T) => boolean | null | void),\n): ((id: string, ...parameters: T) => boolean) => {\n // if (option === true) {\n // \treturn () => true;\n // }\n if (typeof option === 'function') {\n return (id, ...parameters) =>\n (!id.startsWith('\\0') && option(id, ...parameters)) || false\n }\n if (option) {\n const ids = new Set<string>()\n const matchers: RegExp[] = []\n for (const value of ensureArray(option)) {\n if (value instanceof RegExp) {\n matchers.push(value)\n } else {\n ids.add(value)\n }\n }\n return (id: string, ..._arguments) =>\n ids.has(id) || matchers.some((matcher) => matcher.test(id))\n }\n // Rollup here convert `undefined` to function, it is bad for performance. So it will convert to `undefined` at adapter.\n return () => false\n}\n\nfunction getResolve(\n resolve?: RolldownResolveOptions,\n): RolldownNormalizedInputOptions['resolve'] {\n if (resolve) {\n return {\n ...resolve,\n alias: resolve.alias\n ? Object.fromEntries(\n Object.entries(resolve.alias).map(([key, value]) => [key, [value]]),\n )\n : undefined,\n }\n }\n}\n","import type { Hook } from '../plugin'\nimport type { AnyFn, AnyObj } from '../types/utils'\n\ntype NotFn<T> = T extends AnyFn ? never : T\n\nexport function normalizeHook<H extends Hook<AnyFn, AnyObj>>(\n hook: H,\n): H extends Hook<infer Handler, infer Options>\n ? [Handler, NotFn<Options>]\n : never {\n if (typeof hook === 'function') {\n // @ts-expect-error\n return [hook, {}]\n }\n const { handler, ...options } = hook\n\n // @ts-expect-error\n return [handler, options]\n}\n","import { normalizeHook } from '../utils/normalize-hook'\nimport type { BindingPluginOptions } from '../binding'\n\nimport type { Plugin } from './index'\nimport { RolldownNormalizedInputOptions } from '../options/input-options'\n\nexport function bindingifyBuildStart(\n options: RolldownNormalizedInputOptions,\n hook?: Plugin['buildStart'],\n): BindingPluginOptions['buildStart'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (ctx) => {\n handler.call(ctx, options)\n }\n}\n\nexport function bindingifyBuildEnd(\n hook?: Plugin['buildEnd'],\n): BindingPluginOptions['buildEnd'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (err) => {\n try {\n handler.call(null, err ?? undefined)\n } catch (error) {\n console.error(error)\n }\n }\n}\n\nexport function bindingifyResolveId(\n hook?: Plugin['resolveId'],\n): BindingPluginOptions['resolveId'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (specifier, importer, options) => {\n const ret = await handler.call(\n null,\n specifier,\n importer ?? undefined,\n options,\n )\n if (ret == false || ret == null) {\n return\n }\n if (typeof ret === 'string') {\n return {\n id: ret,\n }\n }\n return ret\n }\n}\n\nexport function bindingifyTransform(\n hook?: Plugin['transform'],\n): BindingPluginOptions['transform'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (code, id) => {\n const ret = await handler.call(null, code, id)\n\n if (ret == null) {\n return\n }\n\n const retCode = typeof ret === 'string' ? ret : ret.code\n const retMap = typeof ret === 'string' ? undefined : ret.map\n\n return {\n code: retCode,\n map: retMap ?? undefined,\n }\n }\n}\n\nexport function bindingifyLoad(\n hook?: Plugin['load'],\n): BindingPluginOptions['load'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (id) => {\n const ret = await handler.call(null, id)\n\n if (ret == null) {\n return\n }\n\n const retCode = typeof ret === 'string' ? ret : ret.code\n const retMap = typeof ret === 'string' ? undefined : ret.map\n\n return {\n code: retCode,\n map: retMap ?? undefined,\n }\n }\n}\n\nexport function bindingifyRenderChunk(\n hook?: Plugin['renderChunk'],\n): BindingPluginOptions['renderChunk'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (code, chunk) => {\n const ret = await handler.call(null, code, chunk)\n\n if (ret == null) {\n return\n }\n\n return {\n code: ret,\n }\n }\n}\n","import { normalizeHook } from '../utils/normalize-hook'\nimport type { BindingPluginOptions } from '../binding'\n\nimport type { Plugin } from './index'\n\nexport function bindingifyGenerateBundle(\n hook?: Plugin['generateBundle'],\n): BindingPluginOptions['generateBundle'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (bundle, isWrite) => {\n handler.call(null, bundle, isWrite)\n }\n}\nexport function bindingifyWriteBundle(\n hook?: Plugin['writeBundle'],\n): BindingPluginOptions['writeBundle'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (bundle) => {\n handler.call(null, bundle)\n }\n}\n","import type { BindingPluginOptions } from '../binding'\nimport {\n bindingifyBuildEnd,\n bindingifyBuildStart,\n bindingifyLoad,\n bindingifyRenderChunk,\n bindingifyResolveId,\n bindingifyTransform,\n} from './bindingify-build-hooks'\n\nimport {\n bindingifyGenerateBundle,\n bindingifyWriteBundle,\n} from './bindingify-output-hooks'\n\nimport type { Plugin } from './index'\nimport { RolldownNormalizedInputOptions } from '../options/input-options'\n\n// Note: because napi not catch error, so we need to catch error and print error to debugger in adapter.\nexport function bindingifyPlugin(\n plugin: Plugin,\n options: RolldownNormalizedInputOptions,\n): BindingPluginOptions {\n return {\n name: plugin.name ?? 'unknown',\n buildStart: bindingifyBuildStart(options, plugin.buildStart),\n resolveId: bindingifyResolveId(plugin.resolveId),\n buildEnd: bindingifyBuildEnd(plugin.buildEnd),\n transform: bindingifyTransform(plugin.transform),\n load: bindingifyLoad(plugin.load),\n renderChunk: bindingifyRenderChunk(plugin.renderChunk),\n generateBundle: bindingifyGenerateBundle(plugin.generateBundle),\n writeBundle: bindingifyWriteBundle(plugin.writeBundle),\n }\n}\n","import { NormalizedInputOptions } from '../rollup-types'\nimport { BindingInputOptions } from '../binding'\nimport nodePath from 'node:path'\nimport { bindingifyPlugin } from '../plugin/bindingify-plugin'\nimport { InputOptions, RolldownNormalizedInputOptions } from './input-options'\n\nexport function createInputOptionsAdapter(\n options: RolldownNormalizedInputOptions,\n inputOptions: InputOptions,\n): BindingInputOptions {\n return {\n input: normalizeInput(options.input),\n plugins: options.plugins.map((plugin) =>\n // @ts-expect-error\n bindingifyPlugin(plugin, options),\n ),\n cwd: inputOptions.cwd ?? process.cwd(),\n external: inputOptions.external ? options.external : undefined,\n resolve: options.resolve,\n }\n}\n\nfunction normalizeInput(\n input: NormalizedInputOptions['input'],\n): BindingInputOptions['input'] {\n if (Array.isArray(input)) {\n return input.map((src) => {\n const name = nodePath.parse(src).name\n return {\n name,\n import: src,\n }\n })\n } else {\n return Object.entries(input).map((value) => {\n return { name: value[0], import: value[1] }\n })\n }\n}\n","import { OutputOptions as RollupOutputOptions } from '../rollup-types'\nimport { BindingOutputOptions } from '../binding'\nimport { unimplemented } from '../utils'\n\nexport interface OutputOptions {\n dir?: RollupOutputOptions['dir']\n format?: 'es'\n exports?: RollupOutputOptions['exports']\n sourcemap?: RollupOutputOptions['sourcemap']\n banner?: RollupOutputOptions['banner']\n footer?: RollupOutputOptions['footer']\n}\n\nfunction normalizeFormat(\n format: OutputOptions['format'],\n): BindingOutputOptions['format'] {\n if (format == null || format === 'es' || format === 'cjs') {\n return format\n } else {\n return unimplemented(`output.format: ${format}`)\n }\n}\n\nfunction normalizeSourcemap(\n sourcemap: OutputOptions['sourcemap'],\n): BindingOutputOptions['sourcemap'] {\n switch (sourcemap) {\n case true:\n return 'file'\n\n case 'inline':\n return 'inline'\n\n case false:\n case undefined:\n case 'hidden':\n return 'hidden'\n\n default:\n throw new Error(`unknown sourcemap: ${sourcemap}`)\n }\n}\n\nconst getAddon = <T extends 'banner' | 'footer'>(\n config: OutputOptions,\n name: T,\n): BindingOutputOptions[T] => {\n const configAddon = config[name]\n if (configAddon === undefined) return undefined\n if (typeof configAddon === 'function') {\n return configAddon as BindingOutputOptions[T]\n }\n return () => configAddon || ''\n}\n\nexport function normalizeOutputOptions(\n opts: OutputOptions,\n): BindingOutputOptions {\n const { dir, format, exports, sourcemap } = opts\n return {\n dir: dir,\n format: normalizeFormat(format),\n exports,\n sourcemap: normalizeSourcemap(sourcemap),\n plugins: [],\n banner: getAddon(opts, 'banner'),\n footer: getAddon(opts, 'footer'),\n }\n}\n","import { Bundler } from '../binding'\nimport {\n normalizeInputOptions,\n type InputOptions,\n} from '../options/input-options'\nimport { createInputOptionsAdapter } from '../options/input-options-adapter'\nimport {\n OutputOptions,\n normalizeOutputOptions,\n} from '../options/output-options'\n\nexport async function createBundler(\n inputOptions: InputOptions,\n outputOptions: OutputOptions,\n): Promise<Bundler> {\n // Convert `InputOptions` to `NormalizedInputOptions`.\n const normalizedInputOptions = await normalizeInputOptions(inputOptions)\n // Convert `NormalizedInputOptions` to `BindingInputOptions`\n const bindingInputOptions = createInputOptionsAdapter(\n normalizedInputOptions,\n inputOptions,\n )\n return new Bundler(bindingInputOptions, normalizeOutputOptions(outputOptions))\n}\n","export * from './async-flatten'\nexport * from './transform-to-rollup-output'\nexport * from './normalize-plugin-option'\nexport * from './ensure-array'\nexport * from './create-bundler'\nexport * from './transform-sourcemap'\n\nexport function arraify<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value]\n}\n\nexport function unimplemented(info?: string): never {\n if (info) {\n throw new Error(`unimplemented: ${info}`)\n }\n throw new Error('unimplemented')\n}\n\nexport function unreachable(info?: string): never {\n if (info) {\n throw new Error(`unreachable: ${info}`)\n }\n throw new Error('unreachable')\n}\n\nexport function noop(..._args: any[]) {}\n","import { Bundler } from './binding'\nimport { normalizeOutputOptions, OutputOptions } from './options/output-options'\nimport { createBundler, transformToRollupOutput, unimplemented } from './utils'\nimport { RolldownOutput } from './types/rolldown-output'\nimport { HasProperty, TypeAssert } from './utils/type-assert'\nimport { InputOptions } from './options/input-options'\n\nexport class RolldownBuild {\n #inputOptions: InputOptions\n #bundler?: Bundler\n\n constructor(inputOptions: InputOptions) {\n // TODO: Check if `inputOptions.output` is set. If so, throw an warning that it is ignored.\n this.#inputOptions = inputOptions\n }\n\n async #getBundler(outputOptions: OutputOptions): Promise<Bundler> {\n if (typeof this.#bundler === 'undefined') {\n this.#bundler = await createBundler(this.#inputOptions, outputOptions)\n }\n return this.#bundler\n }\n\n async generate(outputOptions: OutputOptions = {}): Promise<RolldownOutput> {\n const bundler = await this.#getBundler(outputOptions)\n const output = await bundler.generate()\n return transformToRollupOutput(output)\n }\n\n async write(outputOptions: OutputOptions = {}): Promise<RolldownOutput> {\n const bundler = await this.#getBundler(outputOptions)\n const output = await bundler.write()\n return transformToRollupOutput(output)\n }\n}\n\nfunction _assert() {\n type _ = TypeAssert<HasProperty<RolldownBuild, 'generate' | 'write'>>\n}\n","import { InputOptions } from './options/input-options'\nimport { RolldownBuild } from './rolldown-build'\nimport { createBundler } from './utils'\n\n// Compat to `rollup.rollup`, it is included scan module graph and linker.\nexport const rolldown = async (input: InputOptions): Promise<RolldownBuild> => {\n return new RolldownBuild(input)\n}\n\n/**\n * @description\n * This is an experimental API. It's behavior may change in the future.\n * Calling this API will only execute the scan stage of rolldown.\n */\nexport const experimental_scan = async (input: InputOptions): Promise<void> => {\n const bundler = await createBundler(input, {})\n await bundler.scan()\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAEA;AACE;AACE;AAAgD;AAElD;AACF;;ACKA;AAGE;AAAO;AACC;AAEJ;AAAa;AACf;AACgB;AAEd;AAAc;AAC6C;AAC3D;AACF;AACe;AACA;AACyB;AAClB;AAEpB;AAAa;AACf;AAEE;AAA2C;AAC7C;AAC8C;AAElD;AAEA;AAGE;AAAO;AACC;AACU;AAEd;AAAa;AACf;AAEJ;AAEO;AAGL;AACA;AACA;AAAO;AACG;AACiC;AACO;AACJ;AAC5C;AAEJ;;ACxDa;;ACRN;AAGL;AACE;AAA2B;AAE7B;AACE;AAAa;AAEf;AACF;;ACNA;AAEA;AACA;AAEA;AACE;AACA;AACE;AACA;AACE;AAAwB;AAE1B;AACE;AAA8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0 @@
|
|
|
1
|
-
{"version":3,"file":"rolldown.ee864e8d.cjs","sources":["../../src/utils/async-flatten.ts","../../src/utils/transform-to-rollup-output.ts","../../src/utils/normalize-plugin-option.ts","../../src/utils/ensure-array.ts","../../src/binding.js","../../src/options/input-options.ts","../../src/utils/normalize-hook.ts","../../src/plugin/bindingify-build-hooks.ts","../../src/plugin/bindingify-output-hooks.ts","../../src/plugin/bindingify-plugin.ts","../../src/options/input-options-adapter.ts","../../src/options/output-options.ts","../../src/utils/create-bundler.ts","../../src/utils/index.ts","../../src/rolldown-build.ts","../../src/rolldown.ts"],"sourcesContent":["// Copied from https://github.com/rollup/rollup/blob/3b560f7c889a63968dabc9b6970aabf52a77d3fd/src/utils/asyncFlatten.ts\n\nexport async function asyncFlatten<T>(array: T[]): Promise<T[]> {\n do {\n array = (await Promise.all(array)).flat(Infinity) as any\n } while (array.some((v: any) => v?.then))\n return array\n}\n","import {\n RolldownOutput,\n RolldownOutputAsset,\n RolldownOutputChunk,\n} from '../types/rolldown-output'\nimport { OutputBundle } from '../types/output-bundle'\nimport {\n BindingOutputAsset,\n BindingOutputChunk,\n BindingOutputs,\n} from '../binding'\n\nfunction transformToRollupOutputChunk(\n chunk: BindingOutputChunk,\n): RolldownOutputChunk {\n return {\n type: 'chunk',\n get code() {\n return chunk.code\n },\n fileName: chunk.fileName,\n get modules() {\n return Object.fromEntries(\n Object.entries(chunk.modules).map(([key, _]) => [key, {}]),\n )\n },\n exports: chunk.exports,\n isEntry: chunk.isEntry,\n facadeModuleId: chunk.facadeModuleId || null,\n isDynamicEntry: chunk.isDynamicEntry,\n get moduleIds() {\n return chunk.moduleIds\n },\n get map() {\n return chunk.map ? JSON.parse(chunk.map) : null\n },\n sourcemapFileName: chunk.sourcemapFileName || null,\n }\n}\n\nfunction transformToRollupOutputAsset(\n asset: BindingOutputAsset,\n): RolldownOutputAsset {\n return {\n type: 'asset',\n fileName: asset.fileName,\n get source() {\n return asset.source\n },\n }\n}\n\nexport function transformToRollupOutput(\n output: BindingOutputs,\n): RolldownOutput {\n const { chunks, assets } = output\n const [firstChunk, ...restChunks] = chunks\n return {\n output: [\n transformToRollupOutputChunk(firstChunk),\n ...restChunks.map(transformToRollupOutputChunk),\n ...assets.map(transformToRollupOutputAsset),\n ],\n }\n}\n\nexport function transformToOutputBundle(output: BindingOutputs): OutputBundle {\n return Object.fromEntries(\n transformToRollupOutput(output).output.map((item) => [item.fileName, item]),\n )\n}\n","import type {\n InputOptions,\n OutputOptions,\n Plugin,\n OutputPlugin,\n} from '../rollup-types'\nimport { asyncFlatten } from './async-flatten'\n\nexport const normalizePluginOption: {\n (plugins: InputOptions['plugins']): Promise<Plugin[]>\n (plugins: OutputOptions['plugins']): Promise<OutputPlugin[]>\n (plugins: unknown): Promise<any[]>\n} = async (plugins: any) => (await asyncFlatten([plugins])).filter(Boolean)\n","export function ensureArray<T>(\n items: (T | false | null | undefined)[] | T | false | null | undefined,\n): T[] {\n if (Array.isArray(items)) {\n return items.filter(Boolean) as T[]\n }\n if (items) {\n return [items]\n }\n return []\n}\n","// prettier-ignore\n/* eslint-disable */\n/* auto-generated by NAPI-RS */\n\nconst { readFileSync } = require('fs')\n\nlet nativeBinding = null\nconst loadErrors = []\n\nconst isMusl = () => {\n let musl = false\n if (process.platform === 'linux') {\n musl = isMuslFromFilesystem()\n if (musl === null) {\n musl = isMuslFromReport()\n }\n if (musl === null) {\n musl = isMuslFromChildProcess()\n }\n }\n return musl\n}\n\nconst isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')\n\nconst isMuslFromFilesystem = () => {\n try {\n return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')\n } catch {\n return null\n }\n}\n\nconst isMuslFromReport = () => {\n const report =\n typeof process.report.getReport === 'function'\n ? process.report.getReport()\n : null\n if (!report) {\n return null\n }\n if (report.header && report.header.glibcVersionRuntime) {\n return false\n }\n if (Array.isArray(report.sharedObjects)) {\n if (report.sharedObjects.some(isFileMusl)) {\n return true\n }\n }\n return false\n}\n\nconst isMuslFromChildProcess = () => {\n try {\n return require('child_process')\n .execSync('ldd --version', { encoding: 'utf8' })\n .includes('musl')\n } catch (e) {\n // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false\n return false\n }\n}\n\nfunction requireNative() {\n if (process.platform === 'android') {\n if (process.arch === 'arm64') {\n try {\n return require('./rolldown-binding.android-arm64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-android-arm64')\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm') {\n try {\n return require('./rolldown-binding.android-arm-eabi.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-android-arm-eabi')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(\n new Error(`Unsupported architecture on Android ${process.arch}`),\n )\n }\n } else if (process.platform === 'win32') {\n if (process.arch === 'x64') {\n try {\n return require('./rolldown-binding.win32-x64-msvc.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-win32-x64-msvc')\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'ia32') {\n try {\n return require('./rolldown-binding.win32-ia32-msvc.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-win32-ia32-msvc')\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm64') {\n try {\n return require('./rolldown-binding.win32-arm64-msvc.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-win32-arm64-msvc')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(\n new Error(`Unsupported architecture on Windows: ${process.arch}`),\n )\n }\n } else if (process.platform === 'darwin') {\n try {\n return require('./rolldown-binding.darwin-universal.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-darwin-universal')\n } catch (e) {\n loadErrors.push(e)\n }\n\n if (process.arch === 'x64') {\n try {\n return require('./rolldown-binding.darwin-x64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-darwin-x64')\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm64') {\n try {\n return require('./rolldown-binding.darwin-arm64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-darwin-arm64')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(\n new Error(`Unsupported architecture on macOS: ${process.arch}`),\n )\n }\n } else if (process.platform === 'freebsd') {\n if (process.arch === 'x64') {\n try {\n return require('./rolldown-binding.freebsd-x64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-freebsd-x64')\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm64') {\n try {\n return require('./rolldown-binding.freebsd-arm64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-freebsd-arm64')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(\n new Error(`Unsupported architecture on FreeBSD: ${process.arch}`),\n )\n }\n } else if (process.platform === 'linux') {\n if (process.arch === 'x64') {\n if (isMusl()) {\n try {\n return require('./rolldown-binding.linux-x64-musl.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-x64-musl')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n try {\n return require('./rolldown-binding.linux-x64-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-x64-gnu')\n } catch (e) {\n loadErrors.push(e)\n }\n }\n } else if (process.arch === 'arm64') {\n if (isMusl()) {\n try {\n return require('./rolldown-binding.linux-arm64-musl.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-arm64-musl')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n try {\n return require('./rolldown-binding.linux-arm64-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-arm64-gnu')\n } catch (e) {\n loadErrors.push(e)\n }\n }\n } else if (process.arch === 'arm') {\n try {\n return require('./rolldown-binding.linux-arm-gnueabihf.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-arm-gnueabihf')\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'riscv64') {\n if (isMusl()) {\n try {\n return require('./rolldown-binding.linux-riscv64-musl.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-riscv64-musl')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n try {\n return require('./rolldown-binding.linux-riscv64-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-riscv64-gnu')\n } catch (e) {\n loadErrors.push(e)\n }\n }\n } else if (process.arch === 's390x') {\n try {\n return require('./rolldown-binding.linux-s390x-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n return require('@rolldown/binding-linux-s390x-gnu')\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(\n new Error(`Unsupported architecture on Linux: ${process.arch}`),\n )\n }\n } else {\n loadErrors.push(\n new Error(\n `Unsupported OS: ${process.platform}, architecture: ${process.arch}`,\n ),\n )\n }\n}\n\nnativeBinding = requireNative()\n\nif (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {\n try {\n nativeBinding = require('./rolldown-binding.wasi.cjs')\n } catch (err) {\n if (process.env.NAPI_RS_FORCE_WASI) {\n console.error(err)\n }\n }\n if (!nativeBinding) {\n try {\n nativeBinding = require('@rolldown/binding-wasm32-wasi')\n } catch (err) {\n if (process.env.NAPI_RS_FORCE_WASI) {\n console.error(err)\n }\n }\n }\n}\n\nif (!nativeBinding) {\n if (loadErrors.length > 0) {\n // TODO Link to documentation with potential fixes\n // - The package owner could build/publish bindings for this arch\n // - The user may need to bundle the correct files\n // - The user may need to re-install node_modules to get new packages\n throw new Error('Failed to load native binding', { cause: loadErrors })\n }\n throw new Error(`Failed to load native binding`)\n}\n\nmodule.exports.BindingOutputAsset = nativeBinding.BindingOutputAsset\nmodule.exports.BindingOutputChunk = nativeBinding.BindingOutputChunk\nmodule.exports.BindingOutputs = nativeBinding.BindingOutputs\nmodule.exports.BindingPluginContext = nativeBinding.BindingPluginContext\nmodule.exports.Bundler = nativeBinding.Bundler\n","import {\n NormalizedInputOptions,\n InputOptions as RollupInputOptions,\n} from '../rollup-types'\nimport { ensureArray, normalizePluginOption } from '../utils'\nimport { BindingResolveOptions } from '../binding'\nimport { Plugin } from '../plugin'\n\n// TODO export compat plugin type\nexport interface InputOptions {\n input?: RollupInputOptions['input']\n plugins?: Plugin[]\n external?: RollupInputOptions['external']\n resolve?: RolldownResolveOptions\n cwd?: string\n}\n\nexport type RolldownResolveOptions = Omit<BindingResolveOptions, 'alias'> & {\n alias?: Record<string, string>\n}\n\nexport type RolldownNormalizedInputOptions = NormalizedInputOptions & {\n resolve?: BindingResolveOptions\n}\n\nexport async function normalizeInputOptions(\n config: InputOptions,\n): Promise<RolldownNormalizedInputOptions> {\n // @ts-expect-error\n return {\n input: getInput(config),\n plugins: await normalizePluginOption(config.plugins),\n external: getIdMatcher(config.external),\n resolve: getResolve(config.resolve),\n }\n}\n\nfunction getInput(config: InputOptions): NormalizedInputOptions['input'] {\n const configInput = config.input\n return configInput == null\n ? []\n : typeof configInput === 'string'\n ? [configInput]\n : configInput\n}\n\nconst getIdMatcher = <T extends Array<any>>(\n option:\n | undefined\n // | boolean\n | string\n | RegExp\n | (string | RegExp)[]\n | ((id: string, ...parameters: T) => boolean | null | void),\n): ((id: string, ...parameters: T) => boolean) => {\n // if (option === true) {\n // \treturn () => true;\n // }\n if (typeof option === 'function') {\n return (id, ...parameters) =>\n (!id.startsWith('\\0') && option(id, ...parameters)) || false\n }\n if (option) {\n const ids = new Set<string>()\n const matchers: RegExp[] = []\n for (const value of ensureArray(option)) {\n if (value instanceof RegExp) {\n matchers.push(value)\n } else {\n ids.add(value)\n }\n }\n return (id: string, ..._arguments) =>\n ids.has(id) || matchers.some((matcher) => matcher.test(id))\n }\n // Rollup here convert `undefined` to function, it is bad for performance. So it will convert to `undefined` at adapter.\n return () => false\n}\n\nfunction getResolve(\n resolve?: RolldownResolveOptions,\n): RolldownNormalizedInputOptions['resolve'] {\n if (resolve) {\n return {\n ...resolve,\n alias: resolve.alias\n ? Object.fromEntries(\n Object.entries(resolve.alias).map(([key, value]) => [key, [value]]),\n )\n : undefined,\n }\n }\n}\n","import type { Hook } from '../plugin'\nimport type { AnyFn, AnyObj } from '../types/utils'\n\ntype NotFn<T> = T extends AnyFn ? never : T\n\nexport function normalizeHook<H extends Hook<AnyFn, AnyObj>>(\n hook: H,\n): H extends Hook<infer Handler, infer Options>\n ? [Handler, NotFn<Options>]\n : never {\n if (typeof hook === 'function') {\n // @ts-expect-error\n return [hook, {}]\n }\n const { handler, ...options } = hook\n\n // @ts-expect-error\n return [handler, options]\n}\n","import { normalizeHook } from '../utils/normalize-hook'\nimport type { BindingPluginOptions } from '../binding'\n\nimport type { Plugin } from './index'\nimport { RolldownNormalizedInputOptions } from '../options/input-options'\n\nexport function bindingifyBuildStart(\n options: RolldownNormalizedInputOptions,\n hook?: Plugin['buildStart'],\n): BindingPluginOptions['buildStart'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (ctx) => {\n handler.call(ctx, options)\n }\n}\n\nexport function bindingifyBuildEnd(\n hook?: Plugin['buildEnd'],\n): BindingPluginOptions['buildEnd'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (err) => {\n try {\n handler.call(null, err ?? undefined)\n } catch (error) {\n console.error(error)\n }\n }\n}\n\nexport function bindingifyResolveId(\n hook?: Plugin['resolveId'],\n): BindingPluginOptions['resolveId'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (specifier, importer, options) => {\n const ret = await handler.call(\n null,\n specifier,\n importer ?? undefined,\n options,\n )\n if (ret == false || ret == null) {\n return\n }\n if (typeof ret === 'string') {\n return {\n id: ret,\n }\n }\n return ret\n }\n}\n\nexport function bindingifyTransform(\n hook?: Plugin['transform'],\n): BindingPluginOptions['transform'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (code, id) => {\n const ret = await handler.call(null, code, id)\n\n if (ret == null) {\n return\n }\n\n const retCode = typeof ret === 'string' ? ret : ret.code\n const retMap = typeof ret === 'string' ? undefined : ret.map\n\n return {\n code: retCode,\n map: retMap ?? undefined,\n }\n }\n}\n\nexport function bindingifyLoad(\n hook?: Plugin['load'],\n): BindingPluginOptions['load'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (id) => {\n const ret = await handler.call(null, id)\n\n if (ret == null) {\n return\n }\n\n const retCode = typeof ret === 'string' ? ret : ret.code\n const retMap = typeof ret === 'string' ? undefined : ret.map\n\n return {\n code: retCode,\n map: retMap ?? undefined,\n }\n }\n}\n\nexport function bindingifyRenderChunk(\n hook?: Plugin['renderChunk'],\n): BindingPluginOptions['renderChunk'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (code, chunk) => {\n const ret = await handler.call(null, code, chunk)\n\n if (ret == null) {\n return\n }\n\n return {\n code: ret,\n }\n }\n}\n","import { normalizeHook } from '../utils/normalize-hook'\nimport type { BindingPluginOptions } from '../binding'\n\nimport type { Plugin } from './index'\n\nexport function bindingifyGenerateBundle(\n hook?: Plugin['generateBundle'],\n): BindingPluginOptions['generateBundle'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (bundle, isWrite) => {\n handler.call(null, bundle, isWrite)\n }\n}\nexport function bindingifyWriteBundle(\n hook?: Plugin['writeBundle'],\n): BindingPluginOptions['writeBundle'] {\n if (!hook) {\n return undefined\n }\n const [handler, _optionsIgnoredSofar] = normalizeHook(hook)\n\n return async (bundle) => {\n handler.call(null, bundle)\n }\n}\n","import type { BindingPluginOptions } from '../binding'\nimport {\n bindingifyBuildEnd,\n bindingifyBuildStart,\n bindingifyLoad,\n bindingifyRenderChunk,\n bindingifyResolveId,\n bindingifyTransform,\n} from './bindingify-build-hooks'\n\nimport {\n bindingifyGenerateBundle,\n bindingifyWriteBundle,\n} from './bindingify-output-hooks'\n\nimport type { Plugin } from './index'\nimport { RolldownNormalizedInputOptions } from '../options/input-options'\n\n// Note: because napi not catch error, so we need to catch error and print error to debugger in adapter.\nexport function bindingifyPlugin(\n plugin: Plugin,\n options: RolldownNormalizedInputOptions,\n): BindingPluginOptions {\n return {\n name: plugin.name ?? 'unknown',\n buildStart: bindingifyBuildStart(options, plugin.buildStart),\n resolveId: bindingifyResolveId(plugin.resolveId),\n buildEnd: bindingifyBuildEnd(plugin.buildEnd),\n transform: bindingifyTransform(plugin.transform),\n load: bindingifyLoad(plugin.load),\n renderChunk: bindingifyRenderChunk(plugin.renderChunk),\n generateBundle: bindingifyGenerateBundle(plugin.generateBundle),\n writeBundle: bindingifyWriteBundle(plugin.writeBundle),\n }\n}\n","import { NormalizedInputOptions } from '../rollup-types'\nimport { BindingInputOptions } from '../binding'\nimport nodePath from 'node:path'\nimport { bindingifyPlugin } from '../plugin/bindingify-plugin'\nimport { InputOptions, RolldownNormalizedInputOptions } from './input-options'\n\nexport function createInputOptionsAdapter(\n options: RolldownNormalizedInputOptions,\n inputOptions: InputOptions,\n): BindingInputOptions {\n return {\n input: normalizeInput(options.input),\n plugins: options.plugins.map((plugin) =>\n // @ts-expect-error\n bindingifyPlugin(plugin, options),\n ),\n cwd: inputOptions.cwd ?? process.cwd(),\n external: inputOptions.external ? options.external : undefined,\n resolve: options.resolve,\n }\n}\n\nfunction normalizeInput(\n input: NormalizedInputOptions['input'],\n): BindingInputOptions['input'] {\n if (Array.isArray(input)) {\n return input.map((src) => {\n const name = nodePath.parse(src).name\n return {\n name,\n import: src,\n }\n })\n } else {\n return Object.entries(input).map((value) => {\n return { name: value[0], import: value[1] }\n })\n }\n}\n","import { OutputOptions as RollupOutputOptions } from '../rollup-types'\nimport { BindingOutputOptions } from '../binding'\nimport { unimplemented } from '../utils'\n\nexport interface OutputOptions {\n dir?: RollupOutputOptions['dir']\n format?: 'es'\n exports?: RollupOutputOptions['exports']\n sourcemap?: RollupOutputOptions['sourcemap']\n banner?: RollupOutputOptions['banner']\n footer?: RollupOutputOptions['footer']\n}\n\nfunction normalizeFormat(\n format: OutputOptions['format'],\n): BindingOutputOptions['format'] {\n if (format == null || format === 'es' || format === 'cjs') {\n return format\n } else {\n return unimplemented(`output.format: ${format}`)\n }\n}\n\nfunction normalizeSourcemap(\n sourcemap: OutputOptions['sourcemap'],\n): BindingOutputOptions['sourcemap'] {\n switch (sourcemap) {\n case true:\n return 'file'\n\n case 'inline':\n return 'inline'\n\n case false:\n case undefined:\n case 'hidden':\n return 'hidden'\n\n default:\n throw new Error(`unknown sourcemap: ${sourcemap}`)\n }\n}\n\nconst getAddon = <T extends 'banner' | 'footer'>(\n config: OutputOptions,\n name: T,\n): BindingOutputOptions[T] => {\n const configAddon = config[name]\n if (configAddon === undefined) return undefined\n if (typeof configAddon === 'function') {\n return configAddon as BindingOutputOptions[T]\n }\n return () => configAddon || ''\n}\n\nexport function normalizeOutputOptions(\n opts: OutputOptions,\n): BindingOutputOptions {\n const { dir, format, exports, sourcemap } = opts\n return {\n dir: dir,\n format: normalizeFormat(format),\n exports,\n sourcemap: normalizeSourcemap(sourcemap),\n plugins: [],\n banner: getAddon(opts, 'banner'),\n footer: getAddon(opts, 'footer'),\n }\n}\n","import { Bundler } from '../binding'\nimport {\n normalizeInputOptions,\n type InputOptions,\n} from '../options/input-options'\nimport { createInputOptionsAdapter } from '../options/input-options-adapter'\nimport {\n OutputOptions,\n normalizeOutputOptions,\n} from '../options/output-options'\n\nexport async function createBundler(\n inputOptions: InputOptions,\n outputOptions: OutputOptions,\n): Promise<Bundler> {\n // Convert `InputOptions` to `NormalizedInputOptions`.\n const normalizedInputOptions = await normalizeInputOptions(inputOptions)\n // Convert `NormalizedInputOptions` to `BindingInputOptions`\n const bindingInputOptions = createInputOptionsAdapter(\n normalizedInputOptions,\n inputOptions,\n )\n return new Bundler(bindingInputOptions, normalizeOutputOptions(outputOptions))\n}\n","export * from './async-flatten'\nexport * from './transform-to-rollup-output'\nexport * from './normalize-plugin-option'\nexport * from './ensure-array'\nexport * from './create-bundler'\nexport * from './transform-sourcemap'\n\nexport function arraify<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value]\n}\n\nexport function unimplemented(info?: string): never {\n if (info) {\n throw new Error(`unimplemented: ${info}`)\n }\n throw new Error('unimplemented')\n}\n\nexport function unreachable(info?: string): never {\n if (info) {\n throw new Error(`unreachable: ${info}`)\n }\n throw new Error('unreachable')\n}\n\nexport function noop(..._args: any[]) {}\n","import { Bundler } from './binding'\nimport { normalizeOutputOptions, OutputOptions } from './options/output-options'\nimport { createBundler, transformToRollupOutput, unimplemented } from './utils'\nimport { RolldownOutput } from './types/rolldown-output'\nimport { HasProperty, TypeAssert } from './utils/type-assert'\nimport { InputOptions } from './options/input-options'\n\nexport class RolldownBuild {\n #inputOptions: InputOptions\n #bundler?: Bundler\n\n constructor(inputOptions: InputOptions) {\n // TODO: Check if `inputOptions.output` is set. If so, throw an warning that it is ignored.\n this.#inputOptions = inputOptions\n }\n\n async #getBundler(outputOptions: OutputOptions): Promise<Bundler> {\n if (typeof this.#bundler === 'undefined') {\n this.#bundler = await createBundler(this.#inputOptions, outputOptions)\n }\n return this.#bundler\n }\n\n async generate(outputOptions: OutputOptions = {}): Promise<RolldownOutput> {\n const bundler = await this.#getBundler(outputOptions)\n const output = await bundler.generate()\n return transformToRollupOutput(output)\n }\n\n async write(outputOptions: OutputOptions = {}): Promise<RolldownOutput> {\n const bundler = await this.#getBundler(outputOptions)\n const output = await bundler.write()\n return transformToRollupOutput(output)\n }\n}\n\nfunction _assert() {\n type _ = TypeAssert<HasProperty<RolldownBuild, 'generate' | 'write'>>\n}\n","import { InputOptions } from './options/input-options'\nimport { RolldownBuild } from './rolldown-build'\nimport { createBundler } from './utils'\n\n// Compat to `rollup.rollup`, it is included scan module graph and linker.\nexport const rolldown = async (input: InputOptions): Promise<RolldownBuild> => {\n return new RolldownBuild(input)\n}\n\n/**\n * @description\n * This is an experimental API. It's behavior may change in the future.\n * Calling this API will only execute the scan stage of rolldown.\n */\nexport const experimental_scan = async (input: InputOptions): Promise<void> => {\n const bundler = await createBundler(input, {})\n await bundler.scan()\n}\n"],"names":["require$$0","nodePath"],"mappings":";;;;;;;;;;AAEA,eAAsB,aAAgB,KAA0B,EAAA;AAC9D,EAAG,GAAA;AACD,IAAA,KAAA,GAAA,CAAS,MAAM,OAAQ,CAAA,GAAA,CAAI,KAAK,CAAA,EAAG,KAAK,QAAQ,CAAA,CAAA;AAAA,WACzC,KAAM,CAAA,IAAA,CAAK,CAAC,CAAA,KAAW,GAAG,IAAI,CAAA,EAAA;AACvC,EAAO,OAAA,KAAA,CAAA;AACT;;ACKA,SAAS,6BACP,KACqB,EAAA;AACrB,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,OAAA;AAAA,IACN,IAAI,IAAO,GAAA;AACT,MAAA,OAAO,KAAM,CAAA,IAAA,CAAA;AAAA,KACf;AAAA,IACA,UAAU,KAAM,CAAA,QAAA;AAAA,IAChB,IAAI,OAAU,GAAA;AACZ,MAAA,OAAO,MAAO,CAAA,WAAA;AAAA,QACZ,MAAO,CAAA,OAAA,CAAQ,KAAM,CAAA,OAAO,EAAE,GAAI,CAAA,CAAC,CAAC,GAAA,EAAK,CAAC,CAAM,KAAA,CAAC,GAAK,EAAA,EAAE,CAAC,CAAA;AAAA,OAC3D,CAAA;AAAA,KACF;AAAA,IACA,SAAS,KAAM,CAAA,OAAA;AAAA,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