tsdown 0.16.7 → 0.16.8
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/{config-BYPCbyiH.d.mts → config-qCTuQ4uL.d.mts} +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/{index-QuvuIHHG.d.mts → index-k1oOp_n4.d.mts} +14 -10
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/{migrate-D4tWVkLj.mjs → migrate-nFQ0dxbr.mjs} +1 -1
- package/dist/{package-DMmUaSu9.mjs → package-BDAjF-Kz.mjs} +1 -1
- package/dist/plugins.d.mts +1 -1
- package/dist/plugins.mjs +2 -2
- package/dist/run.mjs +2 -2
- package/dist/{src-CBlanU1_.mjs → src-EBZO44R8.mjs} +60 -45
- package/package.json +9 -9
package/dist/config.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { f as UserConfig, m as UserConfigFn, p as UserConfigExport } from "./index-
|
|
2
|
-
import { t as defineConfig } from "./config-
|
|
1
|
+
import { f as UserConfig, m as UserConfigFn, p as UserConfigExport } from "./index-k1oOp_n4.mjs";
|
|
2
|
+
import { t as defineConfig } from "./config-qCTuQ4uL.mjs";
|
|
3
3
|
export { UserConfig, UserConfigExport, UserConfigFn, defineConfig };
|
|
@@ -23,11 +23,11 @@ interface AttwOptions extends CheckPackageOptions {
|
|
|
23
23
|
* The available profiles are:
|
|
24
24
|
* - `strict`: requires all resolutions
|
|
25
25
|
* - `node16`: ignores node10 resolution failures
|
|
26
|
-
* - `
|
|
26
|
+
* - `esm-only`: ignores CJS resolution failures
|
|
27
27
|
*
|
|
28
28
|
* @default 'strict'
|
|
29
29
|
*/
|
|
30
|
-
profile?: "strict" | "node16" | "
|
|
30
|
+
profile?: "strict" | "node16" | "esm-only";
|
|
31
31
|
/**
|
|
32
32
|
* The level of the check.
|
|
33
33
|
*
|
|
@@ -201,6 +201,10 @@ interface Workspace {
|
|
|
201
201
|
}
|
|
202
202
|
type NoExternalFn = (id: string, importer: string | undefined) => boolean | null | undefined | void;
|
|
203
203
|
type CIOption = "ci-only" | "local-only";
|
|
204
|
+
type WithEnabled<T> = boolean | undefined | CIOption | (T & {
|
|
205
|
+
/** @default true */
|
|
206
|
+
enabled?: boolean | CIOption;
|
|
207
|
+
});
|
|
204
208
|
/**
|
|
205
209
|
* Options for tsdown.
|
|
206
210
|
*/
|
|
@@ -452,7 +456,7 @@ interface UserConfig {
|
|
|
452
456
|
*
|
|
453
457
|
* @default false
|
|
454
458
|
*/
|
|
455
|
-
debug?:
|
|
459
|
+
debug?: WithEnabled<DebugOptions>;
|
|
456
460
|
/**
|
|
457
461
|
* Enables generation of TypeScript declaration files (`.d.ts`).
|
|
458
462
|
*
|
|
@@ -460,19 +464,19 @@ interface UserConfig {
|
|
|
460
464
|
* - If the `types` field is present, or if the main `exports` contains a `types` entry, declaration file generation is enabled by default.
|
|
461
465
|
* - Otherwise, declaration file generation is disabled by default.
|
|
462
466
|
*/
|
|
463
|
-
dts?:
|
|
467
|
+
dts?: WithEnabled<DtsOptions>;
|
|
464
468
|
/**
|
|
465
469
|
* Enable unused dependencies check with `unplugin-unused`
|
|
466
470
|
* Requires `unplugin-unused` to be installed.
|
|
467
471
|
* @default false
|
|
468
472
|
*/
|
|
469
|
-
unused?:
|
|
473
|
+
unused?: WithEnabled<UnusedOptions>;
|
|
470
474
|
/**
|
|
471
475
|
* Run publint after bundling.
|
|
472
476
|
* Requires `publint` to be installed.
|
|
473
477
|
* @default false
|
|
474
478
|
*/
|
|
475
|
-
publint?:
|
|
479
|
+
publint?: WithEnabled<PublintOptions>;
|
|
476
480
|
/**
|
|
477
481
|
* Run `arethetypeswrong` after bundling.
|
|
478
482
|
* Requires `@arethetypeswrong/core` to be installed.
|
|
@@ -480,12 +484,12 @@ interface UserConfig {
|
|
|
480
484
|
* @default false
|
|
481
485
|
* @see https://github.com/arethetypeswrong/arethetypeswrong.github.io
|
|
482
486
|
*/
|
|
483
|
-
attw?:
|
|
487
|
+
attw?: WithEnabled<AttwOptions>;
|
|
484
488
|
/**
|
|
485
489
|
* Enable size reporting after bundling.
|
|
486
490
|
* @default true
|
|
487
491
|
*/
|
|
488
|
-
report?:
|
|
492
|
+
report?: WithEnabled<ReportOptions>;
|
|
489
493
|
/**
|
|
490
494
|
* `import.meta.glob` support.
|
|
491
495
|
* @see https://vite.dev/guide/features.html#glob-import
|
|
@@ -498,7 +502,7 @@ interface UserConfig {
|
|
|
498
502
|
* This will set the `main`, `module`, `types`, `exports` fields in `package.json`
|
|
499
503
|
* to point to the generated files.
|
|
500
504
|
*/
|
|
501
|
-
exports?:
|
|
505
|
+
exports?: WithEnabled<ExportsOptions>;
|
|
502
506
|
/**
|
|
503
507
|
* @deprecated Alias for `copy`, will be removed in the future.
|
|
504
508
|
*/
|
|
@@ -560,4 +564,4 @@ type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "from
|
|
|
560
564
|
unused: false | UnusedOptions;
|
|
561
565
|
}>;
|
|
562
566
|
//#endregion
|
|
563
|
-
export {
|
|
567
|
+
export { TsdownHooks as A, ChunkAddonObject as C, PackageType as D, OutExtensionObject as E, CopyOptions as F, CopyOptionsFn as I, AttwOptions as L, TsdownChunks as M, DebugOptions as N, BuildContext as O, CopyEntry as P, ChunkAddonFunction as S, OutExtensionFactory as T, ReportOptions as _, NoExternalFn as a, globalLogger as b, ResolvedConfig as c, UnusedOptions as d, UserConfig as f, Workspace as g, WithEnabled as h, InlineConfig as i, ExportsOptions as j, RolldownContext as k, Sourcemap as l, UserConfigFn as m, DtsOptions as n, NormalizedFormat as o, UserConfigExport as p, Format as r, PublintOptions as s, CIOption as t, TreeshakingOptions as u, ReportPlugin as v, OutExtensionContext as w, ChunkAddon as x, Logger as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { t as defineConfig } from "./config-
|
|
1
|
+
import { A as TsdownHooks, C as ChunkAddonObject, D as PackageType, E as OutExtensionObject, F as CopyOptions, I as CopyOptionsFn, L as AttwOptions, M as TsdownChunks, N as DebugOptions, O as BuildContext, P as CopyEntry, S as ChunkAddonFunction, T as OutExtensionFactory, _ as ReportOptions, a as NoExternalFn, b as globalLogger, c as ResolvedConfig, d as UnusedOptions, f as UserConfig, g as Workspace, h as WithEnabled, i as InlineConfig, j as ExportsOptions, k as RolldownContext, l as Sourcemap, m as UserConfigFn, n as DtsOptions, o as NormalizedFormat, p as UserConfigExport, r as Format, s as PublintOptions, t as CIOption, u as TreeshakingOptions, w as OutExtensionContext, x as ChunkAddon, y as Logger } from "./index-k1oOp_n4.mjs";
|
|
2
|
+
import { t as defineConfig } from "./config-qCTuQ4uL.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
5
|
|
|
@@ -19,4 +19,4 @@ declare const shimFile: string;
|
|
|
19
19
|
*/
|
|
20
20
|
declare function buildSingle(config: ResolvedConfig, clean: () => Promise<void>): Promise<(() => Promise<void>) | undefined>;
|
|
21
21
|
//#endregion
|
|
22
|
-
export { AttwOptions, BuildContext, CIOption, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, DebugOptions, DtsOptions, ExportsOptions, Format, InlineConfig, type Logger, NoExternalFn, NormalizedFormat, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageType, PublintOptions, ReportOptions, ResolvedConfig, RolldownContext, Sourcemap, TreeshakingOptions, TsdownChunks, TsdownHooks, UnusedOptions, UserConfig, UserConfigExport, UserConfigFn, Workspace, build, buildSingle, defineConfig, globalLogger, shimFile };
|
|
22
|
+
export { AttwOptions, BuildContext, CIOption, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, DebugOptions, DtsOptions, ExportsOptions, Format, InlineConfig, type Logger, NoExternalFn, NormalizedFormat, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageType, PublintOptions, ReportOptions, ResolvedConfig, RolldownContext, Sourcemap, TreeshakingOptions, TsdownChunks, TsdownHooks, UnusedOptions, UserConfig, UserConfigExport, UserConfigFn, WithEnabled, Workspace, build, buildSingle, defineConfig, globalLogger, shimFile };
|
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-EBZO44R8.mjs";
|
|
3
|
+
import { a as globalLogger } from "./package-BDAjF-Kz.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-BDAjF-Kz.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.8";
|
|
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.d.mts
CHANGED
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-EBZO44R8.mjs";
|
|
3
|
+
import "./package-BDAjF-Kz.mjs";
|
|
4
4
|
|
|
5
5
|
export { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin };
|
package/dist/run.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-BDAjF-Kz.mjs";
|
|
3
3
|
import module from "node:module";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import { dim } from "ansis";
|
|
@@ -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-nFQ0dxbr.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-BDAjF-Kz.mjs";
|
|
4
4
|
import { builtinModules, isBuiltin } from "node:module";
|
|
5
5
|
import path, { dirname, join, normalize, sep } from "node:path";
|
|
6
6
|
import process, { env } from "node:process";
|
|
@@ -665,15 +665,19 @@ async function mergeUserOptions(defaults, user, args) {
|
|
|
665
665
|
};
|
|
666
666
|
}
|
|
667
667
|
function resolveFeatureOption(value, defaults) {
|
|
668
|
-
if (value ===
|
|
669
|
-
|
|
670
|
-
|
|
668
|
+
if (typeof value === "object" && value !== null) return resolveCIOption(value.enabled ?? true) ? value : false;
|
|
669
|
+
return resolveCIOption(value) ? defaults : false;
|
|
670
|
+
}
|
|
671
|
+
function resolveCIOption(value) {
|
|
672
|
+
if (value === "ci-only") return is_in_ci_default ? true : false;
|
|
673
|
+
if (value === "local-only") return is_in_ci_default ? false : true;
|
|
671
674
|
return value;
|
|
672
675
|
}
|
|
673
676
|
|
|
674
677
|
//#endregion
|
|
675
678
|
//#region src/features/attw.ts
|
|
676
679
|
const debug$4 = createDebug("tsdown:attw");
|
|
680
|
+
const label$1 = dim`[attw]`;
|
|
677
681
|
/**
|
|
678
682
|
* ATTW profiles.
|
|
679
683
|
* Defines the resolution modes to ignore for each profile.
|
|
@@ -683,44 +687,24 @@ const debug$4 = createDebug("tsdown:attw");
|
|
|
683
687
|
const profiles = {
|
|
684
688
|
strict: [],
|
|
685
689
|
node16: ["node10"],
|
|
686
|
-
|
|
690
|
+
"esm-only": ["node10", "node16-cjs"]
|
|
687
691
|
};
|
|
688
|
-
/**
|
|
689
|
-
* Format an ATTW problem for display
|
|
690
|
-
*/
|
|
691
|
-
function formatProblem(problem) {
|
|
692
|
-
const resolutionKind = "resolutionKind" in problem ? ` (${problem.resolutionKind})` : "";
|
|
693
|
-
const entrypoint = "entrypoint" in problem ? ` at ${problem.entrypoint}` : "";
|
|
694
|
-
switch (problem.kind) {
|
|
695
|
-
case "NoResolution": return ` ❌ No resolution${resolutionKind}${entrypoint}`;
|
|
696
|
-
case "UntypedResolution": return ` ⚠️ Untyped resolution${resolutionKind}${entrypoint}`;
|
|
697
|
-
case "FalseESM": return ` 🔄 False ESM: Types indicate ESM (${problem.typesModuleKind}) but implementation is CJS (${problem.implementationModuleKind})\n Types: ${problem.typesFileName} | Implementation: ${problem.implementationFileName}`;
|
|
698
|
-
case "FalseCJS": return ` 🔄 False CJS: Types indicate CJS (${problem.typesModuleKind}) but implementation is ESM (${problem.implementationModuleKind})\n Types: ${problem.typesFileName} | Implementation: ${problem.implementationFileName}`;
|
|
699
|
-
case "CJSResolvesToESM": return ` ⚡ CJS resolves to ESM${resolutionKind}${entrypoint}`;
|
|
700
|
-
case "NamedExports": {
|
|
701
|
-
const missingExports = problem.missing?.length > 0 ? ` Missing: ${problem.missing.join(", ")}` : "";
|
|
702
|
-
return ` 📤 Named exports problem${problem.isMissingAllNamed ? " (all named exports missing)" : ""}${missingExports}\n Types: ${problem.typesFileName} | Implementation: ${problem.implementationFileName}`;
|
|
703
|
-
}
|
|
704
|
-
case "FallbackCondition": return ` 🎯 Fallback condition used${resolutionKind}${entrypoint}`;
|
|
705
|
-
case "FalseExportDefault": return ` 🎭 False export default\n Types: ${problem.typesFileName} | Implementation: ${problem.implementationFileName}`;
|
|
706
|
-
case "MissingExportEquals": return ` 📝 Missing export equals\n Types: ${problem.typesFileName} | Implementation: ${problem.implementationFileName}`;
|
|
707
|
-
case "InternalResolutionError": return ` 💥 Internal resolution error in ${problem.fileName} (${problem.resolutionOption})\n Module: ${problem.moduleSpecifier} | Mode: ${problem.resolutionMode}`;
|
|
708
|
-
case "UnexpectedModuleSyntax": return ` 📋 Unexpected module syntax in ${problem.fileName}\n Expected: ${problem.moduleKind} | Found: ${problem.syntax === 99 ? "ESM" : "CJS"}`;
|
|
709
|
-
case "CJSOnlyExportsDefault": return ` 🏷️ CJS only exports default in ${problem.fileName}`;
|
|
710
|
-
default: return ` ❓ Unknown problem: ${JSON.stringify(problem)}`;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
692
|
async function attw(options) {
|
|
714
693
|
if (!options.attw) return;
|
|
715
694
|
if (!options.pkg) {
|
|
716
695
|
options.logger.warn("attw is enabled but package.json is not found");
|
|
717
696
|
return;
|
|
718
697
|
}
|
|
719
|
-
|
|
698
|
+
let { profile = "strict", level = "warn", ...attwOptions } = options.attw;
|
|
699
|
+
if (profile === "esmOnly") {
|
|
700
|
+
options.logger.warn("attw option \"esmOnly\" is deprecated, use \"esm-only\" instead");
|
|
701
|
+
profile = "esm-only";
|
|
702
|
+
}
|
|
720
703
|
const t = performance.now();
|
|
721
704
|
debug$4("Running attw check");
|
|
722
705
|
const tempDir = await mkdtemp(path.join(tmpdir(), "tsdown-attw-"));
|
|
723
706
|
const attwCore = await importWithError("@arethetypeswrong/core");
|
|
707
|
+
let checkResult;
|
|
724
708
|
try {
|
|
725
709
|
const { stdout: tarballInfo } = await exec("npm", [
|
|
726
710
|
"pack",
|
|
@@ -732,25 +716,55 @@ async function attw(options) {
|
|
|
732
716
|
if (!Array.isArray(parsed) || !parsed[0]?.filename) throw new Error("Invalid npm pack output format");
|
|
733
717
|
const tarball = await readFile(path.join(tempDir, parsed[0].filename));
|
|
734
718
|
const pkg = attwCore.createPackageFromTarballData(tarball);
|
|
735
|
-
|
|
736
|
-
if (checkResult.types !== false && checkResult.problems.length) {
|
|
737
|
-
const problems = checkResult.problems.filter((problem) => {
|
|
738
|
-
if ("resolutionKind" in problem) return !profiles[profile]?.includes(problem.resolutionKind);
|
|
739
|
-
return true;
|
|
740
|
-
});
|
|
741
|
-
if (problems.length) {
|
|
742
|
-
const problemMessage = `Are the types wrong problems found:\n${problems.map(formatProblem).join("\n")}`;
|
|
743
|
-
if (level === "error") throw new Error(problemMessage);
|
|
744
|
-
options.logger.warn(prettyName(options.name), problemMessage);
|
|
745
|
-
}
|
|
746
|
-
} else options.logger.success(prettyName(options.name), `No Are the types wrong problems found`, dim`(${Math.round(performance.now() - t)}ms)`);
|
|
719
|
+
checkResult = await attwCore.checkPackage(pkg, attwOptions);
|
|
747
720
|
} catch (error) {
|
|
748
721
|
options.logger.error("ATTW check failed:", error);
|
|
749
722
|
debug$4("Found errors, setting exit code to 1");
|
|
750
723
|
process.exitCode = 1;
|
|
724
|
+
return;
|
|
751
725
|
} finally {
|
|
752
726
|
await fsRemove(tempDir);
|
|
753
727
|
}
|
|
728
|
+
let errorMessage;
|
|
729
|
+
if (checkResult.types) {
|
|
730
|
+
const problems = checkResult.problems.filter((problem) => {
|
|
731
|
+
if ("resolutionKind" in problem) return !profiles[profile]?.includes(problem.resolutionKind);
|
|
732
|
+
return true;
|
|
733
|
+
});
|
|
734
|
+
if (problems.length) errorMessage = `problems found:\n${problems.map(formatProblem).join("\n")}`;
|
|
735
|
+
} else errorMessage = `Package has no types`;
|
|
736
|
+
if (errorMessage) {
|
|
737
|
+
options.logger[level](prettyName(options.name), label$1, errorMessage);
|
|
738
|
+
if (level === "error") {
|
|
739
|
+
process.exitCode = 1;
|
|
740
|
+
debug$4("Found problems, setting exit code to 1");
|
|
741
|
+
}
|
|
742
|
+
} else options.logger.success(prettyName(options.name), label$1, "No problems found", dim`(${Math.round(performance.now() - t)}ms)`);
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Format an ATTW problem for display
|
|
746
|
+
*/
|
|
747
|
+
function formatProblem(problem) {
|
|
748
|
+
const resolutionKind = "resolutionKind" in problem ? ` (${problem.resolutionKind})` : "";
|
|
749
|
+
const entrypoint = "entrypoint" in problem ? ` at ${problem.entrypoint}` : "";
|
|
750
|
+
switch (problem.kind) {
|
|
751
|
+
case "NoResolution": return ` ❌ No resolution${resolutionKind}${entrypoint}`;
|
|
752
|
+
case "UntypedResolution": return ` ⚠️ Untyped resolution${resolutionKind}${entrypoint}`;
|
|
753
|
+
case "FalseESM": return ` 🔄 False ESM: Types indicate ESM (${problem.typesModuleKind}) but implementation is CJS (${problem.implementationModuleKind})\n Types: ${problem.typesFileName} | Implementation: ${problem.implementationFileName}`;
|
|
754
|
+
case "FalseCJS": return ` 🔄 False CJS: Types indicate CJS (${problem.typesModuleKind}) but implementation is ESM (${problem.implementationModuleKind})\n Types: ${problem.typesFileName} | Implementation: ${problem.implementationFileName}`;
|
|
755
|
+
case "CJSResolvesToESM": return ` ⚡ CJS resolves to ESM${resolutionKind}${entrypoint}`;
|
|
756
|
+
case "NamedExports": {
|
|
757
|
+
const missingExports = problem.missing?.length > 0 ? ` Missing: ${problem.missing.join(", ")}` : "";
|
|
758
|
+
return ` 📤 Named exports problem${problem.isMissingAllNamed ? " (all named exports missing)" : ""}${missingExports}\n Types: ${problem.typesFileName} | Implementation: ${problem.implementationFileName}`;
|
|
759
|
+
}
|
|
760
|
+
case "FallbackCondition": return ` 🎯 Fallback condition used${resolutionKind}${entrypoint}`;
|
|
761
|
+
case "FalseExportDefault": return ` 🎭 False export default\n Types: ${problem.typesFileName} | Implementation: ${problem.implementationFileName}`;
|
|
762
|
+
case "MissingExportEquals": return ` 📝 Missing export equals\n Types: ${problem.typesFileName} | Implementation: ${problem.implementationFileName}`;
|
|
763
|
+
case "InternalResolutionError": return ` 💥 Internal resolution error in ${problem.fileName} (${problem.resolutionOption})\n Module: ${problem.moduleSpecifier} | Mode: ${problem.resolutionMode}`;
|
|
764
|
+
case "UnexpectedModuleSyntax": return ` 📋 Unexpected module syntax in ${problem.fileName}\n Expected: ${problem.moduleKind} | Found: ${problem.syntax === 99 ? "ESM" : "CJS"}`;
|
|
765
|
+
case "CJSOnlyExportsDefault": return ` 🏷️ CJS only exports default in ${problem.fileName}`;
|
|
766
|
+
default: return ` ❓ Unknown problem: ${JSON.stringify(problem)}`;
|
|
767
|
+
}
|
|
754
768
|
}
|
|
755
769
|
|
|
756
770
|
//#endregion
|
|
@@ -801,6 +815,7 @@ async function createHooks$1(options) {
|
|
|
801
815
|
//#endregion
|
|
802
816
|
//#region src/features/publint.ts
|
|
803
817
|
const debug$3 = createDebug("tsdown:publint");
|
|
818
|
+
const label = dim`[publint]`;
|
|
804
819
|
async function publint(options) {
|
|
805
820
|
if (!options.publint) return;
|
|
806
821
|
if (!options.pkg) {
|
|
@@ -817,7 +832,7 @@ async function publint(options) {
|
|
|
817
832
|
});
|
|
818
833
|
debug$3("Found %d issues", messages.length);
|
|
819
834
|
if (!messages.length) {
|
|
820
|
-
options.logger.success(prettyName(options.name),
|
|
835
|
+
options.logger.success(prettyName(options.name), label, "No issues found", dim`(${Math.round(performance.now() - t)}ms)`);
|
|
821
836
|
return;
|
|
822
837
|
}
|
|
823
838
|
let hasError = false;
|
|
@@ -829,7 +844,7 @@ async function publint(options) {
|
|
|
829
844
|
warning: "warn",
|
|
830
845
|
suggestion: "info"
|
|
831
846
|
}[message.type];
|
|
832
|
-
options.logger[logType](prettyName(options.name), formattedMessage);
|
|
847
|
+
options.logger[logType](prettyName(options.name), label, formattedMessage);
|
|
833
848
|
}
|
|
834
849
|
if (hasError) {
|
|
835
850
|
debug$3("Found errors, setting exit code to 1");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsdown",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.8",
|
|
4
4
|
"description": "The Elegant Bundler for Libraries",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -75,43 +75,43 @@
|
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"ansis": "^4.2.0",
|
|
77
77
|
"cac": "^6.7.14",
|
|
78
|
-
"chokidar": "^
|
|
78
|
+
"chokidar": "^5.0.0",
|
|
79
79
|
"diff": "^8.0.2",
|
|
80
80
|
"empathic": "^2.0.0",
|
|
81
81
|
"hookable": "^5.5.3",
|
|
82
82
|
"obug": "^2.1.1",
|
|
83
|
-
"rolldown": "1.0.0-beta.
|
|
83
|
+
"rolldown": "1.0.0-beta.52",
|
|
84
84
|
"rolldown-plugin-dts": "^0.18.1",
|
|
85
85
|
"semver": "^7.7.3",
|
|
86
86
|
"tinyexec": "^1.0.2",
|
|
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.13"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@arethetypeswrong/core": "^0.18.2",
|
|
94
94
|
"@sxzz/eslint-config": "^7.3.2",
|
|
95
|
-
"@sxzz/prettier-config": "^2.2.
|
|
95
|
+
"@sxzz/prettier-config": "^2.2.6",
|
|
96
96
|
"@sxzz/test-utils": "^0.5.13",
|
|
97
97
|
"@types/node": "^24.10.1",
|
|
98
98
|
"@types/semver": "^7.7.1",
|
|
99
99
|
"@unocss/eslint-plugin": "^66.5.9",
|
|
100
100
|
"@vitejs/devtools": "^0.0.0-alpha.18",
|
|
101
|
-
"@vueuse/core": "^14.
|
|
102
|
-
"bumpp": "^10.3.
|
|
101
|
+
"@vueuse/core": "^14.1.0",
|
|
102
|
+
"bumpp": "^10.3.2",
|
|
103
103
|
"eslint": "^9.39.1",
|
|
104
104
|
"is-in-ci": "^2.0.0",
|
|
105
105
|
"lightningcss": "^1.30.2",
|
|
106
106
|
"pkg-types": "^2.3.0",
|
|
107
|
-
"prettier": "^3.
|
|
107
|
+
"prettier": "^3.7.1",
|
|
108
108
|
"publint": "^0.3.15",
|
|
109
109
|
"rolldown-plugin-require-cjs": "^0.3.1",
|
|
110
110
|
"typescript": "~5.9.3",
|
|
111
111
|
"unocss": "^66.5.9",
|
|
112
112
|
"unplugin-lightningcss": "^0.4.3",
|
|
113
113
|
"unplugin-unused": "^0.5.6",
|
|
114
|
-
"vite": "npm:rolldown-vite@^7.2.
|
|
114
|
+
"vite": "npm:rolldown-vite@^7.2.8",
|
|
115
115
|
"vitest": "^4.0.14"
|
|
116
116
|
},
|
|
117
117
|
"engines": {
|