rolldown 1.0.0-beta.3-commit.4666fd5 → 1.0.0-beta.3-commit.7b0c517

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-4ko3ERfv.cjs');
3
+ const require_src = require('../shared/src-1SOKv3Pa.cjs');
4
4
  const require_parse_ast_index = require('../shared/parse-ast-index-Dh_sWnMa.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-4ko3ERfv.cjs');
3
+ const require_src = require('../shared/src-1SOKv3Pa.cjs');
4
4
  const require_parse_ast_index = require('../shared/parse-ast-index-Dh_sWnMa.cjs');
5
5
  const node_url = require_chunk.__toESM(require("node:url"));
6
6
 
@@ -1,4 +1,4 @@
1
- const require_src = require('../shared/src-4ko3ERfv.cjs');
1
+ const require_src = require('../shared/src-1SOKv3Pa.cjs');
2
2
  require('../shared/parse-ast-index-Dh_sWnMa.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-4ko3ERfv.cjs');
3
+ const require_src = require('../shared/src-1SOKv3Pa.cjs');
4
4
  const require_parse_ast_index = require('../shared/parse-ast-index-Dh_sWnMa.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-DIxeQDpE.mjs";
2
- import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-ypUvsO0F.mjs";
2
+ import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-Cdwah9uk.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-DIxeQDpE.mjs";
2
- import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-ypUvsO0F.mjs";
2
+ import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-Cdwah9uk.mjs";
3
3
  import { pathToFileURL } from "node:url";
4
4
 
5
5
  //#region src/plugin/parallel-plugin.ts
@@ -1,4 +1,4 @@
1
1
  import "../shared/parse-ast-index-DIxeQDpE.mjs";
2
- import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-ypUvsO0F.mjs";
2
+ import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-Cdwah9uk.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-DIxeQDpE.mjs";
2
- import { PluginContextData, bindingifyPlugin } from "../shared/src-ypUvsO0F.mjs";
2
+ import { PluginContextData, bindingifyPlugin } from "../shared/src-Cdwah9uk.mjs";
3
3
  import { parentPort, workerData } from "node:worker_threads";
4
4
 
5
5
  //#region src/parallel-plugin-worker.ts
@@ -457,6 +457,42 @@ const JsxOptionsSchema = valibot.strictObject({
457
457
  ])), valibot.description("Jsx transformation mode")),
458
458
  refresh: valibot.pipe(valibot.optional(valibot.boolean()), valibot.description("React refresh transformation"))
459
459
  });
460
+ const HelperModeSchema = valibot.union([valibot.literal("Runtime"), valibot.literal("External")]);
461
+ const DecoratorOptionSchema = valibot.object({
462
+ legacy: valibot.optional(valibot.boolean()),
463
+ emitDecoratorMetadata: valibot.optional(valibot.boolean())
464
+ });
465
+ const HelpersSchema = valibot.object({ mode: valibot.optional(HelperModeSchema) });
466
+ const RewriteImportExtensionsSchema = valibot.union([
467
+ valibot.literal("rewrite"),
468
+ valibot.literal("remove"),
469
+ valibot.boolean()
470
+ ]);
471
+ const TypescriptSchema = valibot.object({
472
+ jsxPragma: valibot.optional(valibot.string()),
473
+ jsxPragmaFrag: valibot.optional(valibot.string()),
474
+ onlyRemoveTypeImports: valibot.optional(valibot.boolean()),
475
+ allowNamespaces: valibot.optional(valibot.boolean()),
476
+ allowDeclareFields: valibot.optional(valibot.boolean()),
477
+ declaration: valibot.optional(valibot.object({
478
+ stripInternal: valibot.optional(valibot.boolean()),
479
+ sourcemap: valibot.optional(valibot.boolean())
480
+ })),
481
+ rewriteImportExtensions: valibot.optional(RewriteImportExtensionsSchema)
482
+ });
483
+ const AssumptionsSchema = valibot.object({
484
+ ignoreFunctionLength: valibot.optional(valibot.boolean()),
485
+ noDocumentAll: valibot.optional(valibot.boolean()),
486
+ objectRestNoSymbols: valibot.optional(valibot.boolean()),
487
+ pureGetters: valibot.optional(valibot.boolean()),
488
+ setPublicClassFields: valibot.optional(valibot.boolean())
489
+ });
490
+ const TransformOptionsSchema = valibot.object({
491
+ assumptions: valibot.optional(AssumptionsSchema),
492
+ typescript: valibot.optional(TypescriptSchema),
493
+ helpers: valibot.optional(HelpersSchema),
494
+ decorators: valibot.optional(DecoratorOptionSchema)
495
+ });
460
496
  const WatchOptionsSchema = valibot.strictObject({
461
497
  chokidar: valibot.optional(valibot.never(`The "watch.chokidar" option is deprecated, please use "watch.notify" instead of it`)),
462
498
  exclude: valibot.optional(valibot.union([StringOrRegExpSchema, valibot.array(StringOrRegExpSchema)])),
@@ -488,7 +524,10 @@ const ResolveOptionsSchema = valibot.strictObject({
488
524
  symlinks: valibot.optional(valibot.boolean()),
489
525
  tsconfigFilename: valibot.optional(valibot.string())
490
526
  });
491
- const TreeshakingOptionsSchema = valibot.union([valibot.boolean(), valibot.looseObject({ annotations: valibot.optional(valibot.boolean()) })]);
527
+ const TreeshakingOptionsSchema = valibot.union([valibot.boolean(), valibot.looseObject({
528
+ annotations: valibot.optional(valibot.boolean()),
529
+ manualPureFunctions: valibot.optional(valibot.array(valibot.string()))
530
+ })]);
492
531
  const OnLogSchema = valibot.pipe(valibot.function(), valibot.args(valibot.tuple([
493
532
  LogLevelSchema,
494
533
  RollupLogSchema,
@@ -529,6 +568,7 @@ const InputOptionsSchema = valibot.strictObject({
529
568
  valibot.string("react-jsx"),
530
569
  valibot.string("preserve")
531
570
  ])),
571
+ transform: valibot.optional(TransformOptionsSchema),
532
572
  watch: valibot.optional(valibot.union([WatchOptionsSchema, valibot.literal(false)])),
533
573
  dropLabels: valibot.pipe(valibot.optional(valibot.array(valibot.string())), valibot.description("Remove labeled statements with these label names")),
534
574
  checks: valibot.optional(ChecksOptionsSchema),
@@ -2001,6 +2041,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
2001
2041
  },
2002
2042
  profilerNames: inputOptions?.profilerNames,
2003
2043
  jsx: bindingifyJsx(inputOptions.jsx),
2044
+ transform: inputOptions.transform,
2004
2045
  watch: bindingifyWatch(inputOptions.watch),
2005
2046
  dropLabels: inputOptions.dropLabels,
2006
2047
  keepNames: inputOptions.keepNames,
@@ -2126,7 +2167,11 @@ function bindingifyTreeshakeOptions(config) {
2126
2167
  moduleSideEffects: true,
2127
2168
  annotations: true
2128
2169
  };
2129
- let normalizedConfig = { moduleSideEffects: true };
2170
+ let normalizedConfig = {
2171
+ moduleSideEffects: true,
2172
+ annotations: config.annotations ?? true,
2173
+ manualPureFunctions: config.manualPureFunctions
2174
+ };
2130
2175
  if (config.moduleSideEffects === void 0) normalizedConfig.moduleSideEffects = true;
2131
2176
  else if (config.moduleSideEffects === "no-external") normalizedConfig.moduleSideEffects = [{
2132
2177
  external: true,
@@ -2136,7 +2181,6 @@ function bindingifyTreeshakeOptions(config) {
2136
2181
  sideEffects: true
2137
2182
  }];
2138
2183
  else normalizedConfig.moduleSideEffects = config.moduleSideEffects;
2139
- normalizedConfig.annotations = config.annotations ?? true;
2140
2184
  return normalizedConfig;
2141
2185
  }
2142
2186
 
@@ -2751,7 +2795,7 @@ const watch = (input) => {
2751
2795
 
2752
2796
  //#endregion
2753
2797
  //#region package.json
2754
- var version = "1.0.0-beta.3-commit.4666fd5";
2798
+ var version = "1.0.0-beta.3-commit.7b0c517";
2755
2799
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2756
2800
 
2757
2801
  //#endregion
@@ -455,6 +455,42 @@ const JsxOptionsSchema = v.strictObject({
455
455
  ])), v.description("Jsx transformation mode")),
456
456
  refresh: v.pipe(v.optional(v.boolean()), v.description("React refresh transformation"))
457
457
  });
458
+ const HelperModeSchema = v.union([v.literal("Runtime"), v.literal("External")]);
459
+ const DecoratorOptionSchema = v.object({
460
+ legacy: v.optional(v.boolean()),
461
+ emitDecoratorMetadata: v.optional(v.boolean())
462
+ });
463
+ const HelpersSchema = v.object({ mode: v.optional(HelperModeSchema) });
464
+ const RewriteImportExtensionsSchema = v.union([
465
+ v.literal("rewrite"),
466
+ v.literal("remove"),
467
+ v.boolean()
468
+ ]);
469
+ const TypescriptSchema = v.object({
470
+ jsxPragma: v.optional(v.string()),
471
+ jsxPragmaFrag: v.optional(v.string()),
472
+ onlyRemoveTypeImports: v.optional(v.boolean()),
473
+ allowNamespaces: v.optional(v.boolean()),
474
+ allowDeclareFields: v.optional(v.boolean()),
475
+ declaration: v.optional(v.object({
476
+ stripInternal: v.optional(v.boolean()),
477
+ sourcemap: v.optional(v.boolean())
478
+ })),
479
+ rewriteImportExtensions: v.optional(RewriteImportExtensionsSchema)
480
+ });
481
+ const AssumptionsSchema = v.object({
482
+ ignoreFunctionLength: v.optional(v.boolean()),
483
+ noDocumentAll: v.optional(v.boolean()),
484
+ objectRestNoSymbols: v.optional(v.boolean()),
485
+ pureGetters: v.optional(v.boolean()),
486
+ setPublicClassFields: v.optional(v.boolean())
487
+ });
488
+ const TransformOptionsSchema = v.object({
489
+ assumptions: v.optional(AssumptionsSchema),
490
+ typescript: v.optional(TypescriptSchema),
491
+ helpers: v.optional(HelpersSchema),
492
+ decorators: v.optional(DecoratorOptionSchema)
493
+ });
458
494
  const WatchOptionsSchema = v.strictObject({
459
495
  chokidar: v.optional(v.never(`The "watch.chokidar" option is deprecated, please use "watch.notify" instead of it`)),
460
496
  exclude: v.optional(v.union([StringOrRegExpSchema, v.array(StringOrRegExpSchema)])),
@@ -486,7 +522,10 @@ const ResolveOptionsSchema = v.strictObject({
486
522
  symlinks: v.optional(v.boolean()),
487
523
  tsconfigFilename: v.optional(v.string())
488
524
  });
489
- const TreeshakingOptionsSchema = v.union([v.boolean(), v.looseObject({ annotations: v.optional(v.boolean()) })]);
525
+ const TreeshakingOptionsSchema = v.union([v.boolean(), v.looseObject({
526
+ annotations: v.optional(v.boolean()),
527
+ manualPureFunctions: v.optional(v.array(v.string()))
528
+ })]);
490
529
  const OnLogSchema = v.pipe(v.function(), v.args(v.tuple([
491
530
  LogLevelSchema,
492
531
  RollupLogSchema,
@@ -527,6 +566,7 @@ const InputOptionsSchema = v.strictObject({
527
566
  v.string("react-jsx"),
528
567
  v.string("preserve")
529
568
  ])),
569
+ transform: v.optional(TransformOptionsSchema),
530
570
  watch: v.optional(v.union([WatchOptionsSchema, v.literal(false)])),
531
571
  dropLabels: v.pipe(v.optional(v.array(v.string())), v.description("Remove labeled statements with these label names")),
532
572
  checks: v.optional(ChecksOptionsSchema),
@@ -1999,6 +2039,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
1999
2039
  },
2000
2040
  profilerNames: inputOptions?.profilerNames,
2001
2041
  jsx: bindingifyJsx(inputOptions.jsx),
2042
+ transform: inputOptions.transform,
2002
2043
  watch: bindingifyWatch(inputOptions.watch),
2003
2044
  dropLabels: inputOptions.dropLabels,
2004
2045
  keepNames: inputOptions.keepNames,
@@ -2124,7 +2165,11 @@ function bindingifyTreeshakeOptions(config) {
2124
2165
  moduleSideEffects: true,
2125
2166
  annotations: true
2126
2167
  };
2127
- let normalizedConfig = { moduleSideEffects: true };
2168
+ let normalizedConfig = {
2169
+ moduleSideEffects: true,
2170
+ annotations: config.annotations ?? true,
2171
+ manualPureFunctions: config.manualPureFunctions
2172
+ };
2128
2173
  if (config.moduleSideEffects === void 0) normalizedConfig.moduleSideEffects = true;
2129
2174
  else if (config.moduleSideEffects === "no-external") normalizedConfig.moduleSideEffects = [{
2130
2175
  external: true,
@@ -2134,7 +2179,6 @@ function bindingifyTreeshakeOptions(config) {
2134
2179
  sideEffects: true
2135
2180
  }];
2136
2181
  else normalizedConfig.moduleSideEffects = config.moduleSideEffects;
2137
- normalizedConfig.annotations = config.annotations ?? true;
2138
2182
  return normalizedConfig;
2139
2183
  }
2140
2184
 
@@ -2749,7 +2793,7 @@ const watch = (input) => {
2749
2793
 
2750
2794
  //#endregion
2751
2795
  //#region package.json
2752
- var version = "1.0.0-beta.3-commit.4666fd5";
2796
+ var version = "1.0.0-beta.3-commit.7b0c517";
2753
2797
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2754
2798
 
2755
2799
  //#endregion
@@ -375,6 +375,7 @@ export interface BindingInputOptions {
375
375
  experimental?: BindingExperimentalOptions
376
376
  profilerNames?: boolean
377
377
  jsx?: BindingJsx
378
+ transform?: TransformOptions
378
379
  watch?: BindingWatchOption
379
380
  keepNames?: boolean
380
381
  checks?: BindingChecksOptions
@@ -662,6 +663,7 @@ export interface BindingTransformPluginConfig {
662
663
  export interface BindingTreeshake {
663
664
  moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ((id: string, is_external: boolean) => boolean | undefined)
664
665
  annotations?: boolean
666
+ manualPureFunctions?: Array<string>
665
667
  }
666
668
 
667
669
  export interface BindingViteResolvePluginConfig {
@@ -2,7 +2,9 @@ import type { RolldownPluginOption } from '../plugin';
2
2
  import type { LogLevel, LogLevelOption, LogOrStringHandler, RollupLog, RollupLogWithString } from '../log/logging';
3
3
  import type { NullValue, StringOrRegExp } from '../types/utils';
4
4
  import type { TreeshakingOptions } from '../types/module-side-effects';
5
+ import { TransformOptions } from '../binding';
5
6
  export type InputOption = string | string[] | Record<string, string>;
7
+ type OxcTransformOption = Omit<TransformOptions, 'sourceType' | 'lang' | 'cwd' | 'sourcemap' | 'jsx' | 'define' | 'inject' | 'target'>;
6
8
  export type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
7
9
  export type ModuleTypes = Record<string, 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | 'css'>;
8
10
  export interface JsxOptions {
@@ -164,6 +166,7 @@ export interface InputOptions {
164
166
  * @default mode = "automatic"
165
167
  */
166
168
  jsx?: false | 'react' | 'react-jsx' | 'preserve' | JsxOptions;
169
+ transform?: OxcTransformOption;
167
170
  watch?: WatchOptions | false;
168
171
  dropLabels?: string[];
169
172
  keepNames?: boolean;
@@ -7,4 +7,5 @@ export type ModuleSideEffectsOption = boolean | ModuleSideEffectsRule[] | ((id:
7
7
  export type TreeshakingOptions = {
8
8
  moduleSideEffects?: ModuleSideEffectsOption;
9
9
  annotations?: boolean;
10
+ manualPureFunctions?: string[];
10
11
  } | boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.3-commit.4666fd5",
3
+ "version": "1.0.0-beta.3-commit.7b0c517",
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.3-commit.4666fd5"
125
+ "rolldown": "1.0.0-beta.3-commit.7b0c517"
126
126
  },
127
127
  "optionalDependencies": {
128
- "@rolldown/binding-darwin-x64": "1.0.0-beta.3-commit.4666fd5",
129
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.3-commit.4666fd5",
130
- "@rolldown/binding-darwin-arm64": "1.0.0-beta.3-commit.4666fd5",
131
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.3-commit.4666fd5",
132
- "@rolldown/binding-freebsd-x64": "1.0.0-beta.3-commit.4666fd5",
133
- "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.3-commit.4666fd5",
134
- "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.3-commit.4666fd5",
135
- "@rolldown/binding-wasm32-wasi": "1.0.0-beta.3-commit.4666fd5",
136
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.3-commit.4666fd5",
137
- "@rolldown/binding-linux-x64-musl": "1.0.0-beta.3-commit.4666fd5",
138
- "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.3-commit.4666fd5",
139
- "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.3-commit.4666fd5"
128
+ "@rolldown/binding-darwin-arm64": "1.0.0-beta.3-commit.7b0c517",
129
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.3-commit.7b0c517",
130
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.3-commit.7b0c517",
131
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.3-commit.7b0c517",
132
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.3-commit.7b0c517",
133
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.3-commit.7b0c517",
134
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.3-commit.7b0c517",
135
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.3-commit.7b0c517",
136
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.3-commit.7b0c517",
137
+ "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.3-commit.7b0c517",
138
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.3-commit.7b0c517",
139
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.3-commit.7b0c517"
140
140
  },
141
141
  "scripts": {
142
142
  "# Scrips for binding #": "_",