rolldown 1.0.0-beta.6-commit.231bdea → 1.0.0-beta.6-commit.8f5f8f1

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/cjs/cli.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
3
- const require_src = require('../shared/src-ChN-bJhZ.cjs');
3
+ const require_src = require('../shared/src-DL88Q7l_.cjs');
4
4
  const require_parse_ast_index = require('../shared/parse-ast-index-BytJf1vj.cjs');
5
5
  const node_process = require_chunk.__toESM(require("node:process"));
6
6
  const node_path = require_chunk.__toESM(require("node:path"));
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
3
- const require_src = require('../shared/src-ChN-bJhZ.cjs');
3
+ const require_src = require('../shared/src-DL88Q7l_.cjs');
4
4
  const require_parse_ast_index = require('../shared/parse-ast-index-BytJf1vj.cjs');
5
5
  const node_url = require_chunk.__toESM(require("node:url"));
6
6
 
@@ -60,6 +60,7 @@ exports.composePlugins = require_src.composeJsPlugins
60
60
  exports.defineParallelPlugin = defineParallelPlugin
61
61
  exports.dynamicImportVarsPlugin = require_src.dynamicImportVarsPlugin
62
62
  exports.importGlobPlugin = require_src.importGlobPlugin
63
+ exports.isolatedDeclarationPlugin = require_src.isolatedDeclarationPlugin
63
64
  exports.jsonPlugin = require_src.jsonPlugin
64
65
  exports.loadFallbackPlugin = require_src.loadFallbackPlugin
65
66
  exports.manifestPlugin = require_src.manifestPlugin
@@ -1,4 +1,4 @@
1
- const require_src = require('../shared/src-ChN-bJhZ.cjs');
1
+ const require_src = require('../shared/src-DL88Q7l_.cjs');
2
2
  require('../shared/parse-ast-index-BytJf1vj.cjs');
3
3
 
4
4
  exports.VERSION = require_src.VERSION
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
3
- const require_src = require('../shared/src-ChN-bJhZ.cjs');
3
+ const require_src = require('../shared/src-DL88Q7l_.cjs');
4
4
  const require_parse_ast_index = require('../shared/parse-ast-index-BytJf1vj.cjs');
5
5
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
6
6
 
package/dist/esm/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { colors } from "../shared/parse-ast-index-D8k04LFo.mjs";
2
- import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-CwiTaRcN.mjs";
2
+ import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-C3C9kwmQ.mjs";
3
3
  import process$1, { cwd } from "node:process";
4
4
  import path, { sep } from "node:path";
5
5
  import fs from "node:fs";
@@ -1,5 +1,5 @@
1
1
  import { import_binding } from "../shared/parse-ast-index-D8k04LFo.mjs";
2
- import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-CwiTaRcN.mjs";
2
+ import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-C3C9kwmQ.mjs";
3
3
  import { pathToFileURL } from "node:url";
4
4
 
5
5
  //#region src/plugin/parallel-plugin.ts
@@ -54,4 +54,4 @@ function aliasPlugin(config) {
54
54
  //#endregion
55
55
  var moduleRunnerTransform = import_binding.moduleRunnerTransform;
56
56
  var transform = import_binding.transform;
57
- export { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins as composePlugins, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, replacePlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin };
57
+ export { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins as composePlugins, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, replacePlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin };
@@ -1,4 +1,4 @@
1
1
  import "../shared/parse-ast-index-D8k04LFo.mjs";
2
- import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-CwiTaRcN.mjs";
2
+ import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-C3C9kwmQ.mjs";
3
3
 
4
4
  export { VERSION, build, defineConfig, rolldown, watch };
@@ -1,5 +1,5 @@
1
1
  import { import_binding } from "../shared/parse-ast-index-D8k04LFo.mjs";
2
- import { PluginContextData, bindingifyPlugin } from "../shared/src-CwiTaRcN.mjs";
2
+ import { PluginContextData, bindingifyPlugin } from "../shared/src-C3C9kwmQ.mjs";
3
3
  import { parentPort, workerData } from "node:worker_threads";
4
4
 
5
5
  //#region src/parallel-plugin-worker.ts
@@ -236,6 +236,9 @@ function moduleFederationPlugin(config) {
236
236
  manifest: config.manifest === false ? void 0 : config.manifest === true ? {} : config.manifest
237
237
  });
238
238
  }
239
+ function isolatedDeclarationPlugin(config) {
240
+ return new BuiltinPlugin("builtin:isolated-declaration", config);
241
+ }
239
242
 
240
243
  //#endregion
241
244
  //#region src/utils/async-flatten.ts
@@ -1701,8 +1704,8 @@ function bindingifyRenderChunk(args) {
1701
1704
  if (!hook) return {};
1702
1705
  const { handler, meta } = normalizeHook(hook);
1703
1706
  return {
1704
- plugin: async (ctx, code, chunk, opts) => {
1705
- const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins));
1707
+ plugin: async (ctx, code, chunk, opts, chunks) => {
1708
+ const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), { chunks: Object.fromEntries(Object.entries(chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
1706
1709
  if (ret == null) return;
1707
1710
  if (typeof ret === "string") return { code: ret };
1708
1711
  if (!ret.map) return { code: ret.code };
@@ -2472,10 +2475,10 @@ function createComposedPlugin(plugins) {
2472
2475
  case "renderChunk": {
2473
2476
  if (batchedHooks.renderChunk) {
2474
2477
  const batchedHandlers = batchedHooks.renderChunk;
2475
- composed.renderChunk = async function(code, chunk, options) {
2478
+ composed.renderChunk = async function(code, chunk, options, meta) {
2476
2479
  for (const [handler, plugin] of batchedHandlers) {
2477
2480
  const { handler: handlerFn } = normalizeHook(handler);
2478
- const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), code, chunk, options);
2481
+ const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), code, chunk, options, meta);
2479
2482
  if (!isNullish(result)) return result;
2480
2483
  }
2481
2484
  };
@@ -2856,7 +2859,7 @@ const watch = (input) => {
2856
2859
 
2857
2860
  //#endregion
2858
2861
  //#region package.json
2859
- var version = "1.0.0-beta.6-commit.231bdea";
2862
+ var version = "1.0.0-beta.6-commit.8f5f8f1";
2860
2863
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2861
2864
 
2862
2865
  //#endregion
@@ -2880,4 +2883,4 @@ async function build(options) {
2880
2883
  const VERSION = version;
2881
2884
 
2882
2885
  //#endregion
2883
- export { BuiltinPlugin, PluginContextData, VERSION, arraify, bindingifyPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch };
2886
+ export { BuiltinPlugin, PluginContextData, VERSION, arraify, bindingifyPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch };
@@ -238,6 +238,9 @@ function moduleFederationPlugin(config) {
238
238
  manifest: config.manifest === false ? void 0 : config.manifest === true ? {} : config.manifest
239
239
  });
240
240
  }
241
+ function isolatedDeclarationPlugin(config) {
242
+ return new BuiltinPlugin("builtin:isolated-declaration", config);
243
+ }
241
244
 
242
245
  //#endregion
243
246
  //#region src/utils/async-flatten.ts
@@ -1703,8 +1706,8 @@ function bindingifyRenderChunk(args) {
1703
1706
  if (!hook) return {};
1704
1707
  const { handler, meta } = normalizeHook(hook);
1705
1708
  return {
1706
- plugin: async (ctx, code, chunk, opts) => {
1707
- const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins));
1709
+ plugin: async (ctx, code, chunk, opts, chunks) => {
1710
+ const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), { chunks: Object.fromEntries(Object.entries(chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
1708
1711
  if (ret == null) return;
1709
1712
  if (typeof ret === "string") return { code: ret };
1710
1713
  if (!ret.map) return { code: ret.code };
@@ -2474,10 +2477,10 @@ function createComposedPlugin(plugins) {
2474
2477
  case "renderChunk": {
2475
2478
  if (batchedHooks.renderChunk) {
2476
2479
  const batchedHandlers = batchedHooks.renderChunk;
2477
- composed.renderChunk = async function(code, chunk, options) {
2480
+ composed.renderChunk = async function(code, chunk, options, meta) {
2478
2481
  for (const [handler, plugin] of batchedHandlers) {
2479
2482
  const { handler: handlerFn } = normalizeHook(handler);
2480
- const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), code, chunk, options);
2483
+ const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), code, chunk, options, meta);
2481
2484
  if (!isNullish(result)) return result;
2482
2485
  }
2483
2486
  };
@@ -2858,7 +2861,7 @@ const watch = (input) => {
2858
2861
 
2859
2862
  //#endregion
2860
2863
  //#region package.json
2861
- var version = "1.0.0-beta.6-commit.231bdea";
2864
+ var version = "1.0.0-beta.6-commit.8f5f8f1";
2862
2865
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2863
2866
 
2864
2867
  //#endregion
@@ -2984,6 +2987,12 @@ Object.defineProperty(exports, 'importGlobPlugin', {
2984
2987
  return importGlobPlugin;
2985
2988
  }
2986
2989
  });
2990
+ Object.defineProperty(exports, 'isolatedDeclarationPlugin', {
2991
+ enumerable: true,
2992
+ get: function () {
2993
+ return isolatedDeclarationPlugin;
2994
+ }
2995
+ });
2987
2996
  Object.defineProperty(exports, 'jsonPlugin', {
2988
2997
  enumerable: true,
2989
2998
  get: function () {
@@ -236,7 +236,8 @@ export type BindingBuiltinPluginName = 'builtin:wasm-helper'|
236
236
  'builtin:build-import-analysis'|
237
237
  'builtin:replace'|
238
238
  'builtin:vite-resolve'|
239
- 'builtin:module-federation';
239
+ 'builtin:module-federation'|
240
+ 'builtin:isolated-declaration';
240
241
 
241
242
  export interface BindingBundlerOptions {
242
243
  inputOptions: BindingInputOptions
@@ -394,6 +395,10 @@ export interface BindingInputOptions {
394
395
  makeAbsoluteExternalsRelative?: BindingMakeAbsoluteExternalsRelative
395
396
  }
396
397
 
398
+ export interface BindingIsolatedDeclarationPluginConfig {
399
+ stripInternal?: boolean
400
+ }
401
+
397
402
  export interface BindingJsonPluginConfig {
398
403
  stringify?: BindingJsonPluginStringify
399
404
  isBuild?: boolean
@@ -571,7 +576,7 @@ export interface BindingPluginOptions {
571
576
  moduleParsedMeta?: BindingPluginHookMeta
572
577
  buildEnd?: (ctx: BindingPluginContext, error?: (Error | BindingError)[]) => MaybePromise<VoidNullable>
573
578
  buildEndMeta?: BindingPluginHookMeta
574
- renderChunk?: (ctx: BindingPluginContext, code: string, chunk: RenderedChunk, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput>>
579
+ renderChunk?: (ctx: BindingPluginContext, code: string, chunk: RenderedChunk, opts: BindingNormalizedOptions, chunks: Record<string, RenderedChunk>) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput>>
575
580
  renderChunkMeta?: BindingPluginHookMeta
576
581
  augmentChunkHash?: (ctx: BindingPluginContext, chunk: RenderedChunk) => MaybePromise<void | string>
577
582
  augmentChunkHashMeta?: BindingPluginHookMeta
@@ -1,4 +1,4 @@
1
- import { type BindingBuiltinPluginName, BindingGlobImportPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingJsonPluginConfig, BindingBuildImportAnalysisPluginConfig, type BindingViteResolvePluginConfig, BindingModuleFederationPluginOption, BindingRemote, BindingMfManifest } from '../binding';
1
+ import { type BindingBuiltinPluginName, BindingGlobImportPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingJsonPluginConfig, BindingBuildImportAnalysisPluginConfig, type BindingViteResolvePluginConfig, BindingModuleFederationPluginOption, BindingRemote, BindingMfManifest, BindingIsolatedDeclarationPluginConfig } from '../binding';
2
2
  export declare class BuiltinPlugin {
3
3
  name: BindingBuiltinPluginName;
4
4
  _options?: unknown | undefined;
@@ -19,3 +19,4 @@ export type ModuleFederationPluginOption = Omit<BindingModuleFederationPluginOpt
19
19
  manifest?: boolean | BindingMfManifest;
20
20
  };
21
21
  export declare function moduleFederationPlugin(config: ModuleFederationPluginOption): BuiltinPlugin;
22
+ export declare function isolatedDeclarationPlugin(config?: BindingIsolatedDeclarationPluginConfig): BuiltinPlugin;
@@ -3,7 +3,7 @@ export { experimental_scan as scan } from './api/experimental';
3
3
  export { transform, moduleRunnerTransform } from './binding';
4
4
  export type { TransformOptions, TransformResult } from './binding';
5
5
  export { composeJsPlugins as composePlugins } from './utils/compose-js-plugins';
6
- export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, jsonPlugin, buildImportAnalysisPlugin, viteResolvePlugin, moduleFederationPlugin, } from './builtin-plugin/constructors';
6
+ export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, jsonPlugin, buildImportAnalysisPlugin, viteResolvePlugin, moduleFederationPlugin, isolatedDeclarationPlugin, } from './builtin-plugin/constructors';
7
7
  export { transformPlugin } from './builtin-plugin/transform-plugin';
8
8
  export { replacePlugin } from './builtin-plugin/replace-plugin';
9
9
  export { aliasPlugin } from './builtin-plugin/alias-plugin';
@@ -71,7 +71,9 @@ export interface FunctionPluginHooks {
71
71
  [DEFINED_HOOK_NAMES.moduleParsed]: (this: PluginContext, moduleInfo: ModuleInfo) => void;
72
72
  [DEFINED_HOOK_NAMES.buildEnd]: (this: PluginContext, err?: Error) => void;
73
73
  [DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
74
- [DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions) => NullValue | string | {
74
+ [DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: {
75
+ chunks: Record<string, RenderedChunk>;
76
+ }) => NullValue | string | {
75
77
  code: string;
76
78
  map?: SourceMapInput;
77
79
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.6-commit.231bdea",
3
+ "version": "1.0.0-beta.6-commit.8f5f8f1",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "repository": {
@@ -122,21 +122,21 @@
122
122
  "unbuild": "^3.0.0",
123
123
  "why-is-node-running": "^3.0.0",
124
124
  "@rolldown/testing": "0.0.1",
125
- "rolldown": "1.0.0-beta.6-commit.231bdea"
125
+ "rolldown": "1.0.0-beta.6-commit.8f5f8f1"
126
126
  },
127
127
  "optionalDependencies": {
128
- "@rolldown/binding-darwin-arm64": "1.0.0-beta.6-commit.231bdea",
129
- "@rolldown/binding-darwin-x64": "1.0.0-beta.6-commit.231bdea",
130
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.6-commit.231bdea",
131
- "@rolldown/binding-freebsd-x64": "1.0.0-beta.6-commit.231bdea",
132
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.6-commit.231bdea",
133
- "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.6-commit.231bdea",
134
- "@rolldown/binding-linux-x64-musl": "1.0.0-beta.6-commit.231bdea",
135
- "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.6-commit.231bdea",
136
- "@rolldown/binding-wasm32-wasi": "1.0.0-beta.6-commit.231bdea",
137
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.6-commit.231bdea",
138
- "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.6-commit.231bdea",
139
- "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.6-commit.231bdea"
128
+ "@rolldown/binding-darwin-arm64": "1.0.0-beta.6-commit.8f5f8f1",
129
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.6-commit.8f5f8f1",
130
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.6-commit.8f5f8f1",
131
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.6-commit.8f5f8f1",
132
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.6-commit.8f5f8f1",
133
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.6-commit.8f5f8f1",
134
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.6-commit.8f5f8f1",
135
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.6-commit.8f5f8f1",
136
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.6-commit.8f5f8f1",
137
+ "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.6-commit.8f5f8f1",
138
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.6-commit.8f5f8f1",
139
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.6-commit.8f5f8f1"
140
140
  },
141
141
  "scripts": {
142
142
  "# Scrips for binding #": "_",