rolldown 1.0.0-beta.3-commit.4666fd5 → 1.0.0-beta.3-commit.73fa972

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-Ddi0ioIv.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-Ddi0ioIv.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-Ddi0ioIv.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-Ddi0ioIv.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-COxk9RoQ.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-COxk9RoQ.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-COxk9RoQ.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-COxk9RoQ.mjs";
3
3
  import { parentPort, workerData } from "node:worker_threads";
4
4
 
5
5
  //#region src/parallel-plugin-worker.ts
@@ -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)])),
@@ -527,6 +563,7 @@ const InputOptionsSchema = v.strictObject({
527
563
  v.string("react-jsx"),
528
564
  v.string("preserve")
529
565
  ])),
566
+ transform: v.optional(TransformOptionsSchema),
530
567
  watch: v.optional(v.union([WatchOptionsSchema, v.literal(false)])),
531
568
  dropLabels: v.pipe(v.optional(v.array(v.string())), v.description("Remove labeled statements with these label names")),
532
569
  checks: v.optional(ChecksOptionsSchema),
@@ -1999,6 +2036,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
1999
2036
  },
2000
2037
  profilerNames: inputOptions?.profilerNames,
2001
2038
  jsx: bindingifyJsx(inputOptions.jsx),
2039
+ transform: inputOptions.transform,
2002
2040
  watch: bindingifyWatch(inputOptions.watch),
2003
2041
  dropLabels: inputOptions.dropLabels,
2004
2042
  keepNames: inputOptions.keepNames,
@@ -2749,7 +2787,7 @@ const watch = (input) => {
2749
2787
 
2750
2788
  //#endregion
2751
2789
  //#region package.json
2752
- var version = "1.0.0-beta.3-commit.4666fd5";
2790
+ var version = "1.0.0-beta.3-commit.73fa972";
2753
2791
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2754
2792
 
2755
2793
  //#endregion
@@ -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)])),
@@ -529,6 +565,7 @@ const InputOptionsSchema = valibot.strictObject({
529
565
  valibot.string("react-jsx"),
530
566
  valibot.string("preserve")
531
567
  ])),
568
+ transform: valibot.optional(TransformOptionsSchema),
532
569
  watch: valibot.optional(valibot.union([WatchOptionsSchema, valibot.literal(false)])),
533
570
  dropLabels: valibot.pipe(valibot.optional(valibot.array(valibot.string())), valibot.description("Remove labeled statements with these label names")),
534
571
  checks: valibot.optional(ChecksOptionsSchema),
@@ -2001,6 +2038,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
2001
2038
  },
2002
2039
  profilerNames: inputOptions?.profilerNames,
2003
2040
  jsx: bindingifyJsx(inputOptions.jsx),
2041
+ transform: inputOptions.transform,
2004
2042
  watch: bindingifyWatch(inputOptions.watch),
2005
2043
  dropLabels: inputOptions.dropLabels,
2006
2044
  keepNames: inputOptions.keepNames,
@@ -2751,7 +2789,7 @@ const watch = (input) => {
2751
2789
 
2752
2790
  //#endregion
2753
2791
  //#region package.json
2754
- var version = "1.0.0-beta.3-commit.4666fd5";
2792
+ var version = "1.0.0-beta.3-commit.73fa972";
2755
2793
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2756
2794
 
2757
2795
  //#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
@@ -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;
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.73fa972",
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.73fa972"
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.73fa972",
129
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.3-commit.73fa972",
130
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.3-commit.73fa972",
131
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.3-commit.73fa972",
132
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.3-commit.73fa972",
133
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.3-commit.73fa972",
134
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.3-commit.73fa972",
135
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.3-commit.73fa972",
136
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.3-commit.73fa972",
137
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.3-commit.73fa972",
138
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.3-commit.73fa972",
139
+ "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.3-commit.73fa972"
140
140
  },
141
141
  "scripts": {
142
142
  "# Scrips for binding #": "_",