tsdown 0.18.3 → 0.18.4
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-DlCfPR2i.mjs +794 -0
- package/dist/config-NHDK5cAy.d.mts +16 -0
- package/dist/config.d.mts +3 -13
- package/dist/config.mjs +3 -2
- package/dist/{index-BuAkqPeD.d.mts → index-BfO1W_C3.d.mts} +43 -14
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/{package-deaowsxO.mjs → logger-s1ImI5j1.mjs} +11 -8
- package/dist/package-BZkqghxy.mjs +5 -0
- package/dist/plugins.d.mts +1 -1
- package/dist/plugins.mjs +3 -2
- package/dist/run.mjs +4 -3
- package/dist/{src-D06o_Qq1.mjs → src-DrqLE2Pt.mjs} +18 -678
- package/package.json +6 -6
- package/dist/config-DLSWqKoz.mjs +0 -7
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { f as UserConfig, i as InlineConfig, m as UserConfigFn, p as UserConfigExport } from "./index-BfO1W_C3.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/config/options.d.ts
|
|
4
|
+
declare function mergeConfig(defaults: UserConfig, overrides: UserConfig): UserConfig;
|
|
5
|
+
declare function mergeConfig(defaults: InlineConfig, overrides: InlineConfig): InlineConfig;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/config.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Defines the configuration for tsdown.
|
|
10
|
+
*/
|
|
11
|
+
declare function defineConfig(options: UserConfig): UserConfig;
|
|
12
|
+
declare function defineConfig(options: UserConfig[]): UserConfig[];
|
|
13
|
+
declare function defineConfig(options: UserConfigFn): UserConfigFn;
|
|
14
|
+
declare function defineConfig(options: UserConfigExport): UserConfigExport;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { mergeConfig as n, defineConfig as t };
|
package/dist/config.d.mts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Defines the configuration for tsdown.
|
|
7
|
-
*/
|
|
8
|
-
declare function defineConfig(options: UserConfig): UserConfig;
|
|
9
|
-
declare function defineConfig(options: UserConfig[]): UserConfig[];
|
|
10
|
-
declare function defineConfig(options: UserConfigFn): UserConfigFn;
|
|
11
|
-
declare function defineConfig(options: UserConfigExport): UserConfigExport;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { type UserConfig, type UserConfigExport, type UserConfigFn, defineConfig };
|
|
1
|
+
import { f as UserConfig, m as UserConfigFn, p as UserConfigExport } from "./index-BfO1W_C3.mjs";
|
|
2
|
+
import { n as mergeConfig, t as defineConfig } from "./config-NHDK5cAy.mjs";
|
|
3
|
+
export { UserConfig, UserConfigExport, UserConfigFn, defineConfig, mergeConfig };
|
package/dist/config.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { Hookable } from "hookable";
|
|
|
4
4
|
import { Options as DtsOptions } from "rolldown-plugin-dts";
|
|
5
5
|
import { StartOptions } from "@vitejs/devtools/cli-commands";
|
|
6
6
|
import { CheckPackageOptions } from "@arethetypeswrong/core";
|
|
7
|
-
import { Options
|
|
7
|
+
import { Options } from "publint";
|
|
8
8
|
import { Options as UnusedOptions } from "unplugin-unused";
|
|
9
9
|
|
|
10
10
|
//#region src/utils/types.d.ts
|
|
@@ -43,6 +43,22 @@ interface CopyEntry {
|
|
|
43
43
|
type CopyOptions = Arrayable<string | CopyEntry>;
|
|
44
44
|
type CopyOptionsFn = (options: ResolvedConfig) => Awaitable<CopyOptions>;
|
|
45
45
|
//#endregion
|
|
46
|
+
//#region src/features/css.d.ts
|
|
47
|
+
interface CssOptions {
|
|
48
|
+
/**
|
|
49
|
+
* Enable/disable CSS code splitting.
|
|
50
|
+
* When set to `false`, all CSS in the entire project will be extracted into a single CSS file.
|
|
51
|
+
* When set to `true`, CSS imported in async JS chunks will be preserved as chunks.
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
splitting?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Specify the name of the CSS file.
|
|
57
|
+
* @default 'style.css'
|
|
58
|
+
*/
|
|
59
|
+
fileName?: string;
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
46
62
|
//#region src/features/debug.d.ts
|
|
47
63
|
interface DebugOptions extends NonNullable<InputOptions["debug"]> {
|
|
48
64
|
/**
|
|
@@ -482,6 +498,19 @@ interface TsdownBundle extends AsyncDisposable {
|
|
|
482
498
|
config: ResolvedConfig;
|
|
483
499
|
}
|
|
484
500
|
//#endregion
|
|
501
|
+
//#region src/utils/logger.d.ts
|
|
502
|
+
type LogType = "error" | "warn" | "info";
|
|
503
|
+
type LogLevel = LogType | "silent";
|
|
504
|
+
interface Logger {
|
|
505
|
+
level: LogLevel;
|
|
506
|
+
info: (...args: any[]) => void;
|
|
507
|
+
warn: (...args: any[]) => void;
|
|
508
|
+
warnOnce: (...args: any[]) => void;
|
|
509
|
+
error: (...args: any[]) => void;
|
|
510
|
+
success: (...args: any[]) => void;
|
|
511
|
+
}
|
|
512
|
+
declare const globalLogger: Logger;
|
|
513
|
+
//#endregion
|
|
485
514
|
//#region src/features/pkg/exports.d.ts
|
|
486
515
|
interface ExportsOptions {
|
|
487
516
|
/**
|
|
@@ -491,6 +520,11 @@ interface ExportsOptions {
|
|
|
491
520
|
*/
|
|
492
521
|
devExports?: boolean | string;
|
|
493
522
|
/**
|
|
523
|
+
* Exports for package.json file.
|
|
524
|
+
* @default true
|
|
525
|
+
*/
|
|
526
|
+
packageJson?: boolean;
|
|
527
|
+
/**
|
|
494
528
|
* Exports for all files.
|
|
495
529
|
*/
|
|
496
530
|
all?: boolean;
|
|
@@ -512,18 +546,8 @@ interface ExportsOptions {
|
|
|
512
546
|
}) => Awaitable<Record<string, any>>;
|
|
513
547
|
}
|
|
514
548
|
//#endregion
|
|
515
|
-
//#region src/
|
|
516
|
-
|
|
517
|
-
type LogLevel = LogType | "silent";
|
|
518
|
-
interface Logger {
|
|
519
|
-
level: LogLevel;
|
|
520
|
-
info: (...args: any[]) => void;
|
|
521
|
-
warn: (...args: any[]) => void;
|
|
522
|
-
warnOnce: (...args: any[]) => void;
|
|
523
|
-
error: (...args: any[]) => void;
|
|
524
|
-
success: (...args: any[]) => void;
|
|
525
|
-
}
|
|
526
|
-
declare const globalLogger: Logger;
|
|
549
|
+
//#region src/features/pkg/publint.d.ts
|
|
550
|
+
interface PublintOptions extends Options {}
|
|
527
551
|
//#endregion
|
|
528
552
|
//#region src/features/report.d.ts
|
|
529
553
|
interface ReportOptions {
|
|
@@ -921,6 +945,10 @@ interface UserConfig {
|
|
|
921
945
|
*/
|
|
922
946
|
exports?: WithEnabled<ExportsOptions>;
|
|
923
947
|
/**
|
|
948
|
+
* **[experimental]** CSS options.
|
|
949
|
+
*/
|
|
950
|
+
css?: CssOptions;
|
|
951
|
+
/**
|
|
924
952
|
* @deprecated Alias for `copy`, will be removed in the future.
|
|
925
953
|
*/
|
|
926
954
|
publicDir?: CopyOptions | CopyOptionsFn;
|
|
@@ -977,6 +1005,7 @@ type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "from
|
|
|
977
1005
|
ignoreWatch: Array<string | RegExp>;
|
|
978
1006
|
noExternal?: NoExternalFn;
|
|
979
1007
|
inlineOnly?: Array<string | RegExp>;
|
|
1008
|
+
css: Required<CssOptions>;
|
|
980
1009
|
dts: false | DtsOptions;
|
|
981
1010
|
report: false | ReportOptions;
|
|
982
1011
|
tsconfig: false | string;
|
|
@@ -987,4 +1016,4 @@ type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "from
|
|
|
987
1016
|
unused: false | UnusedOptions;
|
|
988
1017
|
}>;
|
|
989
1018
|
//#endregion
|
|
990
|
-
export { OutExtensionFactory as A,
|
|
1019
|
+
export { OutExtensionFactory as A, CopyOptions as B, RolldownChunk as C, ChunkAddonFunction as D, ChunkAddon as E, RolldownContext as F, TsdownHooks as I, DebugOptions as L, PackageJsonWithPath as M, PackageType as N, ChunkAddonObject as O, BuildContext as P, CssOptions as R, globalLogger as S, AttwOptions as T, CopyOptionsFn as V, ReportOptions as _, NoExternalFn as a, ExportsOptions as b, Sourcemap as c, UnusedOptions as d, UserConfig as f, Workspace as g, WithEnabled as h, InlineConfig as i, OutExtensionObject as j, OutExtensionContext as k, TreeshakingOptions as l, UserConfigFn as m, DtsOptions as n, NormalizedFormat as o, UserConfigExport as p, Format as r, ResolvedConfig as s, CIOption as t, TsdownInputOption as u, ReportPlugin as v, TsdownBundle as w, Logger as x, PublintOptions as y, CopyEntry as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as OutExtensionFactory, B as
|
|
2
|
-
import { defineConfig } from "./config.mjs";
|
|
1
|
+
import { A as OutExtensionFactory, B as CopyOptions, C as RolldownChunk, D as ChunkAddonFunction, E as ChunkAddon, F as RolldownContext, I as TsdownHooks, L as DebugOptions, M as PackageJsonWithPath, N as PackageType, O as ChunkAddonObject, P as BuildContext, R as CssOptions, S as globalLogger, T as AttwOptions, V as CopyOptionsFn, _ as ReportOptions, a as NoExternalFn, b as ExportsOptions, c as Sourcemap, d as UnusedOptions, f as UserConfig, g as Workspace, h as WithEnabled, i as InlineConfig, j as OutExtensionObject, k as OutExtensionContext, l as TreeshakingOptions, m as UserConfigFn, n as DtsOptions, o as NormalizedFormat, p as UserConfigExport, r as Format, s as ResolvedConfig, t as CIOption, u as TsdownInputOption, w as TsdownBundle, x as Logger, y as PublintOptions, z as CopyEntry } from "./index-BfO1W_C3.mjs";
|
|
2
|
+
import { n as mergeConfig, t as defineConfig } from "./config-NHDK5cAy.mjs";
|
|
3
3
|
import * as Rolldown from "rolldown";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
@@ -8,4 +8,4 @@ import * as Rolldown from "rolldown";
|
|
|
8
8
|
*/
|
|
9
9
|
declare function build(userOptions?: InlineConfig): Promise<TsdownBundle[]>;
|
|
10
10
|
//#endregion
|
|
11
|
-
export { AttwOptions, BuildContext, CIOption, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, DebugOptions, DtsOptions, ExportsOptions, Format, InlineConfig, type Logger, NoExternalFn, NormalizedFormat, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageJsonWithPath, PackageType, PublintOptions, ReportOptions, ResolvedConfig, Rolldown, RolldownChunk, RolldownContext, Sourcemap, TreeshakingOptions, TsdownBundle, TsdownHooks, TsdownInputOption, UnusedOptions, UserConfig, UserConfigExport, UserConfigFn, WithEnabled, Workspace, build, defineConfig, globalLogger };
|
|
11
|
+
export { AttwOptions, BuildContext, CIOption, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, CssOptions, DebugOptions, DtsOptions, ExportsOptions, Format, InlineConfig, type Logger, NoExternalFn, NormalizedFormat, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageJsonWithPath, PackageType, PublintOptions, ReportOptions, ResolvedConfig, Rolldown, RolldownChunk, RolldownContext, Sourcemap, TreeshakingOptions, TsdownBundle, TsdownHooks, TsdownInputOption, UnusedOptions, UserConfig, UserConfigExport, UserConfigFn, WithEnabled, Workspace, build, defineConfig, globalLogger, mergeConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { a as globalLogger } from "./logger-s1ImI5j1.mjs";
|
|
2
|
+
import { n as mergeConfig, t as defineConfig } from "./config-DlCfPR2i.mjs";
|
|
3
|
+
import { i as shimFile, n as build, r as buildSingle, t as Rolldown } from "./src-DrqLE2Pt.mjs";
|
|
4
4
|
|
|
5
|
-
export { Rolldown, build, buildSingle, defineConfig, globalLogger, shimFile };
|
|
5
|
+
export { Rolldown, build, buildSingle, defineConfig, globalLogger, mergeConfig, shimFile };
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { createRequire as __cjs_createRequire } from "node:module";
|
|
2
2
|
const __cjs_require = __cjs_createRequire(import.meta.url);
|
|
3
|
-
import {
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
4
|
import process from "node:process";
|
|
5
|
+
import { bgRed, bgYellow, blue, green, rgb, yellow } from "ansis";
|
|
5
6
|
const picomatch = __cjs_require("picomatch");
|
|
6
7
|
|
|
8
|
+
//#region rolldown:runtime
|
|
9
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
7
12
|
//#region src/utils/general.ts
|
|
8
13
|
function toArray(val, defaultValue) {
|
|
9
14
|
if (Array.isArray(val)) return val;
|
|
@@ -39,9 +44,11 @@ function pkgExists(moduleName) {
|
|
|
39
44
|
} catch {}
|
|
40
45
|
return false;
|
|
41
46
|
}
|
|
42
|
-
async function importWithError(moduleName) {
|
|
47
|
+
async function importWithError(moduleName, resolvePaths) {
|
|
48
|
+
let resolved;
|
|
49
|
+
if (resolvePaths) resolved = __require.resolve(moduleName, { paths: resolvePaths });
|
|
43
50
|
try {
|
|
44
|
-
return await import(moduleName);
|
|
51
|
+
return await import(resolved || moduleName);
|
|
45
52
|
} catch (error) {
|
|
46
53
|
throw new Error(`Failed to import module "${moduleName}". Please ensure it is installed.`, { cause: error });
|
|
47
54
|
}
|
|
@@ -163,8 +170,4 @@ function hue2rgb(p, q, t) {
|
|
|
163
170
|
}
|
|
164
171
|
|
|
165
172
|
//#endregion
|
|
166
|
-
|
|
167
|
-
var version = "0.18.3";
|
|
168
|
-
|
|
169
|
-
//#endregion
|
|
170
|
-
export { getNameLabel as a, importWithError as c, pkgExists as d, promiseWithResolvers as f, toArray as g, slash as h, generateColor as i, matchPattern as l, resolveRegex as m, LogLevels as n, globalLogger as o, resolveComma as p, createLogger as r, prettyFormat as s, version as t, noop as u };
|
|
173
|
+
export { globalLogger as a, matchPattern as c, promiseWithResolvers as d, resolveComma as f, toArray as h, getNameLabel as i, noop as l, slash as m, createLogger as n, prettyFormat as o, resolveRegex as p, generateColor as r, importWithError as s, LogLevels as t, pkgExists as u };
|
package/dist/plugins.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as ResolvedConfig, v as ReportPlugin, w as TsdownBundle, x as Logger } from "./index-BfO1W_C3.mjs";
|
|
2
2
|
import { Plugin } from "rolldown";
|
|
3
3
|
|
|
4
4
|
//#region src/features/external.d.ts
|
package/dist/plugins.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./
|
|
1
|
+
import "./logger-s1ImI5j1.mjs";
|
|
2
|
+
import "./config-DlCfPR2i.mjs";
|
|
3
|
+
import { a as WatchPlugin, c as NodeProtocolPlugin, l as ExternalPlugin, o as ShebangPlugin, s as ReportPlugin } from "./src-DrqLE2Pt.mjs";
|
|
3
4
|
|
|
4
5
|
export { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin, WatchPlugin };
|
package/dist/run.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { a as globalLogger, f as resolveComma, h as toArray } from "./logger-s1ImI5j1.mjs";
|
|
3
|
+
import { t as version } from "./package-BZkqghxy.mjs";
|
|
3
4
|
import module from "node:module";
|
|
5
|
+
import process from "node:process";
|
|
4
6
|
import { dim } from "ansis";
|
|
5
|
-
import { VERSION } from "rolldown";
|
|
6
7
|
import { createDebug, enable, namespaces } from "obug";
|
|
7
|
-
import
|
|
8
|
+
import { VERSION } from "rolldown";
|
|
8
9
|
import { x } from "tinyexec";
|
|
9
10
|
import { cac } from "cac";
|
|
10
11
|
|