rolldown 1.0.0-beta.1-commit.1cf4d0d → 1.0.0-beta.1-commit.b123256
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 +37 -13
- package/dist/cjs/experimental-index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/parallel-plugin-worker.cjs +1 -1
- package/dist/esm/cli.mjs +39 -15
- package/dist/esm/experimental-index.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/parallel-plugin-worker.mjs +1 -1
- package/dist/shared/{consola_36c0034f-D9ce-831.mjs → consola_36c0034f-DnM2mwLf.mjs} +3 -3
- package/dist/shared/{prompt-DlQ-08lk.mjs → prompt-DhKXGIIR.mjs} +1 -1
- package/dist/shared/{src-DeY44sKD.cjs → src-C7T4jx6P.cjs} +3 -2
- package/dist/shared/{src-D8jIFfIN.mjs → src-VaG16McJ.mjs} +3 -2
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/binding.d.ts +1 -0
- package/dist/types/cli/load-config.d.ts +1 -1
- package/dist/types/options/output-options.d.ts +2 -0
- package/package.json +14 -14
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-
|
|
3
|
+
const require_src = require('../shared/src-C7T4jx6P.cjs');
|
|
4
4
|
const require_consola_36c0034f = require('../shared/consola_36c0034f-C_-uQ5ge.cjs');
|
|
5
5
|
const node_fs = require_chunk.__toESM(require("node:fs"));
|
|
6
6
|
const zod = require_chunk.__toESM(require("zod"));
|
|
@@ -10,6 +10,7 @@ const node_perf_hooks = require_chunk.__toESM(require("node:perf_hooks"));
|
|
|
10
10
|
const tty = require_chunk.__toESM(require("tty"));
|
|
11
11
|
const node_util = require_chunk.__toESM(require("node:util"));
|
|
12
12
|
const node_tty = require_chunk.__toESM(require("node:tty"));
|
|
13
|
+
const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
|
|
13
14
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
14
15
|
|
|
15
16
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
@@ -287,14 +288,6 @@ function createTestingLogger() {
|
|
|
287
288
|
|
|
288
289
|
//#endregion
|
|
289
290
|
//#region src/cli/load-config.ts
|
|
290
|
-
async function loadTsConfig(configFile) {
|
|
291
|
-
const file = await bundleTsConfig(configFile);
|
|
292
|
-
try {
|
|
293
|
-
return (await import((0, node_url.pathToFileURL)(file).href)).default;
|
|
294
|
-
} finally {
|
|
295
|
-
node_fs.default.unlink(file, () => {});
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
291
|
async function bundleTsConfig(configFile) {
|
|
299
292
|
const dirnameVarName = "injected_original_dirname";
|
|
300
293
|
const filenameVarName = "injected_original_filename";
|
|
@@ -347,8 +340,25 @@ const SUPPORTED_TS_CONFIG_FORMATS = [
|
|
|
347
340
|
".cts"
|
|
348
341
|
];
|
|
349
342
|
const SUPPORTED_CONFIG_FORMATS = [...SUPPORTED_JS_CONFIG_FORMATS, ...SUPPORTED_TS_CONFIG_FORMATS];
|
|
343
|
+
const DEFAULT_CONFIG_BASE = "rolldown.config";
|
|
344
|
+
async function findConfigFileNameInCwd() {
|
|
345
|
+
const filesInWorkingDirectory = new Set(await (0, node_fs_promises.readdir)((0, node_process.cwd)()));
|
|
346
|
+
for (const extension of SUPPORTED_CONFIG_FORMATS) {
|
|
347
|
+
const fileName = `${DEFAULT_CONFIG_BASE}${extension}`;
|
|
348
|
+
if (filesInWorkingDirectory.has(fileName)) return fileName;
|
|
349
|
+
}
|
|
350
|
+
throw new Error("No `rolldown.config` configuration file found.");
|
|
351
|
+
}
|
|
352
|
+
async function loadTsConfig(configFile) {
|
|
353
|
+
const file = await bundleTsConfig(configFile);
|
|
354
|
+
try {
|
|
355
|
+
return (await import((0, node_url.pathToFileURL)(file).href)).default;
|
|
356
|
+
} finally {
|
|
357
|
+
node_fs.default.unlink(file, () => {});
|
|
358
|
+
}
|
|
359
|
+
}
|
|
350
360
|
async function loadConfig(configPath) {
|
|
351
|
-
const ext = node_path.default.extname(configPath);
|
|
361
|
+
const ext = node_path.default.extname(configPath = configPath || await findConfigFileNameInCwd());
|
|
352
362
|
try {
|
|
353
363
|
if (SUPPORTED_JS_CONFIG_FORMATS.includes(ext) || process.env.NODE_OPTIONS?.includes("--import=tsx") && SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return (await import((0, node_url.pathToFileURL)(configPath).href)).default;
|
|
354
364
|
else if (SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) {
|
|
@@ -1694,7 +1704,21 @@ const outputOptionsSchema = zod.z.strictObject({
|
|
|
1694
1704
|
minShareCount: zod.z.number().optional()
|
|
1695
1705
|
})).optional()
|
|
1696
1706
|
}).optional(),
|
|
1697
|
-
comments: zod.z.enum(["none", "preserve-legal"]).describe("Control comments in the output").optional()
|
|
1707
|
+
comments: zod.z.enum(["none", "preserve-legal"]).describe("Control comments in the output").optional(),
|
|
1708
|
+
target: zod.z.enum([
|
|
1709
|
+
"es6",
|
|
1710
|
+
"es2015",
|
|
1711
|
+
"es2016",
|
|
1712
|
+
"es2017",
|
|
1713
|
+
"es2018",
|
|
1714
|
+
"es2019",
|
|
1715
|
+
"es2020",
|
|
1716
|
+
"es2021",
|
|
1717
|
+
"es2022",
|
|
1718
|
+
"es2023",
|
|
1719
|
+
"es2024",
|
|
1720
|
+
"esnext"
|
|
1721
|
+
]).describe("The JavaScript target environment.").optional()
|
|
1698
1722
|
});
|
|
1699
1723
|
const getAddonDescription = (placement, wrapper) => {
|
|
1700
1724
|
return `Code to insert the ${colors.bold(placement)} of the bundled file (${colors.bold(wrapper)} the wrapper function)`;
|
|
@@ -1825,7 +1849,7 @@ function normalizeCliOptions(cliOptions, positionals) {
|
|
|
1825
1849
|
version: options$1.version ?? false,
|
|
1826
1850
|
watch: options$1.watch ?? false
|
|
1827
1851
|
};
|
|
1828
|
-
if (typeof options$1.config === "string") result.config = options$1.config
|
|
1852
|
+
if (typeof options$1.config === "string") result.config = options$1.config;
|
|
1829
1853
|
const reservedKeys = [
|
|
1830
1854
|
"help",
|
|
1831
1855
|
"version",
|
|
@@ -2007,7 +2031,7 @@ function showHelp() {
|
|
|
2007
2031
|
//#region src/cli/index.ts
|
|
2008
2032
|
async function main() {
|
|
2009
2033
|
const cliOptions = parseCliArguments();
|
|
2010
|
-
if (cliOptions.config) {
|
|
2034
|
+
if (cliOptions.config || cliOptions.config === "") {
|
|
2011
2035
|
await bundleWithConfig(cliOptions.config, cliOptions);
|
|
2012
2036
|
return;
|
|
2013
2037
|
}
|
|
@@ -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-
|
|
3
|
+
const require_src = require('../shared/src-C7T4jx6P.cjs');
|
|
4
4
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
5
5
|
|
|
6
6
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/cjs/index.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-
|
|
3
|
+
const require_src = require('../shared/src-C7T4jx6P.cjs');
|
|
4
4
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
5
5
|
|
|
6
6
|
//#region src/parallel-plugin-worker.ts
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, arraify, description, rolldown, version, watch } from "../shared/src-
|
|
2
|
-
import { createConsola } from "../shared/consola_36c0034f-
|
|
1
|
+
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, arraify, description, rolldown, version, watch } from "../shared/src-VaG16McJ.mjs";
|
|
2
|
+
import { createConsola } from "../shared/consola_36c0034f-DnM2mwLf.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { ZodFirstPartyTypeKind, z } from "zod";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
import process$1, { env } from "node:process";
|
|
6
|
+
import process$1, { cwd, env } from "node:process";
|
|
7
7
|
import { performance } from "node:perf_hooks";
|
|
8
8
|
import * as tty from "tty";
|
|
9
9
|
import { parseArgs } from "node:util";
|
|
10
|
+
import { readdir } from "node:fs/promises";
|
|
10
11
|
import { pathToFileURL } from "node:url";
|
|
11
12
|
|
|
12
13
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
@@ -284,14 +285,6 @@ function createTestingLogger() {
|
|
|
284
285
|
|
|
285
286
|
//#endregion
|
|
286
287
|
//#region src/cli/load-config.ts
|
|
287
|
-
async function loadTsConfig(configFile) {
|
|
288
|
-
const file = await bundleTsConfig(configFile);
|
|
289
|
-
try {
|
|
290
|
-
return (await import(pathToFileURL(file).href)).default;
|
|
291
|
-
} finally {
|
|
292
|
-
fs.unlink(file, () => {});
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
288
|
async function bundleTsConfig(configFile) {
|
|
296
289
|
const dirnameVarName = "injected_original_dirname";
|
|
297
290
|
const filenameVarName = "injected_original_filename";
|
|
@@ -344,8 +337,25 @@ const SUPPORTED_TS_CONFIG_FORMATS = [
|
|
|
344
337
|
".cts"
|
|
345
338
|
];
|
|
346
339
|
const SUPPORTED_CONFIG_FORMATS = [...SUPPORTED_JS_CONFIG_FORMATS, ...SUPPORTED_TS_CONFIG_FORMATS];
|
|
340
|
+
const DEFAULT_CONFIG_BASE = "rolldown.config";
|
|
341
|
+
async function findConfigFileNameInCwd() {
|
|
342
|
+
const filesInWorkingDirectory = new Set(await readdir(cwd()));
|
|
343
|
+
for (const extension of SUPPORTED_CONFIG_FORMATS) {
|
|
344
|
+
const fileName = `${DEFAULT_CONFIG_BASE}${extension}`;
|
|
345
|
+
if (filesInWorkingDirectory.has(fileName)) return fileName;
|
|
346
|
+
}
|
|
347
|
+
throw new Error("No `rolldown.config` configuration file found.");
|
|
348
|
+
}
|
|
349
|
+
async function loadTsConfig(configFile) {
|
|
350
|
+
const file = await bundleTsConfig(configFile);
|
|
351
|
+
try {
|
|
352
|
+
return (await import(pathToFileURL(file).href)).default;
|
|
353
|
+
} finally {
|
|
354
|
+
fs.unlink(file, () => {});
|
|
355
|
+
}
|
|
356
|
+
}
|
|
347
357
|
async function loadConfig(configPath) {
|
|
348
|
-
const ext = path.extname(configPath);
|
|
358
|
+
const ext = path.extname(configPath = configPath || await findConfigFileNameInCwd());
|
|
349
359
|
try {
|
|
350
360
|
if (SUPPORTED_JS_CONFIG_FORMATS.includes(ext) || process.env.NODE_OPTIONS?.includes("--import=tsx") && SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return (await import(pathToFileURL(configPath).href)).default;
|
|
351
361
|
else if (SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) {
|
|
@@ -1691,7 +1701,21 @@ const outputOptionsSchema = z.strictObject({
|
|
|
1691
1701
|
minShareCount: z.number().optional()
|
|
1692
1702
|
})).optional()
|
|
1693
1703
|
}).optional(),
|
|
1694
|
-
comments: z.enum(["none", "preserve-legal"]).describe("Control comments in the output").optional()
|
|
1704
|
+
comments: z.enum(["none", "preserve-legal"]).describe("Control comments in the output").optional(),
|
|
1705
|
+
target: z.enum([
|
|
1706
|
+
"es6",
|
|
1707
|
+
"es2015",
|
|
1708
|
+
"es2016",
|
|
1709
|
+
"es2017",
|
|
1710
|
+
"es2018",
|
|
1711
|
+
"es2019",
|
|
1712
|
+
"es2020",
|
|
1713
|
+
"es2021",
|
|
1714
|
+
"es2022",
|
|
1715
|
+
"es2023",
|
|
1716
|
+
"es2024",
|
|
1717
|
+
"esnext"
|
|
1718
|
+
]).describe("The JavaScript target environment.").optional()
|
|
1695
1719
|
});
|
|
1696
1720
|
const getAddonDescription = (placement, wrapper) => {
|
|
1697
1721
|
return `Code to insert the ${colors.bold(placement)} of the bundled file (${colors.bold(wrapper)} the wrapper function)`;
|
|
@@ -1822,7 +1846,7 @@ function normalizeCliOptions(cliOptions, positionals) {
|
|
|
1822
1846
|
version: options$1.version ?? false,
|
|
1823
1847
|
watch: options$1.watch ?? false
|
|
1824
1848
|
};
|
|
1825
|
-
if (typeof options$1.config === "string") result.config = options$1.config
|
|
1849
|
+
if (typeof options$1.config === "string") result.config = options$1.config;
|
|
1826
1850
|
const reservedKeys = [
|
|
1827
1851
|
"help",
|
|
1828
1852
|
"version",
|
|
@@ -2004,7 +2028,7 @@ function showHelp() {
|
|
|
2004
2028
|
//#region src/cli/index.ts
|
|
2005
2029
|
async function main() {
|
|
2006
2030
|
const cliOptions = parseCliArguments();
|
|
2007
|
-
if (cliOptions.config) {
|
|
2031
|
+
if (cliOptions.config || cliOptions.config === "") {
|
|
2008
2032
|
await bundleWithConfig(cliOptions.config, cliOptions);
|
|
2009
2033
|
return;
|
|
2010
2034
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPlugin, __toESM, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-
|
|
1
|
+
import { BuiltinPlugin, __toESM, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-VaG16McJ.mjs";
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src-
|
|
1
|
+
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src-VaG16McJ.mjs";
|
|
2
2
|
import { parentPort, workerData } from "node:worker_threads";
|
|
3
3
|
|
|
4
4
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -298,8 +298,8 @@ function createConsola$1(options = {}) {
|
|
|
298
298
|
//#endregion
|
|
299
299
|
//#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.06ad8a64.mjs
|
|
300
300
|
function parseStack(stack) {
|
|
301
|
-
const cwd = process.cwd() + sep;
|
|
302
|
-
const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
|
|
301
|
+
const cwd$1 = process.cwd() + sep;
|
|
302
|
+
const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd$1, ""));
|
|
303
303
|
return lines;
|
|
304
304
|
}
|
|
305
305
|
function writeStream(data, stream) {
|
|
@@ -815,7 +815,7 @@ function createConsola(options = {}) {
|
|
|
815
815
|
defaults: { level },
|
|
816
816
|
stdout: process.stdout,
|
|
817
817
|
stderr: process.stderr,
|
|
818
|
-
prompt: (...args) => import("./prompt-
|
|
818
|
+
prompt: (...args) => import("./prompt-DhKXGIIR.mjs").then((m) => m.prompt(...args)),
|
|
819
819
|
reporters: options.reporters || [options.fancy ?? !(isCI || isTest) ? new FancyReporter() : new BasicReporter()],
|
|
820
820
|
...options
|
|
821
821
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colors, getDefaultExportFromCjs, isUnicodeSupported } from "./consola_36c0034f-
|
|
1
|
+
import { colors, getDefaultExportFromCjs, isUnicodeSupported } from "./consola_36c0034f-DnM2mwLf.mjs";
|
|
2
2
|
import { stdin, stdout } from "node:process";
|
|
3
3
|
import require$$0 from "tty";
|
|
4
4
|
import { WriteStream } from "node:tty";
|
|
@@ -2171,7 +2171,8 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
2171
2171
|
externalLiveBindings: outputOptions.externalLiveBindings,
|
|
2172
2172
|
inlineDynamicImports: outputOptions.inlineDynamicImports,
|
|
2173
2173
|
advancedChunks: outputOptions.advancedChunks,
|
|
2174
|
-
polyfillRequire: outputOptions.polyfillRequire
|
|
2174
|
+
polyfillRequire: outputOptions.polyfillRequire,
|
|
2175
|
+
target: outputOptions.target
|
|
2175
2176
|
};
|
|
2176
2177
|
}
|
|
2177
2178
|
function bindingifyAddon(configAddon) {
|
|
@@ -2817,7 +2818,7 @@ const watch = (input) => {
|
|
|
2817
2818
|
|
|
2818
2819
|
//#endregion
|
|
2819
2820
|
//#region package.json
|
|
2820
|
-
var version = "1.0.0-beta.1-commit.
|
|
2821
|
+
var version = "1.0.0-beta.1-commit.b123256";
|
|
2821
2822
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2822
2823
|
|
|
2823
2824
|
//#endregion
|
|
@@ -2197,7 +2197,8 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
2197
2197
|
externalLiveBindings: outputOptions.externalLiveBindings,
|
|
2198
2198
|
inlineDynamicImports: outputOptions.inlineDynamicImports,
|
|
2199
2199
|
advancedChunks: outputOptions.advancedChunks,
|
|
2200
|
-
polyfillRequire: outputOptions.polyfillRequire
|
|
2200
|
+
polyfillRequire: outputOptions.polyfillRequire,
|
|
2201
|
+
target: outputOptions.target
|
|
2201
2202
|
};
|
|
2202
2203
|
}
|
|
2203
2204
|
function bindingifyAddon(configAddon) {
|
|
@@ -2843,7 +2844,7 @@ const watch = (input) => {
|
|
|
2843
2844
|
|
|
2844
2845
|
//#endregion
|
|
2845
2846
|
//#region package.json
|
|
2846
|
-
var version = "1.0.0-beta.1-commit.
|
|
2847
|
+
var version = "1.0.0-beta.1-commit.b123256";
|
|
2847
2848
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2848
2849
|
|
|
2849
2850
|
//#endregion
|