tsdown 0.16.4 → 0.16.5
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/index.mjs +2 -2
- package/dist/{migrate-Cxbt-lPD.mjs → migrate--7fCsmlD.mjs} +1 -1
- package/dist/{package-2depcwF3.mjs → package-B-bDWI0Z.mjs} +1 -1
- package/dist/plugins.mjs +2 -2
- package/dist/run.mjs +7 -7
- package/dist/{src-DoHg27jj.mjs → src-BVEBYPUN.mjs} +22 -12
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as defineConfig } from "./config-DLSWqKoz.mjs";
|
|
2
|
-
import { n as buildSingle, r as shimFile, t as build } from "./src-
|
|
3
|
-
import { a as globalLogger } from "./package-
|
|
2
|
+
import { n as buildSingle, r as shimFile, t as build } from "./src-BVEBYPUN.mjs";
|
|
3
|
+
import { a as globalLogger } from "./package-B-bDWI0Z.mjs";
|
|
4
4
|
|
|
5
5
|
export { build, buildSingle, defineConfig, globalLogger, shimFile };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as globalLogger, t as version } from "./package-
|
|
1
|
+
import { a as globalLogger, t as version } from "./package-B-bDWI0Z.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { bold, green, underline } from "ansis";
|
|
4
4
|
import { readFile, unlink, writeFile } from "node:fs/promises";
|
|
@@ -160,7 +160,7 @@ function hue2rgb(p, q, t) {
|
|
|
160
160
|
|
|
161
161
|
//#endregion
|
|
162
162
|
//#region package.json
|
|
163
|
-
var version = "0.16.
|
|
163
|
+
var version = "0.16.5";
|
|
164
164
|
|
|
165
165
|
//#endregion
|
|
166
166
|
export { globalLogger as a, debounce as c, noop as d, pkgExists as f, toArray as g, slash as h, generateColor as i, importWithError as l, resolveRegex as m, LogLevels as n, prettyFormat as o, resolveComma as p, createLogger as r, prettyName as s, version as t, matchPattern as u };
|
package/dist/plugins.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./config-DLSWqKoz.mjs";
|
|
2
|
-
import { a as ReportPlugin, i as ShebangPlugin, o as NodeProtocolPlugin, s as ExternalPlugin } from "./src-
|
|
3
|
-
import "./package-
|
|
2
|
+
import { a as ReportPlugin, i as ShebangPlugin, o as NodeProtocolPlugin, s as ExternalPlugin } from "./src-BVEBYPUN.mjs";
|
|
3
|
+
import "./package-B-bDWI0Z.mjs";
|
|
4
4
|
|
|
5
5
|
export { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin };
|
package/dist/run.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as globalLogger, g as toArray, p as resolveComma, t as version } from "./package-
|
|
2
|
+
import { a as globalLogger, g as toArray, p as resolveComma, t as version } from "./package-B-bDWI0Z.mjs";
|
|
3
3
|
import module from "node:module";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import { dim } from "ansis";
|
|
6
6
|
import { VERSION } from "rolldown";
|
|
7
|
-
import
|
|
7
|
+
import { createDebug, enable, namespaces } from "obug";
|
|
8
8
|
import { cac } from "cac";
|
|
9
9
|
|
|
10
10
|
//#region src/features/debug.ts
|
|
11
|
-
const debug =
|
|
11
|
+
const debug = createDebug("tsdown:debug");
|
|
12
12
|
function enableDebugLog(cliOptions) {
|
|
13
13
|
const { debugLogs } = cliOptions;
|
|
14
14
|
if (!debugLogs) return;
|
|
15
15
|
let namespace;
|
|
16
16
|
if (debugLogs === true) namespace = "tsdown:*";
|
|
17
17
|
else namespace = resolveComma(toArray(debugLogs)).map((v) => `tsdown:${v}`).join(",");
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
|
|
18
|
+
const ns = namespaces();
|
|
19
|
+
if (ns) namespace += `,${ns}`;
|
|
20
|
+
enable(namespace);
|
|
21
21
|
debug("Debugging enabled", namespace);
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -36,7 +36,7 @@ cli.command("[...files]", "Bundle files", {
|
|
|
36
36
|
await build$1(flags);
|
|
37
37
|
});
|
|
38
38
|
cli.command("migrate", "Migrate from tsup to tsdown").option("-c, --cwd <dir>", "Working directory").option("-d, --dry-run", "Dry run").action(async (args) => {
|
|
39
|
-
const { migrate } = await import("./migrate
|
|
39
|
+
const { migrate } = await import("./migrate--7fCsmlD.mjs");
|
|
40
40
|
await migrate(args);
|
|
41
41
|
});
|
|
42
42
|
async function runCLI() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __cjs_createRequire } from "node:module";
|
|
2
2
|
const __cjs_require = __cjs_createRequire(import.meta.url);
|
|
3
|
-
import { a as globalLogger, c as debounce, d as noop, f as pkgExists, g as toArray, h as slash, i as generateColor, l as importWithError, m as resolveRegex, n as LogLevels, o as prettyFormat, p as resolveComma, r as createLogger, s as prettyName, t as version, u as matchPattern } from "./package-
|
|
3
|
+
import { a as globalLogger, c as debounce, d as noop, f as pkgExists, g as toArray, h as slash, i as generateColor, l as importWithError, m as resolveRegex, n as LogLevels, o as prettyFormat, p as resolveComma, r as createLogger, s as prettyName, t as version, u as matchPattern } from "./package-B-bDWI0Z.mjs";
|
|
4
4
|
import { builtinModules, isBuiltin } from "node:module";
|
|
5
5
|
import path, { dirname, join, normalize, sep } from "node:path";
|
|
6
6
|
import process from "node:process";
|
|
@@ -10,7 +10,7 @@ import { VERSION, build } from "rolldown";
|
|
|
10
10
|
import { exec } from "tinyexec";
|
|
11
11
|
const treeKill = __cjs_require("tree-kill");
|
|
12
12
|
import { access, chmod, cp, mkdtemp, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
13
|
-
import
|
|
13
|
+
import { createDebug } from "obug";
|
|
14
14
|
import { createConfigCoreLoader } from "unconfig-core";
|
|
15
15
|
import { glob, isDynamicPattern } from "tinyglobby";
|
|
16
16
|
import { RE_CSS, RE_DTS, RE_JS, RE_NODE_MODULES } from "rolldown-plugin-dts/filename";
|
|
@@ -68,7 +68,7 @@ function lowestCommonAncestor(...filepaths) {
|
|
|
68
68
|
|
|
69
69
|
//#endregion
|
|
70
70
|
//#region src/config/config.ts
|
|
71
|
-
const debug$8 =
|
|
71
|
+
const debug$8 = createDebug("tsdown:config");
|
|
72
72
|
async function loadViteConfig(prefix, cwd, configLoader) {
|
|
73
73
|
const loader = resolveConfigLoader(configLoader);
|
|
74
74
|
debug$8("Loading Vite config via loader: ", loader);
|
|
@@ -198,7 +198,7 @@ async function unrunImport(id) {
|
|
|
198
198
|
|
|
199
199
|
//#endregion
|
|
200
200
|
//#region src/features/clean.ts
|
|
201
|
-
const debug$7 =
|
|
201
|
+
const debug$7 = createDebug("tsdown:clean");
|
|
202
202
|
const RE_LAST_SLASH = /[/\\]$/;
|
|
203
203
|
async function cleanOutDir(configs) {
|
|
204
204
|
const removes = /* @__PURE__ */ new Set();
|
|
@@ -278,10 +278,20 @@ async function writeExports(options, chunks) {
|
|
|
278
278
|
updatedPkg.publishConfig.exports = publishExports;
|
|
279
279
|
}
|
|
280
280
|
const original = await readFile(pkg.packageJsonPath, "utf8");
|
|
281
|
-
let contents = JSON.stringify(updatedPkg, null, original
|
|
281
|
+
let contents = JSON.stringify(updatedPkg, null, detectIndent(original));
|
|
282
282
|
if (original.endsWith("\n")) contents += "\n";
|
|
283
283
|
if (contents !== original) await writeFile(pkg.packageJsonPath, contents, "utf8");
|
|
284
284
|
}
|
|
285
|
+
function detectIndent(jsonText) {
|
|
286
|
+
const lines = jsonText.split(/\r?\n/);
|
|
287
|
+
for (const line of lines) {
|
|
288
|
+
const match = line.match(/^(\s+)\S/);
|
|
289
|
+
if (!match) continue;
|
|
290
|
+
if (match[1].includes(" ")) return " ";
|
|
291
|
+
return match[1].length;
|
|
292
|
+
}
|
|
293
|
+
return 2;
|
|
294
|
+
}
|
|
285
295
|
async function generateExports(pkg, outDir, chunks, { devExports, all, customExports }) {
|
|
286
296
|
const pkgJsonPath = pkg.packageJsonPath;
|
|
287
297
|
const pkgRoot$1 = path.dirname(pkgJsonPath);
|
|
@@ -433,7 +443,7 @@ async function resolveTsconfig(logger, tsconfig, cwd, name) {
|
|
|
433
443
|
|
|
434
444
|
//#endregion
|
|
435
445
|
//#region src/utils/package.ts
|
|
436
|
-
const debug$6 =
|
|
446
|
+
const debug$6 = createDebug("tsdown:package");
|
|
437
447
|
async function readPackageJson(dir) {
|
|
438
448
|
const packageJsonPath = up$1({ cwd: dir });
|
|
439
449
|
if (!packageJsonPath) return;
|
|
@@ -465,7 +475,7 @@ function normalizeFormat(format) {
|
|
|
465
475
|
|
|
466
476
|
//#endregion
|
|
467
477
|
//#region src/config/index.ts
|
|
468
|
-
const debug$5 =
|
|
478
|
+
const debug$5 = createDebug("tsdown:options");
|
|
469
479
|
const DEFAULT_EXCLUDE_WORKSPACE = [
|
|
470
480
|
"**/node_modules/**",
|
|
471
481
|
"**/dist/**",
|
|
@@ -649,7 +659,7 @@ async function mergeUserOptions(defaults, user, args) {
|
|
|
649
659
|
|
|
650
660
|
//#endregion
|
|
651
661
|
//#region src/features/attw.ts
|
|
652
|
-
const debug$4 =
|
|
662
|
+
const debug$4 = createDebug("tsdown:attw");
|
|
653
663
|
/**
|
|
654
664
|
* ATTW profiles.
|
|
655
665
|
* Defines the resolution modes to ignore for each profile.
|
|
@@ -776,7 +786,7 @@ async function createHooks$1(options) {
|
|
|
776
786
|
|
|
777
787
|
//#endregion
|
|
778
788
|
//#region src/features/publint.ts
|
|
779
|
-
const debug$3 =
|
|
789
|
+
const debug$3 = createDebug("tsdown:publint");
|
|
780
790
|
async function publint(options) {
|
|
781
791
|
if (!options.publint) return;
|
|
782
792
|
if (!options.pkg) {
|
|
@@ -815,7 +825,7 @@ async function publint(options) {
|
|
|
815
825
|
|
|
816
826
|
//#endregion
|
|
817
827
|
//#region src/features/external.ts
|
|
818
|
-
const debug$2 =
|
|
828
|
+
const debug$2 = createDebug("tsdown:external");
|
|
819
829
|
function ExternalPlugin({ pkg, noExternal, inlineOnly, skipNodeModulesBundle }) {
|
|
820
830
|
const deps = pkg && Array.from(getProductionDeps(pkg));
|
|
821
831
|
return {
|
|
@@ -1010,7 +1020,7 @@ function formatBytes(bytes) {
|
|
|
1010
1020
|
|
|
1011
1021
|
//#endregion
|
|
1012
1022
|
//#region src/features/report.ts
|
|
1013
|
-
const debug$1 =
|
|
1023
|
+
const debug$1 = createDebug("tsdown:report");
|
|
1014
1024
|
const brotliCompressAsync = promisify(brotliCompress);
|
|
1015
1025
|
const gzipAsync = promisify(gzip);
|
|
1016
1026
|
const defaultOptions = {
|
|
@@ -1121,7 +1131,7 @@ function getShimsInject(format, platform) {
|
|
|
1121
1131
|
|
|
1122
1132
|
//#endregion
|
|
1123
1133
|
//#region src/features/rolldown.ts
|
|
1124
|
-
const debug =
|
|
1134
|
+
const debug = createDebug("tsdown:rolldown");
|
|
1125
1135
|
async function getBuildOptions(config, format, isMultiFormat, cjsDts = false) {
|
|
1126
1136
|
const inputOptions = await resolveInputOptions(config, format, cjsDts, isMultiFormat);
|
|
1127
1137
|
const outputOptions = await resolveOutputOptions(inputOptions, config, format, cjsDts);
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsdown",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.5",
|
|
4
4
|
"description": "The Elegant Bundler for Libraries",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"homepage": "
|
|
7
|
+
"homepage": "http://tsdown.dev/",
|
|
8
8
|
"bugs": {
|
|
9
9
|
"url": "https://github.com/rolldown/tsdown/issues"
|
|
10
10
|
},
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"diff": "^8.0.2",
|
|
80
80
|
"empathic": "^2.0.0",
|
|
81
81
|
"hookable": "^5.5.3",
|
|
82
|
-
"obug": "^
|
|
82
|
+
"obug": "^2.0.0",
|
|
83
83
|
"rolldown": "1.0.0-beta.50",
|
|
84
84
|
"rolldown-plugin-dts": "^0.17.7",
|
|
85
85
|
"semver": "^7.7.3",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"tinyglobby": "^0.2.15",
|
|
88
88
|
"tree-kill": "^1.2.2",
|
|
89
89
|
"unconfig-core": "^7.4.1",
|
|
90
|
-
"unrun": "^0.2.
|
|
90
|
+
"unrun": "^0.2.10"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@arethetypeswrong/core": "^0.18.2",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"unplugin-lightningcss": "^0.4.3",
|
|
112
112
|
"unplugin-unused": "^0.5.6",
|
|
113
113
|
"vite": "npm:rolldown-vite@^7.2.5",
|
|
114
|
-
"vitest": "^4.0.
|
|
114
|
+
"vitest": "^4.0.9"
|
|
115
115
|
},
|
|
116
116
|
"engines": {
|
|
117
117
|
"node": ">=20.19.0"
|