rolldown 1.0.0-beta.3-commit.73fa972 → 1.0.0-beta.3-commit.f525b7e

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-Ddi0ioIv.cjs');
3
+ const require_src = require('../shared/src-ChJ1GvCL.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-Ddi0ioIv.cjs');
3
+ const require_src = require('../shared/src-ChJ1GvCL.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-Ddi0ioIv.cjs');
1
+ const require_src = require('../shared/src-ChJ1GvCL.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-Ddi0ioIv.cjs');
3
+ const require_src = require('../shared/src-ChJ1GvCL.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-COxk9RoQ.mjs";
2
+ import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-DUUuRKG9.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-COxk9RoQ.mjs";
2
+ import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-DUUuRKG9.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-COxk9RoQ.mjs";
2
+ import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-DUUuRKG9.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-COxk9RoQ.mjs";
2
+ import { PluginContextData, bindingifyPlugin } from "../shared/src-DUUuRKG9.mjs";
3
3
  import { parentPort, workerData } from "node:worker_threads";
4
4
 
5
5
  //#region src/parallel-plugin-worker.ts
@@ -524,7 +524,11 @@ const ResolveOptionsSchema = valibot.strictObject({
524
524
  symlinks: valibot.optional(valibot.boolean()),
525
525
  tsconfigFilename: valibot.optional(valibot.string())
526
526
  });
527
- 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
+ unknownGlobalSideEffects: valibot.optional(valibot.boolean())
531
+ })]);
528
532
  const OnLogSchema = valibot.pipe(valibot.function(), valibot.args(valibot.tuple([
529
533
  LogLevelSchema,
530
534
  RollupLogSchema,
@@ -2160,11 +2164,13 @@ function bindingifyWatch(watch$1) {
2160
2164
  }
2161
2165
  function bindingifyTreeshakeOptions(config) {
2162
2166
  if (config === false) return void 0;
2163
- if (config === true || config === void 0) return {
2167
+ if (config === true || config === void 0) return { moduleSideEffects: true };
2168
+ let normalizedConfig = {
2164
2169
  moduleSideEffects: true,
2165
- annotations: true
2170
+ annotations: config.annotations,
2171
+ manualPureFunctions: config.manualPureFunctions,
2172
+ unknownGlobalSideEffects: config.unknownGlobalSideEffects
2166
2173
  };
2167
- let normalizedConfig = { moduleSideEffects: true };
2168
2174
  if (config.moduleSideEffects === void 0) normalizedConfig.moduleSideEffects = true;
2169
2175
  else if (config.moduleSideEffects === "no-external") normalizedConfig.moduleSideEffects = [{
2170
2176
  external: true,
@@ -2174,7 +2180,6 @@ function bindingifyTreeshakeOptions(config) {
2174
2180
  sideEffects: true
2175
2181
  }];
2176
2182
  else normalizedConfig.moduleSideEffects = config.moduleSideEffects;
2177
- normalizedConfig.annotations = config.annotations ?? true;
2178
2183
  return normalizedConfig;
2179
2184
  }
2180
2185
 
@@ -2655,6 +2660,9 @@ var RolldownBuild = class {
2655
2660
  async [Symbol.asyncDispose]() {
2656
2661
  await this.close();
2657
2662
  }
2663
+ async generateHmrPatch(changedFiles) {
2664
+ return this.#bundler?.bundler.generateHmrPatch(changedFiles);
2665
+ }
2658
2666
  };
2659
2667
 
2660
2668
  //#endregion
@@ -2789,7 +2797,7 @@ const watch = (input) => {
2789
2797
 
2790
2798
  //#endregion
2791
2799
  //#region package.json
2792
- var version = "1.0.0-beta.3-commit.73fa972";
2800
+ var version = "1.0.0-beta.3-commit.f525b7e";
2793
2801
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2794
2802
 
2795
2803
  //#endregion
@@ -522,7 +522,11 @@ const ResolveOptionsSchema = v.strictObject({
522
522
  symlinks: v.optional(v.boolean()),
523
523
  tsconfigFilename: v.optional(v.string())
524
524
  });
525
- 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
+ unknownGlobalSideEffects: v.optional(v.boolean())
529
+ })]);
526
530
  const OnLogSchema = v.pipe(v.function(), v.args(v.tuple([
527
531
  LogLevelSchema,
528
532
  RollupLogSchema,
@@ -2158,11 +2162,13 @@ function bindingifyWatch(watch$1) {
2158
2162
  }
2159
2163
  function bindingifyTreeshakeOptions(config) {
2160
2164
  if (config === false) return void 0;
2161
- if (config === true || config === void 0) return {
2165
+ if (config === true || config === void 0) return { moduleSideEffects: true };
2166
+ let normalizedConfig = {
2162
2167
  moduleSideEffects: true,
2163
- annotations: true
2168
+ annotations: config.annotations,
2169
+ manualPureFunctions: config.manualPureFunctions,
2170
+ unknownGlobalSideEffects: config.unknownGlobalSideEffects
2164
2171
  };
2165
- let normalizedConfig = { moduleSideEffects: true };
2166
2172
  if (config.moduleSideEffects === void 0) normalizedConfig.moduleSideEffects = true;
2167
2173
  else if (config.moduleSideEffects === "no-external") normalizedConfig.moduleSideEffects = [{
2168
2174
  external: true,
@@ -2172,7 +2178,6 @@ function bindingifyTreeshakeOptions(config) {
2172
2178
  sideEffects: true
2173
2179
  }];
2174
2180
  else normalizedConfig.moduleSideEffects = config.moduleSideEffects;
2175
- normalizedConfig.annotations = config.annotations ?? true;
2176
2181
  return normalizedConfig;
2177
2182
  }
2178
2183
 
@@ -2653,6 +2658,9 @@ var RolldownBuild = class {
2653
2658
  async [Symbol.asyncDispose]() {
2654
2659
  await this.close();
2655
2660
  }
2661
+ async generateHmrPatch(changedFiles) {
2662
+ return this.#bundler?.bundler.generateHmrPatch(changedFiles);
2663
+ }
2656
2664
  };
2657
2665
 
2658
2666
  //#endregion
@@ -2787,7 +2795,7 @@ const watch = (input) => {
2787
2795
 
2788
2796
  //#endregion
2789
2797
  //#region package.json
2790
- var version = "1.0.0-beta.3-commit.73fa972";
2798
+ var version = "1.0.0-beta.3-commit.f525b7e";
2791
2799
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2792
2800
 
2793
2801
  //#endregion
@@ -9,4 +9,5 @@ export declare class RolldownBuild {
9
9
  write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
10
10
  close(): Promise<void>;
11
11
  [Symbol.asyncDispose](): Promise<void>;
12
+ generateHmrPatch(changedFiles: string[]): Promise<string | void>;
12
13
  }
@@ -663,6 +663,8 @@ export interface BindingTransformPluginConfig {
663
663
  export interface BindingTreeshake {
664
664
  moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ((id: string, is_external: boolean) => boolean | undefined)
665
665
  annotations?: boolean
666
+ manualPureFunctions?: Array<string>
667
+ unknownGlobalSideEffects?: boolean
666
668
  }
667
669
 
668
670
  export interface BindingViteResolvePluginConfig {
@@ -7,4 +7,6 @@ export type ModuleSideEffectsOption = boolean | ModuleSideEffectsRule[] | ((id:
7
7
  export type TreeshakingOptions = {
8
8
  moduleSideEffects?: ModuleSideEffectsOption;
9
9
  annotations?: boolean;
10
+ manualPureFunctions?: string[];
11
+ unknownGlobalSideEffects?: boolean;
10
12
  } | boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.3-commit.73fa972",
3
+ "version": "1.0.0-beta.3-commit.f525b7e",
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.73fa972"
125
+ "rolldown": "1.0.0-beta.3-commit.f525b7e"
126
126
  },
127
127
  "optionalDependencies": {
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"
128
+ "@rolldown/binding-darwin-arm64": "1.0.0-beta.3-commit.f525b7e",
129
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.3-commit.f525b7e",
130
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.3-commit.f525b7e",
131
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.3-commit.f525b7e",
132
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.3-commit.f525b7e",
133
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.3-commit.f525b7e",
134
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.3-commit.f525b7e",
135
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.3-commit.f525b7e",
136
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.3-commit.f525b7e",
137
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.3-commit.f525b7e",
138
+ "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.3-commit.f525b7e",
139
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.3-commit.f525b7e"
140
140
  },
141
141
  "scripts": {
142
142
  "# Scrips for binding #": "_",