tsdown 0.17.0-beta.3 → 0.17.0-beta.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/{config-LvwttpKK.d.mts → config-DPU-roRC.d.mts} +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/{index-C9klZ7SZ.d.mts → index-BQZ2CZuJ.d.mts} +80 -61
- package/dist/index.d.mts +5 -7
- package/dist/index.mjs +2 -2
- package/dist/{package-C_EvEUSK.mjs → package-CxZ5olT1.mjs} +11 -2
- package/dist/plugins.d.mts +9 -3
- package/dist/plugins.mjs +3 -3
- package/dist/run.mjs +3 -3
- package/dist/{src-B28M8gGv.mjs → src-ipppZiPk.mjs} +373 -273
- package/package.json +3 -2
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-BQZ2CZuJ.mjs";
|
|
2
|
+
import { t as defineConfig } from "./config-DPU-roRC.mjs";
|
|
3
3
|
export { UserConfig, UserConfigExport, UserConfigFn, defineConfig };
|
|
@@ -2,9 +2,9 @@ import "ansis";
|
|
|
2
2
|
import { BuildOptions, ExternalOption, InputOption, InputOptions, InternalModuleFormat, MinifyOptions, ModuleFormat, ModuleTypes, OutputAsset, OutputChunk, OutputOptions, Plugin, TreeshakingOptions } from "rolldown";
|
|
3
3
|
import { Hookable } from "hookable";
|
|
4
4
|
import { Options as DtsOptions } from "rolldown-plugin-dts";
|
|
5
|
-
import { CheckPackageOptions } from "@arethetypeswrong/core";
|
|
6
5
|
import { StartOptions } from "@vitejs/devtools/cli-commands";
|
|
7
6
|
import { PackageJson } from "pkg-types";
|
|
7
|
+
import { CheckPackageOptions } from "@arethetypeswrong/core";
|
|
8
8
|
import { Options as PublintOptions } from "publint";
|
|
9
9
|
import { Options as UnusedOptions } from "unplugin-unused";
|
|
10
10
|
|
|
@@ -14,32 +14,6 @@ type Awaitable<T> = T | Promise<T>;
|
|
|
14
14
|
type MarkPartial<T, K extends keyof T> = Omit<Required<T>, K> & Partial<Pick<T, K>>;
|
|
15
15
|
type Arrayable<T> = T | T[];
|
|
16
16
|
//#endregion
|
|
17
|
-
//#region src/features/attw.d.ts
|
|
18
|
-
interface AttwOptions extends CheckPackageOptions {
|
|
19
|
-
/**
|
|
20
|
-
* Profiles select a set of resolution modes to require/ignore. All are evaluated but failures outside
|
|
21
|
-
* of those required are ignored.
|
|
22
|
-
*
|
|
23
|
-
* The available profiles are:
|
|
24
|
-
* - `strict`: requires all resolutions
|
|
25
|
-
* - `node16`: ignores node10 resolution failures
|
|
26
|
-
* - `esm-only`: ignores CJS resolution failures
|
|
27
|
-
*
|
|
28
|
-
* @default 'strict'
|
|
29
|
-
*/
|
|
30
|
-
profile?: "strict" | "node16" | "esm-only";
|
|
31
|
-
/**
|
|
32
|
-
* The level of the check.
|
|
33
|
-
*
|
|
34
|
-
* The available levels are:
|
|
35
|
-
* - `error`: fails the build
|
|
36
|
-
* - `warn`: warns the build
|
|
37
|
-
*
|
|
38
|
-
* @default 'warn'
|
|
39
|
-
*/
|
|
40
|
-
level?: "error" | "warn";
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
17
|
//#region src/features/copy.d.ts
|
|
44
18
|
interface CopyEntry {
|
|
45
19
|
from: string;
|
|
@@ -64,27 +38,6 @@ interface DebugOptions extends NonNullable<InputOptions["debug"]> {
|
|
|
64
38
|
clean?: boolean;
|
|
65
39
|
}
|
|
66
40
|
//#endregion
|
|
67
|
-
//#region src/features/exports.d.ts
|
|
68
|
-
type TsdownChunks = Partial<Record<NormalizedFormat, Array<OutputChunk | OutputAsset>>>;
|
|
69
|
-
interface ExportsOptions {
|
|
70
|
-
/**
|
|
71
|
-
* Generate exports that link to source code during development.
|
|
72
|
-
* - string: add as a custom condition.
|
|
73
|
-
* - true: all conditions point to source files, and add dist exports to `publishConfig`.
|
|
74
|
-
*/
|
|
75
|
-
devExports?: boolean | string;
|
|
76
|
-
/**
|
|
77
|
-
* Exports for all files.
|
|
78
|
-
*/
|
|
79
|
-
all?: boolean;
|
|
80
|
-
customExports?: (exports: Record<string, any>, context: {
|
|
81
|
-
pkg: PackageJson;
|
|
82
|
-
chunks: TsdownChunks;
|
|
83
|
-
outDir: string;
|
|
84
|
-
isPublish: boolean;
|
|
85
|
-
}) => Awaitable<Record<string, any>>;
|
|
86
|
-
}
|
|
87
|
-
//#endregion
|
|
88
41
|
//#region src/features/hooks.d.ts
|
|
89
42
|
interface BuildContext {
|
|
90
43
|
options: ResolvedConfig;
|
|
@@ -112,10 +65,15 @@ interface TsdownHooks {
|
|
|
112
65
|
* Invoked after each tsdown build completes.
|
|
113
66
|
* Use this hook for cleanup or post-processing tasks.
|
|
114
67
|
*/
|
|
115
|
-
"build:done": (ctx: BuildContext
|
|
68
|
+
"build:done": (ctx: BuildContext & {
|
|
69
|
+
chunks: RolldownChunk[];
|
|
70
|
+
}) => void | Promise<void>;
|
|
116
71
|
}
|
|
117
72
|
//#endregion
|
|
118
73
|
//#region src/utils/package.d.ts
|
|
74
|
+
interface PackageJsonWithPath extends PackageJson {
|
|
75
|
+
packageJsonPath: string;
|
|
76
|
+
}
|
|
119
77
|
type PackageType = "module" | "commonjs" | undefined;
|
|
120
78
|
//#endregion
|
|
121
79
|
//#region src/features/output.d.ts
|
|
@@ -141,6 +99,61 @@ type ChunkAddonFunction = (ctx: {
|
|
|
141
99
|
}) => ChunkAddonObject | string | undefined;
|
|
142
100
|
type ChunkAddon = ChunkAddonObject | ChunkAddonFunction | string;
|
|
143
101
|
//#endregion
|
|
102
|
+
//#region src/features/pkg/attw.d.ts
|
|
103
|
+
interface AttwOptions extends CheckPackageOptions {
|
|
104
|
+
/**
|
|
105
|
+
* Profiles select a set of resolution modes to require/ignore. All are evaluated but failures outside
|
|
106
|
+
* of those required are ignored.
|
|
107
|
+
*
|
|
108
|
+
* The available profiles are:
|
|
109
|
+
* - `strict`: requires all resolutions
|
|
110
|
+
* - `node16`: ignores node10 resolution failures
|
|
111
|
+
* - `esm-only`: ignores CJS resolution failures
|
|
112
|
+
*
|
|
113
|
+
* @default 'strict'
|
|
114
|
+
*/
|
|
115
|
+
profile?: "strict" | "node16" | "esm-only";
|
|
116
|
+
/**
|
|
117
|
+
* The level of the check.
|
|
118
|
+
*
|
|
119
|
+
* The available levels are:
|
|
120
|
+
* - `error`: fails the build
|
|
121
|
+
* - `warn`: warns the build
|
|
122
|
+
*
|
|
123
|
+
* @default 'warn'
|
|
124
|
+
*/
|
|
125
|
+
level?: "error" | "warn";
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/utils/chunks.d.ts
|
|
129
|
+
type RolldownChunk = (OutputChunk | OutputAsset) & {
|
|
130
|
+
outDir: string;
|
|
131
|
+
};
|
|
132
|
+
type ChunksByFormat = Partial<Record<NormalizedFormat, RolldownChunk[]>>;
|
|
133
|
+
interface TsdownBundle extends AsyncDisposable {
|
|
134
|
+
chunks: RolldownChunk[];
|
|
135
|
+
config: ResolvedConfig;
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/features/pkg/exports.d.ts
|
|
139
|
+
interface ExportsOptions {
|
|
140
|
+
/**
|
|
141
|
+
* Generate exports that link to source code during development.
|
|
142
|
+
* - string: add as a custom condition.
|
|
143
|
+
* - true: all conditions point to source files, and add dist exports to `publishConfig`.
|
|
144
|
+
*/
|
|
145
|
+
devExports?: boolean | string;
|
|
146
|
+
/**
|
|
147
|
+
* Exports for all files.
|
|
148
|
+
*/
|
|
149
|
+
all?: boolean;
|
|
150
|
+
customExports?: (exports: Record<string, any>, context: {
|
|
151
|
+
pkg: PackageJson;
|
|
152
|
+
chunks: ChunksByFormat;
|
|
153
|
+
isPublish: boolean;
|
|
154
|
+
}) => Awaitable<Record<string, any>>;
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
144
157
|
//#region src/utils/logger.d.ts
|
|
145
158
|
type LogType = "error" | "warn" | "info";
|
|
146
159
|
type LogLevel = LogType | "silent";
|
|
@@ -176,7 +189,7 @@ interface ReportOptions {
|
|
|
176
189
|
*/
|
|
177
190
|
maxCompressSize?: number;
|
|
178
191
|
}
|
|
179
|
-
declare function ReportPlugin(userOptions: ReportOptions, logger: Logger, cwd: string, cjsDts?: boolean, name?: string,
|
|
192
|
+
declare function ReportPlugin(userOptions: ReportOptions, logger: Logger, cwd: string, cjsDts?: boolean, name?: string, isDualFormat?: boolean): Plugin;
|
|
180
193
|
//#endregion
|
|
181
194
|
//#region src/config/types.d.ts
|
|
182
195
|
type Sourcemap = boolean | "inline" | "hidden";
|
|
@@ -336,11 +349,17 @@ interface UserConfig {
|
|
|
336
349
|
cjsDts: boolean;
|
|
337
350
|
}) => Awaitable<InputOptions | void | null>);
|
|
338
351
|
/** @default 'es' */
|
|
339
|
-
format?: Format | Format[]
|
|
352
|
+
format?: Format | Format[] | Partial<Record<Format, Partial<ResolvedConfig>>>;
|
|
340
353
|
globalName?: string;
|
|
341
354
|
/** @default 'dist' */
|
|
342
355
|
outDir?: string;
|
|
343
356
|
/**
|
|
357
|
+
* Whether to write the files to disk.
|
|
358
|
+
* This option is incompatible with watch mode.
|
|
359
|
+
* @default true
|
|
360
|
+
*/
|
|
361
|
+
write?: boolean;
|
|
362
|
+
/**
|
|
344
363
|
* Whether to generate source map files.
|
|
345
364
|
*
|
|
346
365
|
* Note that this option will always be `true` if you have
|
|
@@ -447,10 +466,6 @@ interface UserConfig {
|
|
|
447
466
|
*/
|
|
448
467
|
ignoreWatch?: Arrayable<string | RegExp>;
|
|
449
468
|
/**
|
|
450
|
-
* You can specify command to be executed after a successful build, specially useful for Watch mode
|
|
451
|
-
*/
|
|
452
|
-
onSuccess?: string | ((config: ResolvedConfig, signal: AbortSignal) => void | Promise<void>);
|
|
453
|
-
/**
|
|
454
469
|
* **[experimental]** Enable debug mode.
|
|
455
470
|
*
|
|
456
471
|
* Both debug mode and Vite DevTools are still under development, and this is for early testers only.
|
|
@@ -461,6 +476,10 @@ interface UserConfig {
|
|
|
461
476
|
*/
|
|
462
477
|
debug?: WithEnabled<DebugOptions>;
|
|
463
478
|
/**
|
|
479
|
+
* You can specify command to be executed after a successful build, specially useful for Watch mode
|
|
480
|
+
*/
|
|
481
|
+
onSuccess?: string | ((config: ResolvedConfig, signal: AbortSignal) => void | Promise<void>);
|
|
482
|
+
/**
|
|
464
483
|
* Enables generation of TypeScript declaration files (`.d.ts`).
|
|
465
484
|
*
|
|
466
485
|
* By default, this option is auto-detected based on your project's `package.json`:
|
|
@@ -537,21 +556,21 @@ interface InlineConfig extends UserConfig {
|
|
|
537
556
|
* Config loader to use. It can only be set via CLI or API.
|
|
538
557
|
* @default 'auto'
|
|
539
558
|
*/
|
|
540
|
-
configLoader?: "auto" | "native" | "
|
|
559
|
+
configLoader?: "auto" | "native" | "unrun";
|
|
541
560
|
/**
|
|
542
|
-
* Filter
|
|
561
|
+
* Filter configs by cwd or name.
|
|
543
562
|
*/
|
|
544
|
-
filter?: RegExp | string
|
|
563
|
+
filter?: RegExp | Arrayable<string>;
|
|
545
564
|
}
|
|
546
565
|
type UserConfigFn = (inlineConfig: InlineConfig, context: {
|
|
547
566
|
ci: boolean;
|
|
548
567
|
}) => Awaitable<Arrayable<UserConfig>>;
|
|
549
568
|
type UserConfigExport = Awaitable<Arrayable<UserConfig> | UserConfigFn>;
|
|
550
569
|
type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "fromVite" | "publicDir" | "silent" | "bundle" | "removeNodeProtocol" | "logLevel" | "failOnWarn" | "customLogger">, "globalName" | "inputOptions" | "outputOptions" | "minify" | "define" | "alias" | "external" | "onSuccess" | "outExtensions" | "hooks" | "copy" | "loader" | "name" | "banner" | "footer">, {
|
|
551
|
-
format: NormalizedFormat
|
|
570
|
+
format: NormalizedFormat;
|
|
552
571
|
target?: string[];
|
|
553
572
|
clean: string[];
|
|
554
|
-
pkg?:
|
|
573
|
+
pkg?: PackageJsonWithPath;
|
|
555
574
|
nodeProtocol: "strip" | boolean;
|
|
556
575
|
logger: Logger;
|
|
557
576
|
ignoreWatch: Array<string | RegExp>;
|
|
@@ -567,4 +586,4 @@ type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "from
|
|
|
567
586
|
unused: false | UnusedOptions;
|
|
568
587
|
}>;
|
|
569
588
|
//#endregion
|
|
570
|
-
export {
|
|
589
|
+
export { OutExtensionObject as A, TsdownBundle as C, ChunkAddonObject as D, ChunkAddonFunction as E, TsdownHooks as F, DebugOptions as I, CopyEntry as L, PackageType as M, BuildContext as N, OutExtensionContext as O, RolldownContext as P, CopyOptions as R, RolldownChunk as S, ChunkAddon 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, PackageJsonWithPath as j, OutExtensionFactory 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, AttwOptions as w, ExportsOptions as x, Logger as y, CopyOptionsFn as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { t as defineConfig } from "./config-
|
|
1
|
+
import { A as OutExtensionObject, C as TsdownBundle, D as ChunkAddonObject, E as ChunkAddonFunction, F as TsdownHooks, I as DebugOptions, L as CopyEntry, M as PackageType, N as BuildContext, O as OutExtensionContext, P as RolldownContext, R as CopyOptions, S as RolldownChunk, T as ChunkAddon, _ 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 PackageJsonWithPath, k as OutExtensionFactory, 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 AttwOptions, x as ExportsOptions, y as Logger, z as CopyOptionsFn } from "./index-BQZ2CZuJ.mjs";
|
|
2
|
+
import { t as defineConfig } from "./config-DPU-roRC.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
|
-
|
|
6
|
-
chunks: TsdownChunks;
|
|
7
|
-
}
|
|
5
|
+
|
|
8
6
|
/**
|
|
9
7
|
* Build with tsdown.
|
|
10
8
|
*/
|
|
@@ -17,8 +15,8 @@ declare function build(userOptions?: InlineConfig): Promise<TsdownBundle[]>;
|
|
|
17
15
|
* @private
|
|
18
16
|
* @param config Resolved options
|
|
19
17
|
*/
|
|
20
|
-
declare function buildSingle(config: ResolvedConfig, configFiles: string[], clean: () => Promise<void>, restart: () => void): Promise<TsdownBundle>;
|
|
18
|
+
declare function buildSingle(config: ResolvedConfig, configFiles: string[], isDualFormat: boolean, clean: () => Promise<void>, restart: () => void, done: (bundle: TsdownBundle) => Promise<void>): Promise<TsdownBundle>;
|
|
21
19
|
/** @internal */
|
|
22
20
|
declare const shimFile: string;
|
|
23
21
|
//#endregion
|
|
24
|
-
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, TsdownBundle,
|
|
22
|
+
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, RolldownChunk, RolldownContext, Sourcemap, TreeshakingOptions, TsdownBundle, 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-ipppZiPk.mjs";
|
|
3
|
+
import { a as globalLogger } from "./package-CxZ5olT1.mjs";
|
|
4
4
|
|
|
5
5
|
export { build, buildSingle, defineConfig, globalLogger, shimFile };
|
|
@@ -42,6 +42,15 @@ async function importWithError(moduleName) {
|
|
|
42
42
|
throw new Error(`Failed to import module "${moduleName}". Please ensure it is installed.`, { cause: error });
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
function promiseWithResolvers() {
|
|
46
|
+
let resolve;
|
|
47
|
+
return {
|
|
48
|
+
promise: new Promise((res) => {
|
|
49
|
+
resolve = res;
|
|
50
|
+
}),
|
|
51
|
+
resolve
|
|
52
|
+
};
|
|
53
|
+
}
|
|
45
54
|
|
|
46
55
|
//#endregion
|
|
47
56
|
//#region src/utils/logger.ts
|
|
@@ -150,7 +159,7 @@ function hue2rgb(p, q, t) {
|
|
|
150
159
|
|
|
151
160
|
//#endregion
|
|
152
161
|
//#region package.json
|
|
153
|
-
var version = "0.17.0-beta.
|
|
162
|
+
var version = "0.17.0-beta.5";
|
|
154
163
|
|
|
155
164
|
//#endregion
|
|
156
|
-
export { globalLogger as a, importWithError as c, pkgExists as d,
|
|
165
|
+
export { globalLogger 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, prettyFormat as o, resolveComma as p, createLogger as r, prettyName as s, version as t, noop as u };
|
package/dist/plugins.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as ResolvedConfig, v as ReportPlugin, y as Logger } from "./index-
|
|
1
|
+
import { C as TsdownBundle, c as ResolvedConfig, v as ReportPlugin, y as Logger } from "./index-BQZ2CZuJ.mjs";
|
|
2
2
|
import { Plugin } from "rolldown";
|
|
3
3
|
|
|
4
4
|
//#region src/features/external.d.ts
|
|
@@ -10,7 +10,7 @@ declare function ExternalPlugin({
|
|
|
10
10
|
}: ResolvedConfig): Plugin;
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/features/shebang.d.ts
|
|
13
|
-
declare function ShebangPlugin(logger: Logger, cwd: string, name?: string,
|
|
13
|
+
declare function ShebangPlugin(logger: Logger, cwd: string, name?: string, isDualFormat?: boolean): Plugin;
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/features/node-protocol.d.ts
|
|
16
16
|
/**
|
|
@@ -19,4 +19,10 @@ declare function ShebangPlugin(logger: Logger, cwd: string, name?: string, isMul
|
|
|
19
19
|
*/
|
|
20
20
|
declare function NodeProtocolPlugin(nodeProtocolOption: "strip" | true): Plugin;
|
|
21
21
|
//#endregion
|
|
22
|
-
|
|
22
|
+
//#region src/features/watch.d.ts
|
|
23
|
+
declare function WatchPlugin(configFiles: string[], {
|
|
24
|
+
config,
|
|
25
|
+
chunks
|
|
26
|
+
}: TsdownBundle): Plugin;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin, WatchPlugin };
|
package/dist/plugins.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./config-DLSWqKoz.mjs";
|
|
2
|
-
import { a as
|
|
3
|
-
import "./package-
|
|
2
|
+
import { a as ShebangPlugin, c as ExternalPlugin, i as WatchPlugin, o as ReportPlugin, s as NodeProtocolPlugin } from "./src-ipppZiPk.mjs";
|
|
3
|
+
import "./package-CxZ5olT1.mjs";
|
|
4
4
|
|
|
5
|
-
export { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin };
|
|
5
|
+
export { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin, WatchPlugin };
|
package/dist/run.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as globalLogger,
|
|
2
|
+
import { a as globalLogger, g as toArray, p as resolveComma, t as version } from "./package-CxZ5olT1.mjs";
|
|
3
3
|
import module from "node:module";
|
|
4
4
|
import { dim } from "ansis";
|
|
5
5
|
import { VERSION } from "rolldown";
|
|
6
|
-
import process from "node:process";
|
|
7
6
|
import { createDebug, enable, namespaces } from "obug";
|
|
7
|
+
import process from "node:process";
|
|
8
8
|
import { x } from "tinyexec";
|
|
9
9
|
import { cac } from "cac";
|
|
10
10
|
|
|
@@ -29,7 +29,7 @@ cli.help().version(version);
|
|
|
29
29
|
cli.command("[...files]", "Bundle files", {
|
|
30
30
|
ignoreOptionDefaultValue: true,
|
|
31
31
|
allowUnknownOptions: true
|
|
32
|
-
}).option("-c, --config <filename>", "Use a custom config file").option("--config-loader <loader>", "Config loader to use: auto, native, unrun", { default: "auto" }).option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife, umd", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--external <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--debug", "Enable debug mode").option("--debug-logs [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("-l, --logLevel <level>", "Set log level: info, warn, error, silent").option("--fail-on-warn", "Fail on warnings", { default: true }).option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--treeshake", "Tree-shake bundle", { default: true }).option("--sourcemap", "Generate source map", { default: false }).option("--shims", "Enable cjs and esm shims ", { default: false }).option("--platform <platform>", "Target platform", { default: "node" }).option("--dts", "Generate dts files").option("--publint", "Enable publint", { default: false }).option("--attw", "Enable Are the types wrong integration", { default: false }).option("--unused", "Enable unused dependencies check", { default: false }).option("-w, --watch [path]", "Watch mode").option("--ignore-watch <path>", "Ignore custom paths in watch mode").option("--from-vite [vitest]", "Reuse config from Vite or Vitest").option("--report", "Size report", { default: true }).option("--env.* <value>", "Define compile-time env variables").option("--on-success <command>", "Command to run on success").option("--copy <dir>", "Copy files to output dir").option("--public-dir <dir>", "Alias for --copy, deprecated").option("--tsconfig <tsconfig>", "Set tsconfig path").option("--unbundle", "Unbundle mode").option("-W, --workspace [dir]", "Enable workspace mode").option("-F, --filter <pattern>", "Filter
|
|
32
|
+
}).option("-c, --config <filename>", "Use a custom config file").option("--config-loader <loader>", "Config loader to use: auto, native, unrun", { default: "auto" }).option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife, umd", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--external <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--debug", "Enable debug mode").option("--debug-logs [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("-l, --logLevel <level>", "Set log level: info, warn, error, silent").option("--fail-on-warn", "Fail on warnings", { default: true }).option("--no-write", "Disable writing files to disk, incompatible with watch mode").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--treeshake", "Tree-shake bundle", { default: true }).option("--sourcemap", "Generate source map", { default: false }).option("--shims", "Enable cjs and esm shims ", { default: false }).option("--platform <platform>", "Target platform", { default: "node" }).option("--dts", "Generate dts files").option("--publint", "Enable publint", { default: false }).option("--attw", "Enable Are the types wrong integration", { default: false }).option("--unused", "Enable unused dependencies check", { default: false }).option("-w, --watch [path]", "Watch mode").option("--ignore-watch <path>", "Ignore custom paths in watch mode").option("--from-vite [vitest]", "Reuse config from Vite or Vitest").option("--report", "Size report", { default: true }).option("--env.* <value>", "Define compile-time env variables").option("--on-success <command>", "Command to run on success").option("--copy <dir>", "Copy files to output dir").option("--public-dir <dir>", "Alias for --copy, deprecated").option("--tsconfig <tsconfig>", "Set tsconfig path").option("--unbundle", "Unbundle mode").option("-W, --workspace [dir]", "Enable workspace mode").option("-F, --filter <pattern>", "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
|
|
33
33
|
globalLogger.level = flags.logLevel || (flags.silent ? "error" : "info");
|
|
34
34
|
globalLogger.info(`tsdown ${dim`v${version}`} powered by rolldown ${dim`v${VERSION}`}`);
|
|
35
35
|
const { build: build$1 } = await import("./index.mjs");
|