@voidzero-dev/vite-plus-core 0.2.3 → 0.2.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/LICENSE +7 -115
- package/dist/rolldown/cli.mjs +11 -8
- package/dist/rolldown/config.d.mts +15 -2
- package/dist/rolldown/config.mjs +2 -2
- package/dist/rolldown/experimental-index.d.mts +4 -4
- package/dist/rolldown/experimental-index.mjs +8 -8
- package/dist/rolldown/filter-index.d.mts +1 -1
- package/dist/rolldown/index.d.mts +3 -3
- package/dist/rolldown/index.mjs +10 -4
- package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
- package/dist/rolldown/parallel-plugin.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.mjs +2 -2
- package/dist/rolldown/plugins-index.d.mts +3 -3
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/{binding-B1q9aYT-.d.mts → binding-D26QphWG.d.mts} +12 -0
- package/dist/rolldown/shared/{binding-BmkJW3Wy.mjs → binding-TuFFIE_J.mjs} +26 -26
- package/dist/rolldown/shared/{bindingify-input-options-Cmm60vfj.mjs → bindingify-input-options-CwbcQL6W.mjs} +11 -13
- package/dist/rolldown/shared/{constructors-2i1T9YcF.d.mts → constructors-BbWPse2X.d.mts} +2 -2
- package/dist/rolldown/shared/{constructors-CE6zZSUt.mjs → constructors-D_3i7dpX.mjs} +1 -1
- package/dist/rolldown/shared/{define-config-BBz954-q.d.mts → define-config-BhJ90aEv.d.mts} +79 -2
- package/dist/rolldown/shared/dist-DX3cAjHx.mjs +154 -0
- package/dist/rolldown/shared/{error-BlQ0-ek7.mjs → error-BHRSI0R7.mjs} +1 -1
- package/dist/rolldown/shared/{load-config-CVVMWSlg.mjs → load-config-Bd7MgqCK.mjs} +19 -2
- package/dist/rolldown/shared/{logs-aMKUxRpj.mjs → logs-ZGEh6uhb.mjs} +6 -1
- package/dist/rolldown/shared/{normalize-string-or-regex-BYkbbGqQ.mjs → normalize-string-or-regex-dnh67V_w.mjs} +2 -2
- package/dist/rolldown/shared/{parse-Dphnedsw.mjs → parse-B6_waszz.mjs} +2 -2
- package/dist/rolldown/shared/{prompt-Bgj-uEyc.mjs → prompt-pZFoa1TT.mjs} +59 -17
- package/dist/rolldown/shared/{resolve-tsconfig-CdIAR1Eb.mjs → resolve-tsconfig-DxqIJB3x.mjs} +2 -2
- package/dist/rolldown/shared/{rolldown-Bnp916iM.mjs → rolldown-CACDGVWV.mjs} +1 -1
- package/dist/rolldown/shared/{rolldown-build-Cs2iVJuw.mjs → rolldown-build-BV22mk7t.mjs} +33 -13
- package/dist/rolldown/shared/{transform-CEmFsvJW.d.mts → transform-BPrUvqEZ.d.mts} +1 -1
- package/dist/rolldown/shared/{watch-ECGr-_QS.mjs → watch-CS_JygCu.mjs} +5 -5
- package/dist/rolldown/utils-index.d.mts +3 -3
- package/dist/rolldown/utils-index.mjs +8 -6
- package/dist/tsdown/{build-B_nvJe4A-CvbtVBxy.js → build-BlM3pDGJ-C8Uovnt4.js} +166 -76
- package/dist/tsdown/{debug-DLdR-9XB-DQZ6QLC0.js → debug-B1wUEHkd-DhRzGJTf.js} +21 -6
- package/dist/tsdown/{detect-B97OSl92-BJPZyIKJ.js → detect-BNXt7gkp-DKAC9Z7n.js} +7 -2
- package/dist/tsdown/dist-Pjag7IPt.js +3206 -0
- package/dist/tsdown/fs-qxJxxoCE-B_amenYz.js +46 -0
- package/dist/tsdown/{general-Cp4NiJNK-CbyrS9q1.js → general-Cp4NiJNK-xAqmPhMP.js} +1 -1
- package/dist/tsdown/index-types.d.ts +1361 -1326
- package/dist/tsdown/index.js +7 -4
- package/dist/tsdown/internal-Bn6NGoha.js +3 -0
- package/dist/tsdown/npm_cjs_chunk_range.cjs +14 -13
- package/dist/tsdown/npm_cjs_chunk_semver.cjs +6 -6
- package/dist/tsdown/npm_entry_picomatch.cjs +44 -15
- package/dist/tsdown/npm_entry_semver_functions_coerce.cjs +2 -2
- package/dist/tsdown/npm_entry_semver_functions_satisfies.cjs +1 -1
- package/dist/tsdown/npm_entry_semver_ranges_min-version.cjs +1 -1
- package/dist/tsdown/run.js +3 -3
- package/dist/tsdown/{src-CISfE_A0.js → src-CK50m8R_.js} +5 -5
- package/dist/tsdown/target-CqeSqtms-CIvlAiuG.js +35 -0
- package/dist/tsdown/{tsc-CdZE7QwS.js → tsc-CilQvmj4.js} +15 -7
- package/dist/tsdown/{tsc-context-CX_GXdyS.js → tsc-context-BusiAGCd.js} +6 -2
- package/dist/tsdown/tsdown-css.js +74 -23
- package/dist/tsdown/tsdown-exe.js +27 -26
- package/dist/vite/client/client.mjs +4 -4
- package/dist/vite/node/chunks/build.js +194 -84
- package/dist/vite/node/chunks/dist2.js +1 -1
- package/dist/vite/node/chunks/lib.js +1 -1
- package/dist/vite/node/chunks/node.js +484 -71
- package/dist/vite/node/chunks/postcss-import.js +1 -1
- package/dist/vite/node/cli.js +3 -4
- package/dist/vite/node/index.d.ts +3 -3
- package/dist/vite/node/index.js +1 -2
- package/package.json +18 -16
- package/dist/tsdown/dist-CZtGyfn3.js +0 -200
- package/dist/tsdown/dist-CqbVlnVq.js +0 -32057
- package/dist/tsdown/internal-bfoxcI4F.js +0 -3
- package/dist/tsdown/target-CqeSqtms-FAqYuGyB.js +0 -79
- package/dist/vite/node/chunks/logger.js +0 -361
|
@@ -7,7 +7,7 @@ import { TransformOptions } from "lightningcss";
|
|
|
7
7
|
import { IsolatedDeclarationsOptions } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
8
8
|
import { Options as UnusedOptions } from "unplugin-unused";
|
|
9
9
|
|
|
10
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.
|
|
10
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.7_@tsdown+exe@0.22.7_@type_53c241a653f2227a5df8ba2949047afe/node_modules/tsdown/dist/logger-KL98uddX.d.mts
|
|
11
11
|
//#region src/utils/types.d.ts
|
|
12
12
|
type Overwrite<T, U> = Omit<T, keyof U> & U;
|
|
13
13
|
type Awaitable<T> = T | Promise<T>;
|
|
@@ -21,6 +21,7 @@ interface LoggerOptions {
|
|
|
21
21
|
customLogger?: Logger;
|
|
22
22
|
console?: Console;
|
|
23
23
|
failOnWarn?: boolean;
|
|
24
|
+
suppressWarnings?: Arrayable<RegExp | string> | ((msg: string) => boolean);
|
|
24
25
|
}
|
|
25
26
|
interface Logger {
|
|
26
27
|
level: LogLevel;
|
|
@@ -33,310 +34,6 @@ interface Logger {
|
|
|
33
34
|
clearScreen: (type: LogType) => void;
|
|
34
35
|
}
|
|
35
36
|
declare const globalLogger: Logger; //#endregion
|
|
36
|
-
//#region node_modules/.pnpm/pkg-types@2.3.1/node_modules/pkg-types/dist/index.d.mts
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/packagejson/types.d.ts
|
|
39
|
-
interface PackageJson {
|
|
40
|
-
/**
|
|
41
|
-
* The name is what your thing is called.
|
|
42
|
-
* Some rules:
|
|
43
|
-
* - The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
|
|
44
|
-
* - The name can’t start with a dot or an underscore.
|
|
45
|
-
* - New packages must not have uppercase letters in the name.
|
|
46
|
-
* - The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can’t contain any non-URL-safe characters.
|
|
47
|
-
*/
|
|
48
|
-
name?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Version must be parseable by `node-semver`, which is bundled with npm as a dependency. (`npm install semver` to use it yourself.)
|
|
51
|
-
*/
|
|
52
|
-
version?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Put a description in it. It’s a string. This helps people discover your package, as it’s listed in `npm search`.
|
|
55
|
-
*/
|
|
56
|
-
description?: string;
|
|
57
|
-
/**
|
|
58
|
-
* Put keywords in it. It’s an array of strings. This helps people discover your package as it’s listed in `npm search`.
|
|
59
|
-
*/
|
|
60
|
-
keywords?: string[];
|
|
61
|
-
/**
|
|
62
|
-
* The url to the project homepage.
|
|
63
|
-
*/
|
|
64
|
-
homepage?: string;
|
|
65
|
-
/**
|
|
66
|
-
* The url to your project’s issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.
|
|
67
|
-
*/
|
|
68
|
-
bugs?: string | {
|
|
69
|
-
url?: string;
|
|
70
|
-
email?: string;
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you’re placing on it.
|
|
74
|
-
*/
|
|
75
|
-
license?: string;
|
|
76
|
-
/**
|
|
77
|
-
* Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the `npm docs` command will be able to find you.
|
|
78
|
-
* For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:
|
|
79
|
-
*/
|
|
80
|
-
repository?: string | {
|
|
81
|
-
type: string;
|
|
82
|
-
url: string;
|
|
83
|
-
/**
|
|
84
|
-
* If the `package.json` for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives:
|
|
85
|
-
*/
|
|
86
|
-
directory?: string;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* The `scripts` field is a dictionary containing script commands that are run at various times in the lifecycle of your package.
|
|
90
|
-
*/
|
|
91
|
-
scripts?: PackageJsonScripts;
|
|
92
|
-
/**
|
|
93
|
-
* If you set `"private": true` in your package.json, then npm will refuse to publish it.
|
|
94
|
-
*/
|
|
95
|
-
private?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* The “author” is one person.
|
|
98
|
-
*/
|
|
99
|
-
author?: PackageJsonPerson;
|
|
100
|
-
/**
|
|
101
|
-
* “contributors” is an array of people.
|
|
102
|
-
*/
|
|
103
|
-
contributors?: PackageJsonPerson[];
|
|
104
|
-
/**
|
|
105
|
-
* An object containing a URL that provides up-to-date information
|
|
106
|
-
* about ways to help fund development of your package,
|
|
107
|
-
* a string URL, or an array of objects and string URLs
|
|
108
|
-
*/
|
|
109
|
-
funding?: PackageJsonFunding | PackageJsonFunding[];
|
|
110
|
-
/**
|
|
111
|
-
* The optional `files` field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. File patterns follow a similar syntax to `.gitignore`, but reversed: including a file, directory, or glob pattern (`*`, `**\/*`, and such) will make it so that file is included in the tarball when it’s packed. Omitting the field will make it default to `["*"]`, which means it will include all files.
|
|
112
|
-
*/
|
|
113
|
-
files?: string[];
|
|
114
|
-
/**
|
|
115
|
-
* The main field is a module ID that is the primary entry point to your program. That is, if your package is named `foo`, and a user installs it, and then does `require("foo")`, then your main module’s exports object will be returned.
|
|
116
|
-
* This should be a module ID relative to the root of your package folder.
|
|
117
|
-
* For most modules, it makes the most sense to have a main script and often not much else.
|
|
118
|
-
*/
|
|
119
|
-
main?: string;
|
|
120
|
-
/**
|
|
121
|
-
* If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might rely on primitives that aren’t available in Node.js modules. (e.g. window)
|
|
122
|
-
*/
|
|
123
|
-
browser?: string | Record<string, string | false>;
|
|
124
|
-
/**
|
|
125
|
-
* The `unpkg` field is used to specify the URL to a UMD module for your package. This is used by default in the unpkg.com CDN service.
|
|
126
|
-
*/
|
|
127
|
-
unpkg?: string;
|
|
128
|
-
/**
|
|
129
|
-
* A map of command name to local file name. On install, npm will symlink that file into `prefix/bin` for global installs, or `./node_modules/.bin/` for local installs.
|
|
130
|
-
*/
|
|
131
|
-
bin?: string | Record<string, string>;
|
|
132
|
-
/**
|
|
133
|
-
* Specify either a single file or an array of filenames to put in place for the `man` program to find.
|
|
134
|
-
*/
|
|
135
|
-
man?: string | string[];
|
|
136
|
-
/**
|
|
137
|
-
* Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
|
|
138
|
-
*/
|
|
139
|
-
dependencies?: Record<string, string>;
|
|
140
|
-
/**
|
|
141
|
-
* If someone is planning on downloading and using your module in their program, then they probably don’t want or need to download and build the external test or documentation framework that you use.
|
|
142
|
-
* In this case, it’s best to map these additional items in a `devDependencies` object.
|
|
143
|
-
*/
|
|
144
|
-
devDependencies?: Record<string, string>;
|
|
145
|
-
/**
|
|
146
|
-
* If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the `optionalDependencies` object. This is a map of package name to version or url, just like the `dependencies` object. The difference is that build failures do not cause installation to fail.
|
|
147
|
-
*/
|
|
148
|
-
optionalDependencies?: Record<string, string>;
|
|
149
|
-
/**
|
|
150
|
-
* In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a `require` of this host. This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.
|
|
151
|
-
*/
|
|
152
|
-
peerDependencies?: Record<string, string>;
|
|
153
|
-
/**
|
|
154
|
-
* TypeScript typings, typically ending by `.d.ts`.
|
|
155
|
-
*/
|
|
156
|
-
types?: string;
|
|
157
|
-
/**
|
|
158
|
-
* This field is synonymous with `types`.
|
|
159
|
-
*/
|
|
160
|
-
typings?: string;
|
|
161
|
-
/**
|
|
162
|
-
* Non-Standard Node.js alternate entry-point to main.
|
|
163
|
-
* An initial implementation for supporting CJS packages (from main), and use module for ESM modules.
|
|
164
|
-
*/
|
|
165
|
-
module?: string;
|
|
166
|
-
/**
|
|
167
|
-
* Make main entry-point be loaded as an ESM module, support "export" syntax instead of "require"
|
|
168
|
-
*
|
|
169
|
-
* Docs:
|
|
170
|
-
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_package_json_type_field
|
|
171
|
-
*
|
|
172
|
-
* @default 'commonjs'
|
|
173
|
-
* @since Node.js v14
|
|
174
|
-
*/
|
|
175
|
-
type?: "module" | "commonjs";
|
|
176
|
-
/**
|
|
177
|
-
* Alternate and extensible alternative to "main" entry point.
|
|
178
|
-
*
|
|
179
|
-
* When using `{type: "module"}`, any ESM module file MUST end with `.mjs` extension.
|
|
180
|
-
*
|
|
181
|
-
* Docs:
|
|
182
|
-
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_exports_sugar
|
|
183
|
-
*
|
|
184
|
-
* @since Node.js v12.7
|
|
185
|
-
*/
|
|
186
|
-
exports?: PackageJsonExports;
|
|
187
|
-
/**
|
|
188
|
-
* Docs:
|
|
189
|
-
* - https://nodejs.org/api/packages.html#imports
|
|
190
|
-
*/
|
|
191
|
-
imports?: Record<string, string | Record<string, string>>;
|
|
192
|
-
/**
|
|
193
|
-
* The field is used to define a set of sub-packages (or workspaces) within a monorepo.
|
|
194
|
-
*
|
|
195
|
-
* This field is an array of glob patterns or an object with specific configurations for managing
|
|
196
|
-
* multiple packages in a single repository.
|
|
197
|
-
*/
|
|
198
|
-
workspaces?: string[] | {
|
|
199
|
-
/**
|
|
200
|
-
* Workspace package paths. Glob patterns are supported.
|
|
201
|
-
*/
|
|
202
|
-
packages?: string[];
|
|
203
|
-
/**
|
|
204
|
-
* Packages to block from hoisting to the workspace root.
|
|
205
|
-
* Uses glob patterns to match module paths in the dependency tree.
|
|
206
|
-
*
|
|
207
|
-
* Docs:
|
|
208
|
-
* - https://classic.yarnpkg.com/blog/2018/02/15/nohoist/
|
|
209
|
-
*/
|
|
210
|
-
nohoist?: string[];
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* The field is used to specify different TypeScript declaration files for
|
|
214
|
-
* different versions of TypeScript, allowing for version-specific type definitions.
|
|
215
|
-
*/
|
|
216
|
-
typesVersions?: Record<string, Record<string, string[]>>;
|
|
217
|
-
/**
|
|
218
|
-
* You can specify which operating systems your module will run on:
|
|
219
|
-
* ```json
|
|
220
|
-
* {
|
|
221
|
-
* "os": ["darwin", "linux"]
|
|
222
|
-
* }
|
|
223
|
-
* ```
|
|
224
|
-
* You can also block instead of allowing operating systems, just prepend the blocked os with a '!':
|
|
225
|
-
* ```json
|
|
226
|
-
* {
|
|
227
|
-
* "os": ["!win32"]
|
|
228
|
-
* }
|
|
229
|
-
* ```
|
|
230
|
-
* The host operating system is determined by `process.platform`
|
|
231
|
-
* It is allowed to both block and allow an item, although there isn't any good reason to do this.
|
|
232
|
-
*/
|
|
233
|
-
os?: string[];
|
|
234
|
-
/**
|
|
235
|
-
* If your code only runs on certain cpu architectures, you can specify which ones.
|
|
236
|
-
* ```json
|
|
237
|
-
* {
|
|
238
|
-
* "cpu": ["x64", "ia32"]
|
|
239
|
-
* }
|
|
240
|
-
* ```
|
|
241
|
-
* Like the `os` option, you can also block architectures:
|
|
242
|
-
* ```json
|
|
243
|
-
* {
|
|
244
|
-
* "cpu": ["!arm", "!mips"]
|
|
245
|
-
* }
|
|
246
|
-
* ```
|
|
247
|
-
* The host architecture is determined by `process.arch`
|
|
248
|
-
*/
|
|
249
|
-
cpu?: string[];
|
|
250
|
-
/**
|
|
251
|
-
* This is a set of config values that will be used at publish-time.
|
|
252
|
-
*/
|
|
253
|
-
publishConfig?: {
|
|
254
|
-
/**
|
|
255
|
-
* The registry that will be used if the package is published.
|
|
256
|
-
*/
|
|
257
|
-
registry?: string;
|
|
258
|
-
/**
|
|
259
|
-
* The tag that will be used if the package is published.
|
|
260
|
-
*/
|
|
261
|
-
tag?: string;
|
|
262
|
-
/**
|
|
263
|
-
* The access level that will be used if the package is published.
|
|
264
|
-
*/
|
|
265
|
-
access?: "public" | "restricted";
|
|
266
|
-
/**
|
|
267
|
-
* **pnpm-only**
|
|
268
|
-
*
|
|
269
|
-
* By default, for portability reasons, no files except those listed in
|
|
270
|
-
* the bin field will be marked as executable in the resulting package
|
|
271
|
-
* archive. The executableFiles field lets you declare additional fields
|
|
272
|
-
* that must have the executable flag (+x) set even if
|
|
273
|
-
* they aren't directly accessible through the bin field.
|
|
274
|
-
*/
|
|
275
|
-
executableFiles?: string[];
|
|
276
|
-
/**
|
|
277
|
-
* **pnpm-only**
|
|
278
|
-
*
|
|
279
|
-
* You also can use the field `publishConfig.directory` to customize
|
|
280
|
-
* the published subdirectory relative to the current `package.json`.
|
|
281
|
-
*
|
|
282
|
-
* It is expected to have a modified version of the current package in
|
|
283
|
-
* the specified directory (usually using third party build tools).
|
|
284
|
-
*/
|
|
285
|
-
directory?: string;
|
|
286
|
-
/**
|
|
287
|
-
* **pnpm-only**
|
|
288
|
-
*
|
|
289
|
-
* When set to `true`, the project will be symlinked from the
|
|
290
|
-
* `publishConfig.directory` location during local development.
|
|
291
|
-
* @default true
|
|
292
|
-
*/
|
|
293
|
-
linkDirectory?: boolean;
|
|
294
|
-
} & Pick<PackageJson, "bin" | "main" | "exports" | "types" | "typings" | "module" | "browser" | "unpkg" | "typesVersions" | "os" | "cpu">;
|
|
295
|
-
/**
|
|
296
|
-
* See: https://nodejs.org/api/packages.html#packagemanager
|
|
297
|
-
* This field defines which package manager is expected to be used when working on the current project.
|
|
298
|
-
* Should be of the format: `<name>@<version>[#hash]`
|
|
299
|
-
*/
|
|
300
|
-
packageManager?: string;
|
|
301
|
-
[key: string]: any;
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* See: https://docs.npmjs.com/cli/v11/using-npm/scripts#pre--post-scripts
|
|
305
|
-
*/
|
|
306
|
-
type PackageJsonScriptWithPreAndPost<S extends string> = S | `${"pre" | "post"}${S}`;
|
|
307
|
-
/**
|
|
308
|
-
* See: https://docs.npmjs.com/cli/v11/using-npm/scripts#life-cycle-operation-order
|
|
309
|
-
*/
|
|
310
|
-
type PackageJsonNpmLifeCycleScripts = "dependencies" | "prepublishOnly" | PackageJsonScriptWithPreAndPost<"install" | "pack" | "prepare" | "publish" | "restart" | "start" | "stop" | "test" | "version">;
|
|
311
|
-
/**
|
|
312
|
-
* See: https://pnpm.io/scripts#lifecycle-scripts
|
|
313
|
-
*/
|
|
314
|
-
type PackageJsonPnpmLifeCycleScripts = "pnpm:devPreinstall";
|
|
315
|
-
type PackageJsonCommonScripts = "build" | "coverage" | "deploy" | "dev" | "format" | "lint" | "preview" | "release" | "typecheck" | "watch";
|
|
316
|
-
type PackageJsonScriptName = PackageJsonCommonScripts | PackageJsonNpmLifeCycleScripts | PackageJsonPnpmLifeCycleScripts | (string & {});
|
|
317
|
-
type PackageJsonScripts = { [P in PackageJsonScriptName]?: string };
|
|
318
|
-
/**
|
|
319
|
-
* A “person” is an object with a “name” field and optionally “url” and “email”. Or you can shorten that all into a single string, and npm will parse it for you.
|
|
320
|
-
*/
|
|
321
|
-
type PackageJsonPerson = string | {
|
|
322
|
-
name: string;
|
|
323
|
-
email?: string;
|
|
324
|
-
url?: string;
|
|
325
|
-
};
|
|
326
|
-
type PackageJsonFunding = string | {
|
|
327
|
-
url: string;
|
|
328
|
-
type?: string;
|
|
329
|
-
};
|
|
330
|
-
type PackageJsonExportKey = "." | "import" | "require" | "types" | "node" | "browser" | "default" | (string & {});
|
|
331
|
-
type PackageJsonExportsObject = { [P in PackageJsonExportKey]?: string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject> };
|
|
332
|
-
type PackageJsonExports = string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>; //#endregion
|
|
333
|
-
//#region src/packagejson/utils.d.ts
|
|
334
|
-
/**
|
|
335
|
-
* Defines a PackageJson structure.
|
|
336
|
-
* @param pkg - The `package.json` content as an object. See {@link PackageJson}.
|
|
337
|
-
* @returns the same `package.json` object.
|
|
338
|
-
*/
|
|
339
|
-
//#endregion
|
|
340
37
|
//#endregion
|
|
341
38
|
//#region ../../node_modules/.pnpm/hookable@6.1.1/node_modules/hookable/dist/index.d.mts
|
|
342
39
|
type HookCallback = (...arguments_: any) => Promise<void> | void;
|
|
@@ -395,7 +92,7 @@ declare global {
|
|
|
395
92
|
}
|
|
396
93
|
/** @deprecated */
|
|
397
94
|
//#endregion
|
|
398
|
-
//#region ../../node_modules/.pnpm/@tsdown+exe@0.22.
|
|
95
|
+
//#region ../../node_modules/.pnpm/@tsdown+exe@0.22.7_tsdown@0.22.7/node_modules/@tsdown/exe/dist/index.d.mts
|
|
399
96
|
//#region src/platform.d.ts
|
|
400
97
|
type ExePlatform = "win" | "darwin" | "linux";
|
|
401
98
|
type ExeArch = "x64" | "arm64";
|
|
@@ -403,154 +100,154 @@ interface ExeTarget {
|
|
|
403
100
|
platform: ExePlatform;
|
|
404
101
|
arch: ExeArch;
|
|
405
102
|
/**
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
103
|
+
* Node.js version to use for the executable.
|
|
104
|
+
*
|
|
105
|
+
* Accepts a valid semver string (e.g., `"25.7.0"`), or the special values
|
|
106
|
+
* `"latest"` / `"latest-lts"` which resolve the version automatically from
|
|
107
|
+
* {@link https://nodejs.org/dist/index.json}.
|
|
108
|
+
*
|
|
109
|
+
* The minimum required version is 25.7.0, which is when SEA support was added to Node.js.
|
|
110
|
+
*/
|
|
414
111
|
nodeVersion: (string & {}) | "latest" | "latest-lts" | `${string}.${string}.${string}`;
|
|
415
112
|
}
|
|
416
113
|
interface ExeExtensionOptions {
|
|
417
114
|
/**
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
115
|
+
* Cross-platform targets for building executables.
|
|
116
|
+
* Requires `@tsdown/exe` to be installed.
|
|
117
|
+
* When specified, builds an executable for each target platform/arch combination.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* targets: [
|
|
122
|
+
* { platform: 'linux', arch: 'x64', nodeVersion: '25.7.0' },
|
|
123
|
+
* { platform: 'darwin', arch: 'arm64', nodeVersion: '25.7.0' },
|
|
124
|
+
* { platform: 'win', arch: 'x64', nodeVersion: '25.7.0' },
|
|
125
|
+
* ]
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
431
128
|
targets?: ExeTarget[];
|
|
432
129
|
}
|
|
433
130
|
//#endregion
|
|
434
|
-
//#region ../../node_modules/.pnpm/@tsdown+css@0.22.
|
|
131
|
+
//#region ../../node_modules/.pnpm/@tsdown+css@0.22.7_jiti@2.7.0_postcss-import@16.1.1_postcss@8.5.16__postcss-modules@9.0_1c733d87075d7caaba5f5a5461b5a5e5/node_modules/@tsdown/css/dist/index.d.mts
|
|
435
132
|
//#region src/options.d.ts
|
|
436
133
|
type LightningCSSOptions = Omit<TransformOptions<any>, "filename" | "code">;
|
|
437
134
|
interface CSSModulesOptions {
|
|
438
135
|
/**
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
136
|
+
* Controls the scoping behavior.
|
|
137
|
+
* @default 'local'
|
|
138
|
+
*/
|
|
442
139
|
scopeBehaviour?: "global" | "local";
|
|
443
140
|
/**
|
|
444
|
-
|
|
445
|
-
|
|
141
|
+
* File paths matching these patterns will use global scoping.
|
|
142
|
+
*/
|
|
446
143
|
globalModulePaths?: RegExp[];
|
|
447
144
|
/**
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
145
|
+
* Pattern or function to generate scoped class names.
|
|
146
|
+
* When using `transformer: 'lightningcss'`, only string patterns are supported.
|
|
147
|
+
*/
|
|
451
148
|
generateScopedName?: string | ((name: string, filename: string, css: string) => string);
|
|
452
149
|
/**
|
|
453
|
-
|
|
454
|
-
|
|
150
|
+
* Prefix added to hashes when generating scoped names.
|
|
151
|
+
*/
|
|
455
152
|
hashPrefix?: string;
|
|
456
153
|
/**
|
|
457
|
-
|
|
458
|
-
|
|
154
|
+
* Transform convention for exported class names.
|
|
155
|
+
*/
|
|
459
156
|
localsConvention?: "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly";
|
|
460
157
|
/**
|
|
461
|
-
|
|
462
|
-
|
|
158
|
+
* Whether to include global class names in the export.
|
|
159
|
+
*/
|
|
463
160
|
exportGlobals?: boolean;
|
|
464
161
|
/**
|
|
465
|
-
|
|
466
|
-
|
|
162
|
+
* Callback to receive the generated class name mappings.
|
|
163
|
+
*/
|
|
467
164
|
getJSON?: (cssFileName: string, json: Record<string, string>, outputFileName: string) => void;
|
|
468
165
|
}
|
|
469
166
|
interface CssOptions {
|
|
470
167
|
/**
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
168
|
+
* Enable/disable CSS code splitting.
|
|
169
|
+
* When set to `false`, all CSS in the entire project will be extracted into
|
|
170
|
+
* a single CSS file named by {@linkcode fileName}.
|
|
171
|
+
* When set to `true`, CSS imported in async JS chunks will be preserved as chunks.
|
|
172
|
+
*
|
|
173
|
+
* Defaults to `false`, but if `unbundle` is `true`, it defaults to `true` to preserve chunk splitting.
|
|
174
|
+
*/
|
|
478
175
|
splitting?: boolean;
|
|
479
176
|
/**
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
177
|
+
* Specify the name of the CSS file generated when {@linkcode splitting} is
|
|
178
|
+
* `false`.
|
|
179
|
+
*
|
|
180
|
+
* @default 'style.css'
|
|
181
|
+
*/
|
|
485
182
|
fileName?: string;
|
|
486
183
|
/**
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
184
|
+
* Set the target environment for CSS syntax lowering.
|
|
185
|
+
* Accepts esbuild-style target strings (e.g., `'chrome99'`, `'safari16.2'`).
|
|
186
|
+
* Defaults to the top-level `target` option.
|
|
187
|
+
*
|
|
188
|
+
* @see https://vite.dev/config/build-options#build-csstarget
|
|
189
|
+
* @default tsdownConfig.target
|
|
190
|
+
*/
|
|
494
191
|
target?: string | string[] | false;
|
|
495
192
|
/**
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
193
|
+
* Options for CSS preprocessors (Sass/Less/Stylus).
|
|
194
|
+
*
|
|
195
|
+
* In addition to options specific to each processor, `additionalData` option
|
|
196
|
+
* can be used to inject extra code for each style content.
|
|
197
|
+
*/
|
|
501
198
|
preprocessorOptions?: PreprocessorOptions;
|
|
502
199
|
/**
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
200
|
+
* Enable/disable CSS minification.
|
|
201
|
+
*
|
|
202
|
+
* @default false
|
|
203
|
+
*/
|
|
507
204
|
minify?: boolean;
|
|
508
205
|
/**
|
|
509
|
-
|
|
510
|
-
|
|
206
|
+
* Lightning CSS options for CSS syntax lowering and transformations.
|
|
207
|
+
*/
|
|
511
208
|
lightningcss?: LightningCSSOptions;
|
|
512
209
|
/**
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
210
|
+
* PostCSS configuration.
|
|
211
|
+
*
|
|
212
|
+
* - `string`: Path to the directory to search for PostCSS config files.
|
|
213
|
+
* - `object`: Inline PostCSS options with optional `plugins` array.
|
|
214
|
+
* - Omitted: Auto-detect PostCSS config from the project root.
|
|
215
|
+
*
|
|
216
|
+
* Only used when {@linkcode transformer} is `'postcss'`.
|
|
217
|
+
* Requires `postcss` to be installed.
|
|
218
|
+
*
|
|
219
|
+
* @see https://github.com/postcss/postcss
|
|
220
|
+
*/
|
|
524
221
|
postcss?: PostCSSOptions;
|
|
525
222
|
/**
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
223
|
+
* When enabled, JS output preserves import statements pointing to emitted CSS files.
|
|
224
|
+
* Consumers of the library will automatically import the CSS alongside the JS.
|
|
225
|
+
*
|
|
226
|
+
* @default false
|
|
227
|
+
*/
|
|
531
228
|
inject?: boolean;
|
|
532
229
|
/**
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
230
|
+
* CSS modules configuration.
|
|
231
|
+
* When not `false`, `.module.css` files (and preprocessor variants) are
|
|
232
|
+
* treated as CSS modules with scoped class names.
|
|
233
|
+
*
|
|
234
|
+
* @see https://github.com/css-modules/css-modules
|
|
235
|
+
*
|
|
236
|
+
* @default {}
|
|
237
|
+
*/
|
|
541
238
|
modules?: CSSModulesOptions | false;
|
|
542
239
|
/**
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
240
|
+
* CSS transformer to use. Controls how CSS is processed:
|
|
241
|
+
*
|
|
242
|
+
* - `'lightningcss'` (default): `@import` handled by Lightning CSS
|
|
243
|
+
* `bundleAsync()`, PostCSS is **not** used at all.
|
|
244
|
+
* - `'postcss'`: `@import` handled by `postcss-import`,
|
|
245
|
+
* PostCSS plugins applied, Lightning CSS used only for final
|
|
246
|
+
* targets/minify transform.
|
|
247
|
+
*
|
|
248
|
+
* @default 'lightningcss'
|
|
249
|
+
* @see https://vite.dev/config/shared-options#css-transformer
|
|
250
|
+
*/
|
|
554
251
|
transformer?: "postcss" | "lightningcss";
|
|
555
252
|
}
|
|
556
253
|
type PostCSSOptions = string | (Record<string, any> & {
|
|
@@ -1335,234 +1032,265 @@ type TsConfigJson = {
|
|
|
1335
1032
|
references?: TsConfigJson.References[];
|
|
1336
1033
|
};
|
|
1337
1034
|
//#endregion
|
|
1338
|
-
//#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.
|
|
1035
|
+
//#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.27.9_@typescript+native-preview@7.0.0-dev.20260605.1_oxc-resolver_9f43f644337e3a4030148b21b794fdcf/node_modules/rolldown-plugin-dts/dist/index.d.mts
|
|
1339
1036
|
//#region src/options.d.ts
|
|
1037
|
+
interface Logger$1 {
|
|
1038
|
+
info: (...args: any[]) => void;
|
|
1039
|
+
warn: (...args: any[]) => void;
|
|
1040
|
+
error: (...args: any[]) => void;
|
|
1041
|
+
}
|
|
1340
1042
|
interface GeneralOptions {
|
|
1341
1043
|
/**
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1044
|
+
* The generator used to produce `.d.ts` files.
|
|
1045
|
+
*
|
|
1046
|
+
* - `'tsc'`: The TypeScript 5.x/6.x compiler. Supports all TypeScript features.
|
|
1047
|
+
* - `'oxc'`: {@link https://oxc.rs Oxc}'s isolated declaration generator. Much
|
|
1048
|
+
* faster than `tsc`, but only supports code that satisfies
|
|
1049
|
+
* [`isolatedDeclarations`](https://www.typescriptlang.org/tsconfig/#isolatedDeclarations).
|
|
1050
|
+
* - `'tsgo'`: **[Experimental]** The TypeScript Go compiler
|
|
1051
|
+
* ({@link https://github.com/microsoft/typescript-go tsgo}). May not support
|
|
1052
|
+
* all TypeScript features yet.
|
|
1053
|
+
*
|
|
1054
|
+
* When unset, the generator is inferred:
|
|
1055
|
+
* - `'oxc'` if {@link Options.oxc oxc} options are provided or
|
|
1056
|
+
* `isolatedDeclarations` is enabled in `compilerOptions`.
|
|
1057
|
+
* - `'tsgo'` if TypeScript 7.0 (or `@typescript/native-preview`) is installed,
|
|
1058
|
+
* or {@link Options.tsgo tsgo} options are provided.
|
|
1059
|
+
* - `'tsc'` otherwise, and always when {@link TscOptions.vue vue} or
|
|
1060
|
+
* {@link TscOptions.tsMacro tsMacro} is enabled.
|
|
1061
|
+
*
|
|
1062
|
+
* @default 'tsc'
|
|
1063
|
+
*/
|
|
1064
|
+
generator?: "tsc" | "oxc" | "tsgo";
|
|
1065
|
+
/**
|
|
1066
|
+
* Glob pattern(s) to filter which entry files get `.d.ts` generation.
|
|
1067
|
+
*
|
|
1068
|
+
* When specified, only entry files matching these patterns will emit `.d.ts` chunks.
|
|
1069
|
+
* When not specified, all entries get `.d.ts` generation.
|
|
1070
|
+
*
|
|
1071
|
+
* Supports negation patterns (e.g., `['**', '!src/icons/**']`) for exclusion.
|
|
1072
|
+
* Patterns are matched against file paths relative to `cwd`.
|
|
1073
|
+
*
|
|
1074
|
+
* @example
|
|
1075
|
+
* entry: 'src/index.ts'
|
|
1076
|
+
* entry: ['src/*.ts', '!src/internal/**']
|
|
1077
|
+
*/
|
|
1354
1078
|
entry?: string | string[];
|
|
1355
1079
|
/**
|
|
1356
|
-
|
|
1357
|
-
|
|
1080
|
+
* The directory in which the plugin will search for the `tsconfig.json` file.
|
|
1081
|
+
*/
|
|
1358
1082
|
cwd?: string;
|
|
1359
1083
|
/**
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1084
|
+
* Set to `true` if your entry files are `.d.ts` files instead of `.ts` files.
|
|
1085
|
+
*
|
|
1086
|
+
* When enabled, the plugin will skip generating a `.d.ts` file for the entry point.
|
|
1087
|
+
*/
|
|
1364
1088
|
dtsInput?: boolean;
|
|
1365
1089
|
/**
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1090
|
+
* If `true`, the plugin will emit only `.d.ts` files and remove all other output chunks.
|
|
1091
|
+
*
|
|
1092
|
+
* This is especially useful when generating `.d.ts` files for the CommonJS format as part of a separate build step.
|
|
1093
|
+
*/
|
|
1370
1094
|
emitDtsOnly?: boolean;
|
|
1371
1095
|
/**
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1096
|
+
* The path to the `tsconfig.json` file.
|
|
1097
|
+
*
|
|
1098
|
+
* If set to `false`, the plugin will ignore any `tsconfig.json` file.
|
|
1099
|
+
* You can still specify `compilerOptions` directly in the options.
|
|
1100
|
+
*
|
|
1101
|
+
* @default 'tsconfig.json'
|
|
1102
|
+
*/
|
|
1379
1103
|
tsconfig?: string | boolean;
|
|
1380
1104
|
/**
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1105
|
+
* Pass a raw `tsconfig.json` object directly to the plugin.
|
|
1106
|
+
*
|
|
1107
|
+
* @see https://www.typescriptlang.org/tsconfig
|
|
1108
|
+
*/
|
|
1385
1109
|
tsconfigRaw?: Omit<TsConfigJson, "compilerOptions">;
|
|
1386
1110
|
/**
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1111
|
+
* Override the `compilerOptions` specified in `tsconfig.json`.
|
|
1112
|
+
*
|
|
1113
|
+
* @see https://www.typescriptlang.org/tsconfig/#compilerOptions
|
|
1114
|
+
*/
|
|
1391
1115
|
compilerOptions?: TsConfigJson.CompilerOptions;
|
|
1392
1116
|
/**
|
|
1393
|
-
|
|
1394
|
-
|
|
1117
|
+
* If `true`, the plugin will generate declaration maps (`.d.ts.map`) for `.d.ts` files.
|
|
1118
|
+
*/
|
|
1395
1119
|
sourcemap?: boolean;
|
|
1396
1120
|
/**
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1121
|
+
* Specifies a resolver to resolve type definitions, especially for `node_modules`.
|
|
1122
|
+
*
|
|
1123
|
+
* - `'oxc'`: Uses Oxc's module resolution, which is faster and more efficient.
|
|
1124
|
+
* - `'tsc'`: Uses TypeScript's native module resolution, which may be more compatible with complex setups, but slower.
|
|
1125
|
+
*
|
|
1126
|
+
* @default 'oxc'
|
|
1127
|
+
*/
|
|
1404
1128
|
resolver?: "oxc" | "tsc";
|
|
1405
1129
|
/**
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1130
|
+
* Determines how the default export is emitted.
|
|
1131
|
+
*
|
|
1132
|
+
* If set to `true`, and you are only exporting a single item using `export default ...`,
|
|
1133
|
+
* the output will use `export = ...` instead of the standard ES module syntax.
|
|
1134
|
+
* This is useful for compatibility with CommonJS.
|
|
1135
|
+
* This only controls the output format and does not enable support for
|
|
1136
|
+
* CommonJS-style `.d.ts` input.
|
|
1137
|
+
*/
|
|
1414
1138
|
cjsDefault?: boolean;
|
|
1415
1139
|
/**
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1140
|
+
* Indicates whether the generated `.d.ts` files have side effects.
|
|
1141
|
+
* - If set to `true`, Rolldown will treat the `.d.ts` files as having side effects during tree-shaking.
|
|
1142
|
+
* - If set to `false`, Rolldown may consider the `.d.ts` files as side-effect-free, potentially removing them if they are not imported.
|
|
1143
|
+
*
|
|
1144
|
+
* @default false
|
|
1145
|
+
*/
|
|
1422
1146
|
sideEffects?: boolean;
|
|
1147
|
+
logger?: Logger$1;
|
|
1423
1148
|
}
|
|
1424
1149
|
interface TscOptions {
|
|
1425
1150
|
/**
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1151
|
+
* Build mode for the TypeScript compiler:
|
|
1152
|
+
*
|
|
1153
|
+
* - If `true`, the plugin will use [`tsc -b`](https://www.typescriptlang.org/docs/handbook/project-references.html#build-mode-for-typescript) to build the project and all referenced projects before emitting `.d.ts` files.
|
|
1154
|
+
* - If `false`, the plugin will use [`tsc`](https://www.typescriptlang.org/docs/handbook/compiler-options.html) to emit `.d.ts` files without building referenced projects.
|
|
1155
|
+
*
|
|
1156
|
+
* @default false
|
|
1157
|
+
*/
|
|
1433
1158
|
build?: boolean;
|
|
1434
1159
|
/**
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1160
|
+
* If your tsconfig.json has
|
|
1161
|
+
* [`references`](https://www.typescriptlang.org/tsconfig/#references) option,
|
|
1162
|
+
* `rolldown-plugin-dts` will use [`tsc
|
|
1163
|
+
* -b`](https://www.typescriptlang.org/docs/handbook/project-references.html#build-mode-for-typescript)
|
|
1164
|
+
* to build the project and all referenced projects before emitting `.d.ts`
|
|
1165
|
+
* files.
|
|
1166
|
+
*
|
|
1167
|
+
* In such case, if this option is `true`, `rolldown-plugin-dts` will write
|
|
1168
|
+
* down all built files into your disk, including
|
|
1169
|
+
* [`.tsbuildinfo`](https://www.typescriptlang.org/tsconfig/#tsBuildInfoFile)
|
|
1170
|
+
* and other built files. This is equivalent to running `tsc -b` in your
|
|
1171
|
+
* project.
|
|
1172
|
+
*
|
|
1173
|
+
* Otherwise, if this option is `false`, `rolldown-plugin-dts` will write
|
|
1174
|
+
* built files only into memory and leave a small footprint in your disk.
|
|
1175
|
+
*
|
|
1176
|
+
* Enabling this option will decrease the build time by caching previous build
|
|
1177
|
+
* results. This is helpful when you have a large project with multiple
|
|
1178
|
+
* referenced projects.
|
|
1179
|
+
*
|
|
1180
|
+
* By default, `incremental` is `true` if your tsconfig has
|
|
1181
|
+
* [`incremental`](https://www.typescriptlang.org/tsconfig/#incremental) or
|
|
1182
|
+
* [`tsBuildInfoFile`](https://www.typescriptlang.org/tsconfig/#tsBuildInfoFile)
|
|
1183
|
+
* enabled.
|
|
1184
|
+
*
|
|
1185
|
+
* This option is only used when {@link Options.oxc} is
|
|
1186
|
+
* `false`.
|
|
1187
|
+
*/
|
|
1463
1188
|
incremental?: boolean;
|
|
1464
1189
|
/**
|
|
1465
|
-
|
|
1466
|
-
|
|
1190
|
+
* If `true`, the plugin will generate `.d.ts` files using `vue-tsc`.
|
|
1191
|
+
*/
|
|
1467
1192
|
vue?: boolean;
|
|
1468
1193
|
/**
|
|
1469
|
-
|
|
1470
|
-
|
|
1194
|
+
* If `true`, the plugin will generate `.d.ts` files using `@ts-macro/tsc`.
|
|
1195
|
+
*/
|
|
1471
1196
|
tsMacro?: boolean;
|
|
1472
1197
|
/**
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1198
|
+
* If `true`, the plugin will launch a separate process for `tsc` or `vue-tsc`.
|
|
1199
|
+
* This enables processing multiple projects in parallel.
|
|
1200
|
+
*/
|
|
1476
1201
|
parallel?: boolean;
|
|
1477
1202
|
/**
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1203
|
+
* If `true`, the plugin will prepare all files listed in `tsconfig.json` for `tsc` or `vue-tsc`.
|
|
1204
|
+
*
|
|
1205
|
+
* This is especially useful when you have a single `tsconfig.json` for multiple projects in a monorepo.
|
|
1206
|
+
*/
|
|
1482
1207
|
eager?: boolean;
|
|
1483
1208
|
/**
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1209
|
+
* If `true`, the plugin will create a new isolated context for each build,
|
|
1210
|
+
* ensuring that previously generated `.d.ts` code and caches are not reused.
|
|
1211
|
+
*
|
|
1212
|
+
* By default, the plugin may reuse internal caches or incremental build artifacts
|
|
1213
|
+
* to speed up repeated builds. Enabling this option forces a clean context,
|
|
1214
|
+
* guaranteeing that all type definitions are generated from scratch.
|
|
1215
|
+
*
|
|
1216
|
+
* @default false
|
|
1217
|
+
*/
|
|
1493
1218
|
newContext?: boolean;
|
|
1494
1219
|
/**
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1220
|
+
* If `true`, the plugin will emit `.d.ts` files for `.js` files as well.
|
|
1221
|
+
* This is useful when you want to generate type definitions for JavaScript files with JSDoc comments.
|
|
1222
|
+
*
|
|
1223
|
+
* Enabled by default when `allowJs` in compilerOptions is `true`.
|
|
1224
|
+
* This option is only used when {@link Options.oxc} is
|
|
1225
|
+
* `false`.
|
|
1226
|
+
*/
|
|
1502
1227
|
emitJs?: boolean;
|
|
1503
1228
|
}
|
|
1504
1229
|
interface Options$1 extends GeneralOptions, TscOptions {
|
|
1505
1230
|
/**
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1231
|
+
* If `true`, the plugin will generate `.d.ts` files using Oxc,
|
|
1232
|
+
* which is significantly faster than the TypeScript compiler.
|
|
1233
|
+
*
|
|
1234
|
+
* This option is automatically enabled when `isolatedDeclarations` in `compilerOptions` is set to `true`.
|
|
1235
|
+
*/
|
|
1511
1236
|
oxc?: boolean | Omit<IsolatedDeclarationsOptions, "sourcemap">;
|
|
1512
1237
|
/**
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1238
|
+
* **[Experimental]** Enables DTS generation using `tsgo`.
|
|
1239
|
+
*
|
|
1240
|
+
* This is automatically enabled when the TypeScript Go compiler (v7+) is
|
|
1241
|
+
* installed as the `typescript` package. Otherwise, make sure
|
|
1242
|
+
* `@typescript/native-preview` is installed as a dependency, or provide a
|
|
1243
|
+
* custom path to the `tsgo` binary using the `path` option.
|
|
1244
|
+
*
|
|
1245
|
+
* **Note:** TypeScript 7.0 does not yet have a stable API and is experimental.
|
|
1246
|
+
* This option is not yet recommended for production environments, and some
|
|
1247
|
+
* options (such as `tsconfigRaw` and `isolatedDeclarations`) will be
|
|
1248
|
+
* unavailable when it is enabled.
|
|
1249
|
+
*
|
|
1250
|
+
*
|
|
1251
|
+
* ```ts
|
|
1252
|
+
* // Use tsgo from `@typescript/native-preview` dependency
|
|
1253
|
+
* tsgo: true
|
|
1254
|
+
*
|
|
1255
|
+
* // Use custom tsgo path (e.g., managed by Nix)
|
|
1256
|
+
* tsgo: { path: '/path/to/tsgo' }
|
|
1257
|
+
* ```
|
|
1258
|
+
*/
|
|
1530
1259
|
tsgo?: boolean | TsgoOptions;
|
|
1531
1260
|
}
|
|
1532
1261
|
interface TsgoOptions {
|
|
1533
|
-
enabled?: boolean;
|
|
1534
1262
|
/**
|
|
1535
|
-
|
|
1536
|
-
|
|
1263
|
+
* Custom path to the `tsgo` binary.
|
|
1264
|
+
*/
|
|
1537
1265
|
path?: string;
|
|
1538
1266
|
}
|
|
1539
1267
|
//#endregion
|
|
1540
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.
|
|
1268
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.7_@tsdown+exe@0.22.7_@type_53c241a653f2227a5df8ba2949047afe/node_modules/tsdown/dist/types-C2uYWTfo.d.mts
|
|
1541
1269
|
//#region src/features/copy.d.ts
|
|
1542
1270
|
interface CopyEntry {
|
|
1543
1271
|
/**
|
|
1544
|
-
|
|
1545
|
-
|
|
1272
|
+
* Source path or glob pattern.
|
|
1273
|
+
*/
|
|
1546
1274
|
from: string | string[];
|
|
1547
1275
|
/**
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1276
|
+
* Destination path.
|
|
1277
|
+
* If not specified, defaults to the output directory ("outDir").
|
|
1278
|
+
*/
|
|
1551
1279
|
to?: string;
|
|
1552
1280
|
/**
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1281
|
+
* Whether to flatten the copied files (not preserving directory structure).
|
|
1282
|
+
*
|
|
1283
|
+
* @default true
|
|
1284
|
+
*/
|
|
1557
1285
|
flatten?: boolean;
|
|
1558
1286
|
/**
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1287
|
+
* Output copied items to console.
|
|
1288
|
+
* @default false
|
|
1289
|
+
*/
|
|
1562
1290
|
verbose?: boolean;
|
|
1563
1291
|
/**
|
|
1564
|
-
|
|
1565
|
-
|
|
1292
|
+
* Change destination file or folder name.
|
|
1293
|
+
*/
|
|
1566
1294
|
rename?: string | ((name: string, extension: string, fullPath: string) => string);
|
|
1567
1295
|
}
|
|
1568
1296
|
type CopyOptions = Arrayable<string | CopyEntry>;
|
|
@@ -1581,40 +1309,40 @@ interface TsdownBundle extends AsyncDisposable {
|
|
|
1581
1309
|
type NoExternalFn = (id: string, importer: string | undefined) => boolean | null | undefined | void;
|
|
1582
1310
|
interface DepsConfig {
|
|
1583
1311
|
/**
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1312
|
+
* Mark dependencies as external (not bundled).
|
|
1313
|
+
* Accepts strings, regular expressions, or Rolldown's
|
|
1314
|
+
* {@linkcode ExternalOption}.
|
|
1315
|
+
*/
|
|
1588
1316
|
neverBundle?: ExternalOption;
|
|
1589
1317
|
/**
|
|
1590
|
-
|
|
1591
|
-
|
|
1318
|
+
* Force dependencies to be bundled, even if they are in `dependencies`, `peerDependencies`, or `optionalDependencies`.
|
|
1319
|
+
*/
|
|
1592
1320
|
alwaysBundle?: Arrayable<string | RegExp> | NoExternalFn;
|
|
1593
1321
|
/**
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1322
|
+
* Whitelist of dependencies allowed to be bundled from `node_modules`.
|
|
1323
|
+
* Throws an error if any unlisted dependency is bundled.
|
|
1324
|
+
*
|
|
1325
|
+
* - `undefined` (default): Show warnings for bundled dependencies.
|
|
1326
|
+
* - `false`: Suppress all warnings about bundled dependencies.
|
|
1327
|
+
*
|
|
1328
|
+
* Note: Be sure to include all required sub-dependencies as well.
|
|
1329
|
+
*/
|
|
1602
1330
|
onlyBundle?: Arrayable<string | RegExp> | false;
|
|
1603
1331
|
/**
|
|
1604
|
-
|
|
1605
|
-
|
|
1332
|
+
* @deprecated Use {@linkcode onlyBundle} instead.
|
|
1333
|
+
*/
|
|
1606
1334
|
onlyAllowBundle?: Arrayable<string | RegExp> | false;
|
|
1607
1335
|
/**
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1336
|
+
* Skip bundling all `node_modules` dependencies.
|
|
1337
|
+
*
|
|
1338
|
+
* **Note:** This option cannot be used together with {@linkcode alwaysBundle}.
|
|
1339
|
+
*
|
|
1340
|
+
* @default false
|
|
1341
|
+
*/
|
|
1614
1342
|
skipNodeModulesBundle?: boolean;
|
|
1615
1343
|
/**
|
|
1616
|
-
|
|
1617
|
-
|
|
1344
|
+
* Override dependency bundling options for declaration file generation.
|
|
1345
|
+
*/
|
|
1618
1346
|
dts?: Pick<DepsConfig, "alwaysBundle" | "neverBundle">;
|
|
1619
1347
|
}
|
|
1620
1348
|
interface ResolvedDepsConfig {
|
|
@@ -1623,106 +1351,403 @@ interface ResolvedDepsConfig {
|
|
|
1623
1351
|
onlyBundle?: Array<string | RegExp> | false;
|
|
1624
1352
|
skipNodeModulesBundle: boolean;
|
|
1625
1353
|
/**
|
|
1626
|
-
|
|
1627
|
-
|
|
1354
|
+
* Override dependency bundling options for declaration file generation.
|
|
1355
|
+
*/
|
|
1628
1356
|
dts: Pick<ResolvedDepsConfig, "alwaysBundle" | "neverBundle">;
|
|
1629
1357
|
}
|
|
1630
1358
|
//#endregion
|
|
1631
1359
|
//#region src/features/devtools.d.ts
|
|
1632
1360
|
interface DevtoolsOptions extends NonNullable<InputOptions["devtools"]> {
|
|
1633
1361
|
/**
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1362
|
+
* **[experimental]** Enable devtools integration. `@vitejs/devtools` must be installed as a dependency.
|
|
1363
|
+
*
|
|
1364
|
+
* Defaults to true, if `@vitejs/devtools` is installed.
|
|
1365
|
+
*/
|
|
1638
1366
|
ui?: boolean | Partial<StartOptions>;
|
|
1639
1367
|
/**
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1368
|
+
* Clean devtools stale sessions.
|
|
1369
|
+
*
|
|
1370
|
+
* @default true
|
|
1371
|
+
*/
|
|
1644
1372
|
clean?: boolean;
|
|
1645
1373
|
} //#endregion
|
|
1646
1374
|
//#region src/features/exe.d.ts
|
|
1647
1375
|
interface ExeOptions extends ExeExtensionOptions {
|
|
1648
1376
|
seaConfig?: Omit<SeaConfig, "main" | "output" | "mainFormat">;
|
|
1649
1377
|
/**
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1378
|
+
* Output file name without any suffix or extension.
|
|
1379
|
+
* For example, do not include `.exe`, platform suffixes, or architecture suffixes.
|
|
1380
|
+
*/
|
|
1653
1381
|
fileName?: string | ((chunk: RolldownChunk) => string);
|
|
1654
1382
|
/**
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
outDir?: string;
|
|
1659
|
-
}
|
|
1660
|
-
/**
|
|
1661
|
-
* See also [Node.js SEA Documentation](https://nodejs.org/api/single-executable-applications.html#generating-single-executable-applications-with---build-sea)
|
|
1662
|
-
*
|
|
1663
|
-
* Note some default values are different from Node.js defaults to optimize for typical use cases (e.g. disabling experimental warning, enabling code cache). These can be overridden.
|
|
1664
|
-
*/
|
|
1665
|
-
interface SeaConfig {
|
|
1666
|
-
main?: string;
|
|
1383
|
+
* Output directory for executables.
|
|
1384
|
+
* @default 'build'
|
|
1385
|
+
*/
|
|
1386
|
+
outDir?: string;
|
|
1387
|
+
}
|
|
1388
|
+
/**
|
|
1389
|
+
* See also [Node.js SEA Documentation](https://nodejs.org/api/single-executable-applications.html#generating-single-executable-applications-with---build-sea)
|
|
1390
|
+
*
|
|
1391
|
+
* Note some default values are different from Node.js defaults to optimize for typical use cases (e.g. disabling experimental warning, enabling code cache). These can be overridden.
|
|
1392
|
+
*/
|
|
1393
|
+
interface SeaConfig {
|
|
1394
|
+
main?: string;
|
|
1395
|
+
/**
|
|
1396
|
+
* Optional, if not specified, uses the current Node.js binary
|
|
1397
|
+
*/
|
|
1398
|
+
executable?: string;
|
|
1399
|
+
output?: string;
|
|
1400
|
+
/**
|
|
1401
|
+
* @default tsdownConfig.format === 'es' ? 'module' : 'commonjs'
|
|
1402
|
+
*/
|
|
1403
|
+
mainFormat?: "commonjs" | "module";
|
|
1404
|
+
/**
|
|
1405
|
+
* @default true
|
|
1406
|
+
*/
|
|
1407
|
+
disableExperimentalSEAWarning?: boolean;
|
|
1408
|
+
/**
|
|
1409
|
+
* @default false
|
|
1410
|
+
*/
|
|
1411
|
+
useSnapshot?: boolean;
|
|
1412
|
+
/**
|
|
1413
|
+
* @default false
|
|
1414
|
+
*/
|
|
1415
|
+
useCodeCache?: boolean;
|
|
1416
|
+
execArgv?: string[];
|
|
1417
|
+
/**
|
|
1418
|
+
* @default 'env'
|
|
1419
|
+
*/
|
|
1420
|
+
execArgvExtension?: "none" | "env" | "cli";
|
|
1421
|
+
assets?: Record<string, string>;
|
|
1422
|
+
} //#endregion
|
|
1423
|
+
//#region src/features/hooks.d.ts
|
|
1424
|
+
interface BuildContext {
|
|
1425
|
+
options: ResolvedConfig;
|
|
1426
|
+
hooks: Hookable<TsdownHooks>;
|
|
1427
|
+
}
|
|
1428
|
+
interface RolldownContext {
|
|
1429
|
+
buildOptions: BuildOptions;
|
|
1430
|
+
}
|
|
1431
|
+
/**
|
|
1432
|
+
* Hooks for tsdown.
|
|
1433
|
+
*/
|
|
1434
|
+
interface TsdownHooks {
|
|
1435
|
+
/**
|
|
1436
|
+
* Invoked before each tsdown build starts.
|
|
1437
|
+
* Use this hook to perform setup or preparation tasks.
|
|
1438
|
+
*/
|
|
1439
|
+
"build:prepare": (ctx: BuildContext) => void | Promise<void>;
|
|
1440
|
+
/**
|
|
1441
|
+
* Invoked before each Rolldown build.
|
|
1442
|
+
* For dual-format builds, this hook is called for each format.
|
|
1443
|
+
* Useful for configuring or modifying the build context before bundling.
|
|
1444
|
+
*/
|
|
1445
|
+
"build:before": (ctx: BuildContext & RolldownContext) => void | Promise<void>;
|
|
1446
|
+
/**
|
|
1447
|
+
* Invoked after each tsdown build completes.
|
|
1448
|
+
* Use this hook for cleanup or post-processing tasks.
|
|
1449
|
+
*/
|
|
1450
|
+
"build:done": (ctx: BuildContext & {
|
|
1451
|
+
chunks: RolldownChunk[];
|
|
1452
|
+
}) => void | Promise<void>;
|
|
1453
|
+
} //#endregion
|
|
1454
|
+
//#region node_modules/.pnpm/pkg-types@2.3.1/node_modules/pkg-types/dist/index.d.mts
|
|
1455
|
+
//#endregion
|
|
1456
|
+
//#region src/packagejson/types.d.ts
|
|
1457
|
+
interface PackageJson {
|
|
1458
|
+
/**
|
|
1459
|
+
* The name is what your thing is called.
|
|
1460
|
+
* Some rules:
|
|
1461
|
+
* - The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
|
|
1462
|
+
* - The name can’t start with a dot or an underscore.
|
|
1463
|
+
* - New packages must not have uppercase letters in the name.
|
|
1464
|
+
* - The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can’t contain any non-URL-safe characters.
|
|
1465
|
+
*/
|
|
1466
|
+
name?: string;
|
|
1467
|
+
/**
|
|
1468
|
+
* Version must be parseable by `node-semver`, which is bundled with npm as a dependency. (`npm install semver` to use it yourself.)
|
|
1469
|
+
*/
|
|
1470
|
+
version?: string;
|
|
1471
|
+
/**
|
|
1472
|
+
* Put a description in it. It’s a string. This helps people discover your package, as it’s listed in `npm search`.
|
|
1473
|
+
*/
|
|
1474
|
+
description?: string;
|
|
1475
|
+
/**
|
|
1476
|
+
* Put keywords in it. It’s an array of strings. This helps people discover your package as it’s listed in `npm search`.
|
|
1477
|
+
*/
|
|
1478
|
+
keywords?: string[];
|
|
1479
|
+
/**
|
|
1480
|
+
* The url to the project homepage.
|
|
1481
|
+
*/
|
|
1482
|
+
homepage?: string;
|
|
1483
|
+
/**
|
|
1484
|
+
* The url to your project’s issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.
|
|
1485
|
+
*/
|
|
1486
|
+
bugs?: string | {
|
|
1487
|
+
url?: string;
|
|
1488
|
+
email?: string;
|
|
1489
|
+
};
|
|
1490
|
+
/**
|
|
1491
|
+
* You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you’re placing on it.
|
|
1492
|
+
*/
|
|
1493
|
+
license?: string;
|
|
1494
|
+
/**
|
|
1495
|
+
* Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the `npm docs` command will be able to find you.
|
|
1496
|
+
* For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:
|
|
1497
|
+
*/
|
|
1498
|
+
repository?: string | {
|
|
1499
|
+
type: string;
|
|
1500
|
+
url: string;
|
|
1501
|
+
/**
|
|
1502
|
+
* If the `package.json` for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives:
|
|
1503
|
+
*/
|
|
1504
|
+
directory?: string;
|
|
1505
|
+
};
|
|
1506
|
+
/**
|
|
1507
|
+
* The `scripts` field is a dictionary containing script commands that are run at various times in the lifecycle of your package.
|
|
1508
|
+
*/
|
|
1509
|
+
scripts?: PackageJsonScripts;
|
|
1510
|
+
/**
|
|
1511
|
+
* If you set `"private": true` in your package.json, then npm will refuse to publish it.
|
|
1512
|
+
*/
|
|
1513
|
+
private?: boolean;
|
|
1514
|
+
/**
|
|
1515
|
+
* The “author” is one person.
|
|
1516
|
+
*/
|
|
1517
|
+
author?: PackageJsonPerson;
|
|
1518
|
+
/**
|
|
1519
|
+
* “contributors” is an array of people.
|
|
1520
|
+
*/
|
|
1521
|
+
contributors?: PackageJsonPerson[];
|
|
1522
|
+
/**
|
|
1523
|
+
* An object containing a URL that provides up-to-date information
|
|
1524
|
+
* about ways to help fund development of your package,
|
|
1525
|
+
* a string URL, or an array of objects and string URLs
|
|
1526
|
+
*/
|
|
1527
|
+
funding?: PackageJsonFunding | PackageJsonFunding[];
|
|
1528
|
+
/**
|
|
1529
|
+
* The optional `files` field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. File patterns follow a similar syntax to `.gitignore`, but reversed: including a file, directory, or glob pattern (`*`, `**\/*`, and such) will make it so that file is included in the tarball when it’s packed. Omitting the field will make it default to `["*"]`, which means it will include all files.
|
|
1530
|
+
*/
|
|
1531
|
+
files?: string[];
|
|
1532
|
+
/**
|
|
1533
|
+
* The main field is a module ID that is the primary entry point to your program. That is, if your package is named `foo`, and a user installs it, and then does `require("foo")`, then your main module’s exports object will be returned.
|
|
1534
|
+
* This should be a module ID relative to the root of your package folder.
|
|
1535
|
+
* For most modules, it makes the most sense to have a main script and often not much else.
|
|
1536
|
+
*/
|
|
1537
|
+
main?: string;
|
|
1538
|
+
/**
|
|
1539
|
+
* If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might rely on primitives that aren’t available in Node.js modules. (e.g. window)
|
|
1540
|
+
*/
|
|
1541
|
+
browser?: string | Record<string, string | false>;
|
|
1542
|
+
/**
|
|
1543
|
+
* The `unpkg` field is used to specify the URL to a UMD module for your package. This is used by default in the unpkg.com CDN service.
|
|
1544
|
+
*/
|
|
1545
|
+
unpkg?: string;
|
|
1546
|
+
/**
|
|
1547
|
+
* A map of command name to local file name. On install, npm will symlink that file into `prefix/bin` for global installs, or `./node_modules/.bin/` for local installs.
|
|
1548
|
+
*/
|
|
1549
|
+
bin?: string | Record<string, string>;
|
|
1550
|
+
/**
|
|
1551
|
+
* Specify either a single file or an array of filenames to put in place for the `man` program to find.
|
|
1552
|
+
*/
|
|
1553
|
+
man?: string | string[];
|
|
1554
|
+
/**
|
|
1555
|
+
* Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
|
|
1556
|
+
*/
|
|
1557
|
+
dependencies?: Record<string, string>;
|
|
1558
|
+
/**
|
|
1559
|
+
* If someone is planning on downloading and using your module in their program, then they probably don’t want or need to download and build the external test or documentation framework that you use.
|
|
1560
|
+
* In this case, it’s best to map these additional items in a `devDependencies` object.
|
|
1561
|
+
*/
|
|
1562
|
+
devDependencies?: Record<string, string>;
|
|
1563
|
+
/**
|
|
1564
|
+
* If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the `optionalDependencies` object. This is a map of package name to version or url, just like the `dependencies` object. The difference is that build failures do not cause installation to fail.
|
|
1565
|
+
*/
|
|
1566
|
+
optionalDependencies?: Record<string, string>;
|
|
1567
|
+
/**
|
|
1568
|
+
* In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a `require` of this host. This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.
|
|
1569
|
+
*/
|
|
1570
|
+
peerDependencies?: Record<string, string>;
|
|
1571
|
+
/**
|
|
1572
|
+
* TypeScript typings, typically ending by `.d.ts`.
|
|
1573
|
+
*/
|
|
1574
|
+
types?: string;
|
|
1575
|
+
/**
|
|
1576
|
+
* This field is synonymous with `types`.
|
|
1577
|
+
*/
|
|
1578
|
+
typings?: string;
|
|
1579
|
+
/**
|
|
1580
|
+
* Non-Standard Node.js alternate entry-point to main.
|
|
1581
|
+
* An initial implementation for supporting CJS packages (from main), and use module for ESM modules.
|
|
1582
|
+
*/
|
|
1583
|
+
module?: string;
|
|
1584
|
+
/**
|
|
1585
|
+
* Make main entry-point be loaded as an ESM module, support "export" syntax instead of "require"
|
|
1586
|
+
*
|
|
1587
|
+
* Docs:
|
|
1588
|
+
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_package_json_type_field
|
|
1589
|
+
*
|
|
1590
|
+
* @default 'commonjs'
|
|
1591
|
+
* @since Node.js v14
|
|
1592
|
+
*/
|
|
1593
|
+
type?: "module" | "commonjs";
|
|
1594
|
+
/**
|
|
1595
|
+
* Alternate and extensible alternative to "main" entry point.
|
|
1596
|
+
*
|
|
1597
|
+
* When using `{type: "module"}`, any ESM module file MUST end with `.mjs` extension.
|
|
1598
|
+
*
|
|
1599
|
+
* Docs:
|
|
1600
|
+
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_exports_sugar
|
|
1601
|
+
*
|
|
1602
|
+
* @since Node.js v12.7
|
|
1603
|
+
*/
|
|
1604
|
+
exports?: PackageJsonExports;
|
|
1605
|
+
/**
|
|
1606
|
+
* Docs:
|
|
1607
|
+
* - https://nodejs.org/api/packages.html#imports
|
|
1608
|
+
*/
|
|
1609
|
+
imports?: Record<string, string | Record<string, string>>;
|
|
1667
1610
|
/**
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1611
|
+
* The field is used to define a set of sub-packages (or workspaces) within a monorepo.
|
|
1612
|
+
*
|
|
1613
|
+
* This field is an array of glob patterns or an object with specific configurations for managing
|
|
1614
|
+
* multiple packages in a single repository.
|
|
1615
|
+
*/
|
|
1616
|
+
workspaces?: string[] | {
|
|
1617
|
+
/**
|
|
1618
|
+
* Workspace package paths. Glob patterns are supported.
|
|
1619
|
+
*/
|
|
1620
|
+
packages?: string[];
|
|
1621
|
+
/**
|
|
1622
|
+
* Packages to block from hoisting to the workspace root.
|
|
1623
|
+
* Uses glob patterns to match module paths in the dependency tree.
|
|
1624
|
+
*
|
|
1625
|
+
* Docs:
|
|
1626
|
+
* - https://classic.yarnpkg.com/blog/2018/02/15/nohoist/
|
|
1627
|
+
*/
|
|
1628
|
+
nohoist?: string[];
|
|
1629
|
+
};
|
|
1672
1630
|
/**
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1631
|
+
* The field is used to specify different TypeScript declaration files for
|
|
1632
|
+
* different versions of TypeScript, allowing for version-specific type definitions.
|
|
1633
|
+
*/
|
|
1634
|
+
typesVersions?: Record<string, Record<string, string[]>>;
|
|
1676
1635
|
/**
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1636
|
+
* You can specify which operating systems your module will run on:
|
|
1637
|
+
* ```json
|
|
1638
|
+
* {
|
|
1639
|
+
* "os": ["darwin", "linux"]
|
|
1640
|
+
* }
|
|
1641
|
+
* ```
|
|
1642
|
+
* You can also block instead of allowing operating systems, just prepend the blocked os with a '!':
|
|
1643
|
+
* ```json
|
|
1644
|
+
* {
|
|
1645
|
+
* "os": ["!win32"]
|
|
1646
|
+
* }
|
|
1647
|
+
* ```
|
|
1648
|
+
* The host operating system is determined by `process.platform`
|
|
1649
|
+
* It is allowed to both block and allow an item, although there isn't any good reason to do this.
|
|
1650
|
+
*/
|
|
1651
|
+
os?: string[];
|
|
1680
1652
|
/**
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1653
|
+
* If your code only runs on certain cpu architectures, you can specify which ones.
|
|
1654
|
+
* ```json
|
|
1655
|
+
* {
|
|
1656
|
+
* "cpu": ["x64", "ia32"]
|
|
1657
|
+
* }
|
|
1658
|
+
* ```
|
|
1659
|
+
* Like the `os` option, you can also block architectures:
|
|
1660
|
+
* ```json
|
|
1661
|
+
* {
|
|
1662
|
+
* "cpu": ["!arm", "!mips"]
|
|
1663
|
+
* }
|
|
1664
|
+
* ```
|
|
1665
|
+
* The host architecture is determined by `process.arch`
|
|
1666
|
+
*/
|
|
1667
|
+
cpu?: string[];
|
|
1684
1668
|
/**
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1669
|
+
* This is a set of config values that will be used at publish-time.
|
|
1670
|
+
*/
|
|
1671
|
+
publishConfig?: {
|
|
1672
|
+
/**
|
|
1673
|
+
* The registry that will be used if the package is published.
|
|
1674
|
+
*/
|
|
1675
|
+
registry?: string;
|
|
1676
|
+
/**
|
|
1677
|
+
* The tag that will be used if the package is published.
|
|
1678
|
+
*/
|
|
1679
|
+
tag?: string;
|
|
1680
|
+
/**
|
|
1681
|
+
* The access level that will be used if the package is published.
|
|
1682
|
+
*/
|
|
1683
|
+
access?: "public" | "restricted";
|
|
1684
|
+
/**
|
|
1685
|
+
* **pnpm-only**
|
|
1686
|
+
*
|
|
1687
|
+
* By default, for portability reasons, no files except those listed in
|
|
1688
|
+
* the bin field will be marked as executable in the resulting package
|
|
1689
|
+
* archive. The executableFiles field lets you declare additional fields
|
|
1690
|
+
* that must have the executable flag (+x) set even if
|
|
1691
|
+
* they aren't directly accessible through the bin field.
|
|
1692
|
+
*/
|
|
1693
|
+
executableFiles?: string[];
|
|
1694
|
+
/**
|
|
1695
|
+
* **pnpm-only**
|
|
1696
|
+
*
|
|
1697
|
+
* You also can use the field `publishConfig.directory` to customize
|
|
1698
|
+
* the published subdirectory relative to the current `package.json`.
|
|
1699
|
+
*
|
|
1700
|
+
* It is expected to have a modified version of the current package in
|
|
1701
|
+
* the specified directory (usually using third party build tools).
|
|
1702
|
+
*/
|
|
1703
|
+
directory?: string;
|
|
1704
|
+
/**
|
|
1705
|
+
* **pnpm-only**
|
|
1706
|
+
*
|
|
1707
|
+
* When set to `true`, the project will be symlinked from the
|
|
1708
|
+
* `publishConfig.directory` location during local development.
|
|
1709
|
+
* @default true
|
|
1710
|
+
*/
|
|
1711
|
+
linkDirectory?: boolean;
|
|
1712
|
+
} & Pick<PackageJson, "bin" | "main" | "exports" | "types" | "typings" | "module" | "browser" | "unpkg" | "typesVersions" | "os" | "cpu">;
|
|
1689
1713
|
/**
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
interface BuildContext {
|
|
1697
|
-
options: ResolvedConfig;
|
|
1698
|
-
hooks: Hookable<TsdownHooks>;
|
|
1699
|
-
}
|
|
1700
|
-
interface RolldownContext {
|
|
1701
|
-
buildOptions: BuildOptions;
|
|
1714
|
+
* See: https://nodejs.org/api/packages.html#packagemanager
|
|
1715
|
+
* This field defines which package manager is expected to be used when working on the current project.
|
|
1716
|
+
* Should be of the format: `<name>@<version>[#hash]`
|
|
1717
|
+
*/
|
|
1718
|
+
packageManager?: string;
|
|
1719
|
+
[key: string]: any;
|
|
1702
1720
|
}
|
|
1703
1721
|
/**
|
|
1704
|
-
*
|
|
1705
|
-
*/
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
}
|
|
1722
|
+
* See: https://docs.npmjs.com/cli/v11/using-npm/scripts#pre--post-scripts
|
|
1723
|
+
*/
|
|
1724
|
+
type PackageJsonScriptWithPreAndPost<S extends string> = S | `${"pre" | "post"}${S}`;
|
|
1725
|
+
/**
|
|
1726
|
+
* See: https://docs.npmjs.com/cli/v11/using-npm/scripts#life-cycle-operation-order
|
|
1727
|
+
*/
|
|
1728
|
+
type PackageJsonNpmLifeCycleScripts = "dependencies" | "prepublishOnly" | PackageJsonScriptWithPreAndPost<"install" | "pack" | "prepare" | "publish" | "restart" | "start" | "stop" | "test" | "version">;
|
|
1729
|
+
/**
|
|
1730
|
+
* See: https://pnpm.io/scripts#lifecycle-scripts
|
|
1731
|
+
*/
|
|
1732
|
+
type PackageJsonPnpmLifeCycleScripts = "pnpm:devPreinstall";
|
|
1733
|
+
type PackageJsonCommonScripts = "build" | "coverage" | "deploy" | "dev" | "format" | "lint" | "preview" | "release" | "typecheck" | "watch";
|
|
1734
|
+
type PackageJsonScriptName = PackageJsonCommonScripts | PackageJsonNpmLifeCycleScripts | PackageJsonPnpmLifeCycleScripts | (string & {});
|
|
1735
|
+
type PackageJsonScripts = { [P in PackageJsonScriptName]?: string };
|
|
1736
|
+
/**
|
|
1737
|
+
* A “person” is an object with a “name” field and optionally “url” and “email”. Or you can shorten that all into a single string, and npm will parse it for you.
|
|
1738
|
+
*/
|
|
1739
|
+
type PackageJsonPerson = string | {
|
|
1740
|
+
name: string;
|
|
1741
|
+
email?: string;
|
|
1742
|
+
url?: string;
|
|
1743
|
+
};
|
|
1744
|
+
type PackageJsonFunding = string | {
|
|
1745
|
+
url: string;
|
|
1746
|
+
type?: string;
|
|
1747
|
+
};
|
|
1748
|
+
type PackageJsonExportKey = "." | "import" | "require" | "types" | "node" | "browser" | "default" | (string & {});
|
|
1749
|
+
type PackageJsonExportsObject = { [P in PackageJsonExportKey]?: string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject> };
|
|
1750
|
+
type PackageJsonExports = string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>; //#endregion
|
|
1726
1751
|
//#region src/utils/package.d.ts
|
|
1727
1752
|
interface PackageJsonWithPath extends PackageJson {
|
|
1728
1753
|
packageJsonPath: string;
|
|
@@ -1733,8 +1758,8 @@ interface OutExtensionContext {
|
|
|
1733
1758
|
options: InputOptions;
|
|
1734
1759
|
format: NormalizedFormat;
|
|
1735
1760
|
/**
|
|
1736
|
-
|
|
1737
|
-
|
|
1761
|
+
* `"type"` field in project's `package.json`.
|
|
1762
|
+
*/
|
|
1738
1763
|
pkgType?: PackageType;
|
|
1739
1764
|
}
|
|
1740
1765
|
interface OutExtensionObject {
|
|
@@ -1756,225 +1781,225 @@ type ChunkAddon = ChunkAddonObject | ChunkAddonFunction | string; //#endregion
|
|
|
1756
1781
|
interface AttwOptions extends CheckPackageOptions {
|
|
1757
1782
|
module?: typeof import("@arethetypeswrong/core");
|
|
1758
1783
|
/**
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1784
|
+
* Profiles select a set of resolution modes to require/ignore. All are evaluated but failures outside
|
|
1785
|
+
* of those required are ignored.
|
|
1786
|
+
*
|
|
1787
|
+
* The available profiles are:
|
|
1788
|
+
* - `strict`: requires all resolutions
|
|
1789
|
+
* - `node16`: ignores node10 resolution failures
|
|
1790
|
+
* - `esm-only`: ignores CJS resolution failures
|
|
1791
|
+
*
|
|
1792
|
+
* @default 'strict'
|
|
1793
|
+
*/
|
|
1769
1794
|
profile?: "strict" | "node16" | "esm-only";
|
|
1770
1795
|
/**
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1796
|
+
* The level of the check.
|
|
1797
|
+
*
|
|
1798
|
+
* The available levels are:
|
|
1799
|
+
* - `error`: fails the build
|
|
1800
|
+
* - `warn`: warns the build
|
|
1801
|
+
*
|
|
1802
|
+
* @default 'warn'
|
|
1803
|
+
*/
|
|
1779
1804
|
level?: "error" | "warn";
|
|
1780
1805
|
/**
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
+
* List of problem types to ignore by rule name.
|
|
1807
|
+
*
|
|
1808
|
+
* The available values are:
|
|
1809
|
+
* - `no-resolution`
|
|
1810
|
+
* - `untyped-resolution`
|
|
1811
|
+
* - `false-cjs`
|
|
1812
|
+
* - `false-esm`
|
|
1813
|
+
* - `cjs-resolves-to-esm`
|
|
1814
|
+
* - `fallback-condition`
|
|
1815
|
+
* - `cjs-only-exports-default`
|
|
1816
|
+
* - `named-exports`
|
|
1817
|
+
* - `false-export-default`
|
|
1818
|
+
* - `missing-export-equals`
|
|
1819
|
+
* - `unexpected-module-syntax`
|
|
1820
|
+
* - `internal-resolution-error`
|
|
1821
|
+
*
|
|
1822
|
+
* @example
|
|
1823
|
+
* ```ts
|
|
1824
|
+
* ignoreRules: ['no-resolution', 'false-cjs']
|
|
1825
|
+
* ```
|
|
1826
|
+
*
|
|
1827
|
+
* @default []
|
|
1828
|
+
*
|
|
1829
|
+
* @uniqueItems
|
|
1830
|
+
*/
|
|
1806
1831
|
ignoreRules?: ("no-resolution" | "untyped-resolution" | "false-cjs" | "false-esm" | "cjs-resolves-to-esm" | "fallback-condition" | "cjs-only-exports-default" | "named-exports" | "false-export-default" | "missing-export-equals" | "unexpected-module-syntax" | "internal-resolution-error" | (string & {}))[];
|
|
1807
1832
|
} //#endregion
|
|
1808
1833
|
//#region src/features/pkg/exports.d.ts
|
|
1809
1834
|
interface ExportsOptions {
|
|
1810
1835
|
/**
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1836
|
+
* Generate exports that link to source code during development.
|
|
1837
|
+
* - `string`: add as a custom condition.
|
|
1838
|
+
* - `true`: all conditions point to source files, and add `dist` exports to `publishConfig`.
|
|
1839
|
+
*/
|
|
1815
1840
|
devExports?: boolean | string;
|
|
1816
1841
|
/**
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1842
|
+
* Generate `exports` for `package.json` file.
|
|
1843
|
+
*
|
|
1844
|
+
* @example
|
|
1845
|
+
* ```json
|
|
1846
|
+
* {
|
|
1847
|
+
* "exports": {
|
|
1848
|
+
* ".": {
|
|
1849
|
+
* "types": "./dist/index.d.mts",
|
|
1850
|
+
* "import": "./dist/index.mjs"
|
|
1851
|
+
* },
|
|
1852
|
+
* "./package.json": "./package.json"
|
|
1853
|
+
* }
|
|
1854
|
+
* }
|
|
1855
|
+
* ```
|
|
1856
|
+
*
|
|
1857
|
+
* @default true
|
|
1858
|
+
*/
|
|
1834
1859
|
packageJson?: boolean;
|
|
1835
1860
|
/**
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1861
|
+
* Generate `exports` for all files.
|
|
1862
|
+
*
|
|
1863
|
+
* @example
|
|
1864
|
+
* ```json
|
|
1865
|
+
* {
|
|
1866
|
+
* "exports": {
|
|
1867
|
+
* "./*": "./*"
|
|
1868
|
+
* }
|
|
1869
|
+
* }
|
|
1870
|
+
* ```
|
|
1871
|
+
*
|
|
1872
|
+
* @default false
|
|
1873
|
+
*/
|
|
1849
1874
|
all?: boolean;
|
|
1850
1875
|
/**
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1876
|
+
* Specifies file patterns (as glob patterns or regular expressions) to exclude from package exports.
|
|
1877
|
+
* Use this to prevent certain files from being included in the exported package, such as test files, binaries, or internal utilities.
|
|
1878
|
+
*
|
|
1879
|
+
* **Note:** Do not include file extensions, and paths should be relative to the dist directory.
|
|
1880
|
+
*
|
|
1881
|
+
* @example
|
|
1882
|
+
* ```ts
|
|
1883
|
+
* exclude: ['cli', '**\/*.test', /internal/]
|
|
1884
|
+
* ```
|
|
1885
|
+
*/
|
|
1861
1886
|
exclude?: (RegExp | string)[];
|
|
1862
1887
|
/**
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1888
|
+
* Generate legacy fields (`main` and `module`) for older Node.js and bundlers
|
|
1889
|
+
* that do not support package `exports` field.
|
|
1890
|
+
*
|
|
1891
|
+
* Defaults to false, if only ESM builds are included, true otherwise.
|
|
1892
|
+
*
|
|
1893
|
+
* @see {@link https://github.com/publint/publint/issues/24}
|
|
1894
|
+
*/
|
|
1870
1895
|
legacy?: boolean;
|
|
1871
1896
|
/**
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1897
|
+
* Specifies custom exports to add to the package exports in addition to the ones generated by tsdown.
|
|
1898
|
+
* Use this to add additional exports in the exported package, such as workers or assets.
|
|
1899
|
+
*
|
|
1900
|
+
* @example
|
|
1901
|
+
* ```ts
|
|
1902
|
+
* customExports(exports) {
|
|
1903
|
+
* exports['./worker.js'] = './dist/worker.js';
|
|
1904
|
+
* return exports;
|
|
1905
|
+
* }
|
|
1906
|
+
* ```
|
|
1907
|
+
*
|
|
1908
|
+
* @example
|
|
1909
|
+
* ```jsonc
|
|
1910
|
+
* {
|
|
1911
|
+
* "customExports": {
|
|
1912
|
+
* "./worker.js": {
|
|
1913
|
+
* "types": "./dist/worker.d.ts",
|
|
1914
|
+
* "default": "./dist/worker.js"
|
|
1915
|
+
* }
|
|
1916
|
+
* }
|
|
1917
|
+
* }
|
|
1918
|
+
* ```
|
|
1919
|
+
*/
|
|
1895
1920
|
customExports?: Record<string, any> | ((exports: Record<string, any>, context: {
|
|
1896
1921
|
pkg: PackageJson;
|
|
1897
1922
|
chunks: ChunksByFormat;
|
|
1898
1923
|
isPublish: boolean;
|
|
1899
1924
|
}) => Awaitable<Record<string, any>>);
|
|
1900
1925
|
/**
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1926
|
+
* Generate `inlinedDependencies` field in `package.json`.
|
|
1927
|
+
* Lists dependencies that are physically inlined into the bundle with their exact versions.
|
|
1928
|
+
*
|
|
1929
|
+
* @default true
|
|
1930
|
+
* @see {@link https://github.com/e18e/ecosystem-issues/issues/237}
|
|
1931
|
+
*/
|
|
1907
1932
|
inlinedDependencies?: boolean;
|
|
1908
1933
|
/**
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1934
|
+
* Add file extensions to subpath export keys.
|
|
1935
|
+
*
|
|
1936
|
+
* When enabled, all subpath exports (except the root `"."`) will include
|
|
1937
|
+
* a `.js` extension in the key (e.g., `"./utils.js"` instead of `"./utils"`).
|
|
1938
|
+
*
|
|
1939
|
+
* This follows the Node.js recommendation for subpath exports:
|
|
1940
|
+
* @see {@link https://nodejs.org/api/packages.html#extensions-in-subpaths}
|
|
1941
|
+
*
|
|
1942
|
+
* @default false
|
|
1943
|
+
*/
|
|
1919
1944
|
extensions?: boolean;
|
|
1920
1945
|
/**
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1946
|
+
* Generate the `bin` field in `package.json` for CLI executables.
|
|
1947
|
+
*
|
|
1948
|
+
* Behavior depends on the value:
|
|
1949
|
+
*
|
|
1950
|
+
* - *Unset* (default): Soft auto-detect. Scans entry chunks for shebangs
|
|
1951
|
+
* (e.g. `#!/usr/bin/env node`). If exactly one is found, it is used as
|
|
1952
|
+
* the bin entry. If multiple are found, a warning is shown and no `bin`
|
|
1953
|
+
* field is written. If none are found, nothing happens silently.
|
|
1954
|
+
* - `true`: Strict auto-detect. Same as the default, but throws if
|
|
1955
|
+
* multiple shebang entries are found, and warns if none are found.
|
|
1956
|
+
* Use this when your package is known to ship a CLI and you want to
|
|
1957
|
+
* fail fast on misconfiguration.
|
|
1958
|
+
* - `false`: Disable bin generation entirely, even if shebangs are
|
|
1959
|
+
* present.
|
|
1960
|
+
* - `string`: Use the given source file path (relative to `cwd`) as the
|
|
1961
|
+
* CLI entry. The command name is derived from the package name without
|
|
1962
|
+
* its scope. Warns if the source file does not contain a shebang.
|
|
1963
|
+
* - `Record<string, string>`: Explicitly map command names to source file
|
|
1964
|
+
* paths (relative to `cwd`). Warns for each source file that does not
|
|
1965
|
+
* contain a shebang.
|
|
1966
|
+
*
|
|
1967
|
+
* When {@link ExportsOptions.devExports} is enabled, the `bin` field in
|
|
1968
|
+
* `package.json` points to source files during local development, while
|
|
1969
|
+
* `publishConfig.bin` points to built output paths for publishing.
|
|
1970
|
+
*
|
|
1971
|
+
* @example
|
|
1972
|
+
* <caption>Auto-detect a CLI entry from a shebang</caption>
|
|
1973
|
+
*
|
|
1974
|
+
* ```ts
|
|
1975
|
+
* {
|
|
1976
|
+
* bin: true
|
|
1977
|
+
* }
|
|
1978
|
+
* ```
|
|
1979
|
+
*
|
|
1980
|
+
* @example
|
|
1981
|
+
* <caption>Single CLI command with an explicit source entry</caption>
|
|
1982
|
+
*
|
|
1983
|
+
* ```ts
|
|
1984
|
+
* {
|
|
1985
|
+
* bin: './src/cli.ts'
|
|
1986
|
+
* }
|
|
1987
|
+
* ```
|
|
1988
|
+
*
|
|
1989
|
+
* @example
|
|
1990
|
+
* <caption>Multiple named CLI commands</caption>
|
|
1991
|
+
*
|
|
1992
|
+
* ```ts
|
|
1993
|
+
* {
|
|
1994
|
+
* bin: {
|
|
1995
|
+
* tool: './src/cli.ts',
|
|
1996
|
+
* serve: './src/cli-extra.ts',
|
|
1997
|
+
* },
|
|
1998
|
+
* }
|
|
1999
|
+
* ```
|
|
2000
|
+
*
|
|
2001
|
+
* @see {@link https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin | npm documentation for the `bin` field}
|
|
2002
|
+
*/
|
|
1978
2003
|
bin?: boolean | string | Record<string, string>;
|
|
1979
2004
|
} //#endregion
|
|
1980
2005
|
//#region src/features/pkg/publint.d.ts
|
|
@@ -1983,624 +2008,632 @@ interface PublintOptions extends Omit<Options, "pack" | "pkgDir"> {
|
|
|
1983
2008
|
} //#endregion
|
|
1984
2009
|
//#region src/features/plugin.d.ts
|
|
1985
2010
|
/**
|
|
1986
|
-
* A tsdown-aware plugin. Extends Rolldown's {@linkcode Plugin} with
|
|
1987
|
-
* tsdown-specific lifecycle hooks.
|
|
1988
|
-
*
|
|
1989
|
-
* Plugins that only use Rolldown's own lifecycle continue to work unchanged;
|
|
1990
|
-
* tsdown detects these optional methods via runtime duck-typing.
|
|
1991
|
-
*/
|
|
2011
|
+
* A tsdown-aware plugin. Extends Rolldown's {@linkcode Plugin} with
|
|
2012
|
+
* tsdown-specific lifecycle hooks.
|
|
2013
|
+
*
|
|
2014
|
+
* Plugins that only use Rolldown's own lifecycle continue to work unchanged;
|
|
2015
|
+
* tsdown detects these optional methods via runtime duck-typing.
|
|
2016
|
+
*/
|
|
1992
2017
|
interface TsdownPlugin<A = any> extends Plugin<A> {
|
|
1993
2018
|
/**
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2019
|
+
* Modify tsdown's user config before it is resolved. Analogous to Vite's
|
|
2020
|
+
* [`config`](https://vite.dev/guide/api-plugin.html#config) hook.
|
|
2021
|
+
*
|
|
2022
|
+
* The hook may mutate {@linkcode config} in place, or return a partial
|
|
2023
|
+
* {@linkcode UserConfig} that will be deep-merged into the current config.
|
|
2024
|
+
* Array fields are replaced (not concatenated) during merging — to append
|
|
2025
|
+
* plugins, mutate {@linkcode UserConfig.plugins | config.plugins} in place.
|
|
2026
|
+
*
|
|
2027
|
+
* The second argument is the original {@linkcode InlineConfig} passed to
|
|
2028
|
+
* {@linkcode build | build()} (typically the CLI flags), useful for
|
|
2029
|
+
* distinguishing values that came from the command line vs. the config file.
|
|
2030
|
+
*
|
|
2031
|
+
* Plugins injected via {@linkcode UserConfig.fromVite | fromVite} do not
|
|
2032
|
+
* receive this hook, because they are loaded after the
|
|
2033
|
+
* {@linkcode tsdownConfig} phase. Likewise, new plugins added by another
|
|
2034
|
+
* plugin's {@linkcode tsdownConfig} do not themselves receive this hook
|
|
2035
|
+
* (plugins are snapshotted before dispatch).
|
|
2036
|
+
*/
|
|
2012
2037
|
tsdownConfig?: (config: UserConfig, inlineConfig: InlineConfig) => Awaitable<UserConfig | void | null>;
|
|
2013
2038
|
/**
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2039
|
+
* Called after tsdown has fully resolved the user config. Analogous to
|
|
2040
|
+
* Vite's [`configResolved`](https://vite.dev/guide/api-plugin.html#configresolved)
|
|
2041
|
+
* hook.
|
|
2042
|
+
*
|
|
2043
|
+
* This hook fires once per produced {@linkcode ResolvedConfig} — i.e. once
|
|
2044
|
+
* per output format when {@linkcode UserConfig.format | format} is an array.
|
|
2045
|
+
* Typical usage is to stash the resolved config for later use in
|
|
2046
|
+
* Rolldown hooks. Mutations made to {@linkcode resolvedConfig} here are
|
|
2047
|
+
* not supported.
|
|
2048
|
+
*/
|
|
2024
2049
|
tsdownConfigResolved?: (resolvedConfig: ResolvedConfig) => Awaitable<void>;
|
|
2025
2050
|
}
|
|
2026
2051
|
/**
|
|
2027
|
-
* A tsdown plugin slot — accepts tsdown plugins, any Rolldown plugin form,
|
|
2028
|
-
* `null`/`undefined`/`false`, {@linkcode Promise | promises}, and
|
|
2029
|
-
* nested arrays. Mirrors Rolldown's {@linkcode RolldownPluginOption} but with
|
|
2030
|
-
* {@linkcode TsdownPlugin} as the atom so that tsdown-specific hooks are
|
|
2031
|
-
* type-checked.
|
|
2032
|
-
*/
|
|
2052
|
+
* A tsdown plugin slot — accepts tsdown plugins, any Rolldown plugin form,
|
|
2053
|
+
* `null`/`undefined`/`false`, {@linkcode Promise | promises}, and
|
|
2054
|
+
* nested arrays. Mirrors Rolldown's {@linkcode RolldownPluginOption} but with
|
|
2055
|
+
* {@linkcode TsdownPlugin} as the atom so that tsdown-specific hooks are
|
|
2056
|
+
* type-checked.
|
|
2057
|
+
*/
|
|
2033
2058
|
type TsdownPluginOption<A = any> = Awaitable<TsdownPlugin<A> | RolldownPlugin<A> | {
|
|
2034
2059
|
name: string;
|
|
2035
2060
|
} | undefined | null | void | false | TsdownPluginOption<A>[]>; //#endregion
|
|
2036
2061
|
//#region src/features/report.d.ts
|
|
2037
2062
|
interface ReportOptions {
|
|
2038
2063
|
/**
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2064
|
+
* Enable/disable gzip-compressed size reporting.
|
|
2065
|
+
* Compressing large output files can be slow, so disabling this may increase build performance for large projects.
|
|
2066
|
+
*
|
|
2067
|
+
* @default true
|
|
2068
|
+
*/
|
|
2044
2069
|
gzip?: boolean;
|
|
2045
2070
|
/**
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2071
|
+
* Enable/disable brotli-compressed size reporting.
|
|
2072
|
+
* Compressing large output files can be slow, so disabling this may increase build performance for large projects.
|
|
2073
|
+
*
|
|
2074
|
+
* @default false
|
|
2075
|
+
*/
|
|
2051
2076
|
brotli?: boolean;
|
|
2052
2077
|
/**
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2078
|
+
* Skip reporting compressed size for files larger than this size.
|
|
2079
|
+
* @default 1_000_000 // 1 MB
|
|
2080
|
+
*/
|
|
2056
2081
|
maxCompressSize?: number;
|
|
2057
2082
|
}
|
|
2058
2083
|
//#endregion
|
|
2059
2084
|
//#region src/config/types.d.ts
|
|
2060
2085
|
interface DtsOptions extends Options$1 {
|
|
2061
2086
|
/**
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2087
|
+
* When building dual ESM+CJS formats, generate a `.d.cts` re-export stub
|
|
2088
|
+
* instead of running a full second TypeScript compilation pass.
|
|
2089
|
+
*
|
|
2090
|
+
* The stub re-exports everything from the corresponding `.d.mts` file,
|
|
2091
|
+
* ensuring CJS and ESM consumers share the same type declarations. This
|
|
2092
|
+
* eliminates the TypeScript "dual module hazard" where separate `.d.cts`
|
|
2093
|
+
* and `.d.mts` declarations cause `TS2352` ("neither type sufficiently
|
|
2094
|
+
* overlaps") errors when casting between types derived from the same class.
|
|
2095
|
+
*
|
|
2096
|
+
* Only applies when building both `esm` and `cjs` formats simultaneously.
|
|
2097
|
+
*
|
|
2098
|
+
* @remarks
|
|
2099
|
+
* The generated `.d.cts` stub uses a relative path to re-export from the
|
|
2100
|
+
* corresponding `.d.mts` file, so both formats must be emitted to the
|
|
2101
|
+
* **same** `outDir`. Splitting CJS and ESM outputs into separate
|
|
2102
|
+
* format-specific directories (e.g. `dist/cjs` and `dist/esm`) is not
|
|
2103
|
+
* supported with this option, because the re-export path would be invalid.
|
|
2104
|
+
*
|
|
2105
|
+
* @default false
|
|
2106
|
+
*/
|
|
2082
2107
|
cjsReexport?: boolean;
|
|
2083
2108
|
}
|
|
2084
2109
|
type Sourcemap = boolean | "inline" | "hidden";
|
|
2085
2110
|
type Format = ModuleFormat;
|
|
2086
2111
|
type NormalizedFormat = InternalModuleFormat;
|
|
2087
2112
|
/**
|
|
2088
|
-
* Extended input option that supports glob negation patterns.
|
|
2089
|
-
*
|
|
2090
|
-
* When using object form, values can be:
|
|
2091
|
-
* - A single glob pattern string
|
|
2092
|
-
* - An array of glob patterns, including negation patterns (prefixed with `!`)
|
|
2093
|
-
*
|
|
2094
|
-
* @example
|
|
2095
|
-
* ```ts
|
|
2096
|
-
* entry: {
|
|
2097
|
-
* // Single pattern
|
|
2098
|
-
* "utils/*": "./src/utils/*.ts",
|
|
2099
|
-
* // Array with negation pattern to exclude files
|
|
2100
|
-
* "hooks/*": ["./src/hooks/*.ts", "!./src/hooks/index.ts"],
|
|
2101
|
-
* }
|
|
2102
|
-
* ```
|
|
2103
|
-
*/
|
|
2113
|
+
* Extended input option that supports glob negation patterns.
|
|
2114
|
+
*
|
|
2115
|
+
* When using object form, values can be:
|
|
2116
|
+
* - A single glob pattern string
|
|
2117
|
+
* - An array of glob patterns, including negation patterns (prefixed with `!`)
|
|
2118
|
+
*
|
|
2119
|
+
* @example
|
|
2120
|
+
* ```ts
|
|
2121
|
+
* entry: {
|
|
2122
|
+
* // Single pattern
|
|
2123
|
+
* "utils/*": "./src/utils/*.ts",
|
|
2124
|
+
* // Array with negation pattern to exclude files
|
|
2125
|
+
* "hooks/*": ["./src/hooks/*.ts", "!./src/hooks/index.ts"],
|
|
2126
|
+
* }
|
|
2127
|
+
* ```
|
|
2128
|
+
*/
|
|
2104
2129
|
type TsdownInputOption = Arrayable<string | Record<string, Arrayable<string>>>;
|
|
2105
2130
|
interface Workspace {
|
|
2106
2131
|
/**
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2132
|
+
* Workspace directories. Glob patterns are supported.
|
|
2133
|
+
* - `auto`: Automatically detect `package.json` files in the workspace.
|
|
2134
|
+
* @default 'auto'
|
|
2135
|
+
*/
|
|
2111
2136
|
include?: "auto" | (string & {}) | string[];
|
|
2112
2137
|
/**
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2138
|
+
* Exclude directories from workspace.
|
|
2139
|
+
* Defaults to all `node_modules`, `dist`, `test`, `tests`, `temp`, and `tmp` directories.
|
|
2140
|
+
*
|
|
2141
|
+
* @default ['**\/node_modules/**', '**\/dist/**', '**\/test?(s)/**', '**\/t?(e)mp/**']
|
|
2142
|
+
*/
|
|
2118
2143
|
exclude?: Arrayable<string>;
|
|
2119
2144
|
/**
|
|
2120
|
-
|
|
2121
|
-
|
|
2145
|
+
* Path to the workspace configuration file.
|
|
2146
|
+
*/
|
|
2122
2147
|
config?: boolean | string;
|
|
2123
2148
|
}
|
|
2124
2149
|
type CIOption = "ci-only" | "local-only";
|
|
2125
2150
|
type WithEnabled<T> = boolean | undefined | CIOption | (T & {
|
|
2126
2151
|
/**
|
|
2127
|
-
|
|
2128
|
-
|
|
2152
|
+
* @default true
|
|
2153
|
+
*/
|
|
2129
2154
|
enabled?: boolean | CIOption;
|
|
2130
2155
|
});
|
|
2131
2156
|
/**
|
|
2132
|
-
* Options for tsdown.
|
|
2133
|
-
*/
|
|
2157
|
+
* Options for tsdown.
|
|
2158
|
+
*/
|
|
2134
2159
|
interface UserConfig {
|
|
2135
2160
|
/**
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2161
|
+
* Defaults to `'src/index.ts'` if it exists.
|
|
2162
|
+
*
|
|
2163
|
+
* Supports glob patterns with negation to exclude files:
|
|
2164
|
+
* @example
|
|
2165
|
+
* ```ts
|
|
2166
|
+
* entry: {
|
|
2167
|
+
* "hooks/*": ["./src/hooks/*.ts", "!./src/hooks/index.ts"],
|
|
2168
|
+
* }
|
|
2169
|
+
* ```
|
|
2170
|
+
*
|
|
2171
|
+
* @default { index: 'src/index.ts'}
|
|
2172
|
+
*/
|
|
2148
2173
|
entry?: TsdownInputOption;
|
|
2149
2174
|
/**
|
|
2150
|
-
|
|
2151
|
-
|
|
2175
|
+
* Dependency handling options.
|
|
2176
|
+
*/
|
|
2152
2177
|
deps?: DepsConfig;
|
|
2153
2178
|
/**
|
|
2154
|
-
|
|
2155
|
-
|
|
2179
|
+
* @deprecated Use {@linkcode DepsConfig.neverBundle | deps.neverBundle} instead.
|
|
2180
|
+
*/
|
|
2156
2181
|
external?: ExternalOption;
|
|
2157
2182
|
/**
|
|
2158
|
-
|
|
2159
|
-
|
|
2183
|
+
* @deprecated Use {@linkcode DepsConfig.alwaysBundle | deps.alwaysBundle} instead.
|
|
2184
|
+
*/
|
|
2160
2185
|
noExternal?: Arrayable<string | RegExp> | NoExternalFn;
|
|
2161
2186
|
/**
|
|
2162
|
-
|
|
2163
|
-
|
|
2187
|
+
* @deprecated Use {@linkcode DepsConfig.onlyBundle | deps.onlyBundle} instead.
|
|
2188
|
+
*/
|
|
2164
2189
|
inlineOnly?: Arrayable<string | RegExp> | false;
|
|
2165
2190
|
/**
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2191
|
+
* @deprecated Use {@linkcode DepsConfig.skipNodeModulesBundle | deps.skipNodeModulesBundle} instead.
|
|
2192
|
+
* @default false
|
|
2193
|
+
*/
|
|
2169
2194
|
skipNodeModulesBundle?: boolean;
|
|
2170
2195
|
alias?: Record<string, string>;
|
|
2171
2196
|
/**
|
|
2172
|
-
|
|
2173
|
-
|
|
2197
|
+
* @default true
|
|
2198
|
+
*/
|
|
2174
2199
|
tsconfig?: string | boolean;
|
|
2175
2200
|
/**
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2201
|
+
* Specifies the target runtime platform for the build.
|
|
2202
|
+
*
|
|
2203
|
+
* - `node`: Node.js and compatible runtimes (e.g., Deno, Bun).
|
|
2204
|
+
* For CJS format, this is always set to `node` and cannot be changed.
|
|
2205
|
+
* - `neutral`: A platform-agnostic target with no specific runtime assumptions.
|
|
2206
|
+
* - `browser`: Web browsers.
|
|
2207
|
+
*
|
|
2208
|
+
* @default 'node'
|
|
2209
|
+
* @see https://tsdown.dev/options/platform
|
|
2210
|
+
*/
|
|
2186
2211
|
platform?: "node" | "neutral" | "browser";
|
|
2187
2212
|
/**
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2213
|
+
* Specifies the compilation target environment(s).
|
|
2214
|
+
*
|
|
2215
|
+
* Determines the JavaScript version or runtime(s) for which the code should be compiled.
|
|
2216
|
+
* If not set, defaults to the value of `engines.node` in your project's `package.json`.
|
|
2217
|
+
* If no `engines.node` field exists, no syntax transformations are applied.
|
|
2218
|
+
*
|
|
2219
|
+
* Accepts a single target (e.g., `'es2020'`, `'node18'`, `'baseline-widely-available'`), an array of targets, or `false` to disable all transformations.
|
|
2220
|
+
*
|
|
2221
|
+
* @see {@link https://tsdown.dev/options/target#supported-targets} for a list of valid targets and more details.
|
|
2222
|
+
*
|
|
2223
|
+
* @example
|
|
2224
|
+
* ```jsonc
|
|
2225
|
+
* // Target a single environment
|
|
2226
|
+
* { "target": "node18" }
|
|
2227
|
+
* ```
|
|
2228
|
+
*
|
|
2229
|
+
* @example
|
|
2230
|
+
* ```jsonc
|
|
2231
|
+
* // Target multiple environments
|
|
2232
|
+
* { "target": ["node18", "es2020"] }
|
|
2233
|
+
* ```
|
|
2234
|
+
*
|
|
2235
|
+
* @example
|
|
2236
|
+
* ```jsonc
|
|
2237
|
+
* // Disable all syntax transformations
|
|
2238
|
+
* { "target": false }
|
|
2239
|
+
* ```
|
|
2240
|
+
*/
|
|
2216
2241
|
target?: string | string[] | false;
|
|
2217
2242
|
/**
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2243
|
+
* Compile-time env variables, which can be accessed via `import.meta.env` or `process.env`.
|
|
2244
|
+
* @example
|
|
2245
|
+
* ```json
|
|
2246
|
+
* {
|
|
2247
|
+
* "DEBUG": true,
|
|
2248
|
+
* "NODE_ENV": "production"
|
|
2249
|
+
* }
|
|
2250
|
+
* ```
|
|
2251
|
+
*
|
|
2252
|
+
* @default {}
|
|
2253
|
+
*/
|
|
2229
2254
|
env?: Record<string, any>;
|
|
2230
2255
|
/**
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2256
|
+
* Path to env file providing compile-time env variables.
|
|
2257
|
+
* @example
|
|
2258
|
+
* `.env`, `.env.production`, etc.
|
|
2259
|
+
*/
|
|
2235
2260
|
envFile?: string;
|
|
2236
2261
|
/**
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2262
|
+
* When loading env variables from `envFile`, only include variables with these prefixes.
|
|
2263
|
+
* @default 'TSDOWN_'
|
|
2264
|
+
*/
|
|
2240
2265
|
envPrefix?: string | string[];
|
|
2241
2266
|
define?: Record<string, string>;
|
|
2242
2267
|
/**
|
|
2243
|
-
|
|
2244
|
-
|
|
2268
|
+
* @default false
|
|
2269
|
+
*/
|
|
2245
2270
|
shims?: boolean;
|
|
2246
2271
|
/**
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2272
|
+
* Configure tree shaking options.
|
|
2273
|
+
* @see {@link https://rolldown.rs/options/treeshake} for more details.
|
|
2274
|
+
* @default true
|
|
2275
|
+
*/
|
|
2251
2276
|
treeshake?: boolean | TreeshakingOptions;
|
|
2252
2277
|
/**
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2278
|
+
* Sets how input files are processed.
|
|
2279
|
+
* For example, use 'js' to treat files as JavaScript or 'base64' for images.
|
|
2280
|
+
* Lets you import or require files like images or fonts.
|
|
2281
|
+
* @example
|
|
2282
|
+
* ```json
|
|
2283
|
+
* { ".jpg": "asset", ".png": "base64" }
|
|
2284
|
+
* ```
|
|
2285
|
+
*/
|
|
2261
2286
|
loader?: ModuleTypes;
|
|
2262
2287
|
/**
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2288
|
+
* Remove the `node:` prefix from built-in Node.js module imports.
|
|
2289
|
+
* When enabled, rewrites import sources like `node:fs` to `fs`.
|
|
2290
|
+
*
|
|
2291
|
+
* @default false
|
|
2292
|
+
* @deprecated Use {@linkcode nodeProtocol | nodeProtocol: 'strip'} instead.
|
|
2293
|
+
*
|
|
2294
|
+
* @example
|
|
2295
|
+
* <caption>`removeNodeProtocol: true` — remove the `node:` prefix</caption>
|
|
2296
|
+
*
|
|
2297
|
+
* ```ts
|
|
2298
|
+
* // Input
|
|
2299
|
+
* import 'node:fs'
|
|
2300
|
+
*
|
|
2301
|
+
* // Output
|
|
2302
|
+
* import 'fs'
|
|
2303
|
+
* ```
|
|
2304
|
+
*/
|
|
2280
2305
|
removeNodeProtocol?: boolean;
|
|
2281
2306
|
/**
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2307
|
+
* Control whether built-in Node.js module imports use the `node:` protocol.
|
|
2308
|
+
*
|
|
2309
|
+
* - `true`: Add the `node:` prefix to built-in module imports.
|
|
2310
|
+
* - `'strip'`: Remove the `node:` prefix from built-in module imports.
|
|
2311
|
+
* - `false`: Do not transform built-in module imports.
|
|
2312
|
+
*
|
|
2313
|
+
* @default false
|
|
2314
|
+
*
|
|
2315
|
+
* @example
|
|
2316
|
+
* <caption>`nodeProtocol: true` — add the `node:` prefix</caption>
|
|
2317
|
+
*
|
|
2318
|
+
* ```ts
|
|
2319
|
+
* // Input
|
|
2320
|
+
* import 'fs'
|
|
2321
|
+
*
|
|
2322
|
+
* // Output
|
|
2323
|
+
* import 'node:fs'
|
|
2324
|
+
* ```
|
|
2325
|
+
*
|
|
2326
|
+
* @example
|
|
2327
|
+
* <caption>`nodeProtocol: 'strip'` — remove the `node:` prefix</caption>
|
|
2328
|
+
*
|
|
2329
|
+
* ```ts
|
|
2330
|
+
* // Input
|
|
2331
|
+
* import 'node:fs'
|
|
2332
|
+
*
|
|
2333
|
+
* // Output
|
|
2334
|
+
* import 'fs'
|
|
2335
|
+
* ```
|
|
2336
|
+
*
|
|
2337
|
+
* @example
|
|
2338
|
+
* <caption>`nodeProtocol: false` — do not transform imports</caption>
|
|
2339
|
+
*
|
|
2340
|
+
* ```ts
|
|
2341
|
+
* // Input
|
|
2342
|
+
* import 'node:fs'
|
|
2343
|
+
*
|
|
2344
|
+
* // Output
|
|
2345
|
+
* import 'node:fs'
|
|
2346
|
+
* ```
|
|
2347
|
+
*/
|
|
2323
2348
|
nodeProtocol?: "strip" | boolean;
|
|
2324
2349
|
/**
|
|
2325
|
-
|
|
2326
|
-
|
|
2350
|
+
* Controls which warnings are emitted during the build process. Each option can be set to `true` (emit warning) or `false` (suppress warning).
|
|
2351
|
+
*/
|
|
2327
2352
|
checks?: ChecksOptions & {
|
|
2328
2353
|
/**
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2354
|
+
* If the config includes the `cjs` format and
|
|
2355
|
+
* one of its target >= node 20.19.0 / 22.12.0,
|
|
2356
|
+
* warn the user about the deprecation of CommonJS.
|
|
2357
|
+
*
|
|
2358
|
+
* @default true
|
|
2359
|
+
*/
|
|
2335
2360
|
legacyCjs?: boolean;
|
|
2336
2361
|
};
|
|
2337
2362
|
plugins?: TsdownPluginOption;
|
|
2338
2363
|
/**
|
|
2339
|
-
|
|
2340
|
-
|
|
2364
|
+
* Use with caution; ensure you understand the implications.
|
|
2365
|
+
*/
|
|
2341
2366
|
inputOptions?: InputOptions | ((options: InputOptions, format: NormalizedFormat, context: {
|
|
2342
2367
|
cjsDts: boolean;
|
|
2343
2368
|
}) => Awaitable<InputOptions | void | null>);
|
|
2344
2369
|
/**
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2370
|
+
* Output format(s). Available formats are
|
|
2371
|
+
* - `esm`: ESM
|
|
2372
|
+
* - `cjs`: CommonJS
|
|
2373
|
+
* - `iife`: IIFE
|
|
2374
|
+
* - `umd`: UMD
|
|
2375
|
+
*
|
|
2376
|
+
* @default 'esm'
|
|
2377
|
+
*/
|
|
2353
2378
|
format?: Format | Format[] | Partial<Record<Format, Partial<ResolvedConfig>>>;
|
|
2354
2379
|
globalName?: string;
|
|
2355
2380
|
/**
|
|
2356
|
-
|
|
2357
|
-
|
|
2381
|
+
* @default 'dist'
|
|
2382
|
+
*/
|
|
2358
2383
|
outDir?: string;
|
|
2359
2384
|
/**
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2385
|
+
* Whether to write the files to disk.
|
|
2386
|
+
* This option is incompatible with watch mode.
|
|
2387
|
+
* @default true
|
|
2388
|
+
*/
|
|
2364
2389
|
write?: boolean;
|
|
2365
2390
|
/**
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2391
|
+
* Whether to generate source map files.
|
|
2392
|
+
*
|
|
2393
|
+
* Note that this option will always be `true` if you have
|
|
2394
|
+
* {@link https://www.typescriptlang.org/tsconfig/#declarationMap | `declarationMap`}
|
|
2395
|
+
* option enabled in your `tsconfig.json`.
|
|
2396
|
+
*
|
|
2397
|
+
* @default false
|
|
2398
|
+
*/
|
|
2374
2399
|
sourcemap?: Sourcemap;
|
|
2375
2400
|
/**
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2401
|
+
* Clean directories before build.
|
|
2402
|
+
*
|
|
2403
|
+
* Default to output directory.
|
|
2404
|
+
* @default true
|
|
2405
|
+
*/
|
|
2381
2406
|
clean?: boolean | string[];
|
|
2382
2407
|
/**
|
|
2383
|
-
|
|
2384
|
-
|
|
2408
|
+
* @default false
|
|
2409
|
+
*/
|
|
2385
2410
|
minify?: boolean | "dce-only" | MinifyOptions;
|
|
2386
2411
|
footer?: ChunkAddon;
|
|
2387
2412
|
banner?: ChunkAddon;
|
|
2388
2413
|
/**
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2414
|
+
* Determines whether `unbundle` is enabled.
|
|
2415
|
+
* When set to `true`, the output files will mirror the input file structure.
|
|
2416
|
+
* @default false
|
|
2417
|
+
*/
|
|
2393
2418
|
unbundle?: boolean;
|
|
2394
2419
|
/**
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2420
|
+
* Specifies the root directory of input files, similar to TypeScript's `rootDir`.
|
|
2421
|
+
* This determines the output directory structure.
|
|
2422
|
+
*
|
|
2423
|
+
* By default, the root is computed as the common base directory of all entry files.
|
|
2424
|
+
*
|
|
2425
|
+
* @see https://www.typescriptlang.org/tsconfig/#rootDir
|
|
2426
|
+
*/
|
|
2402
2427
|
root?: string;
|
|
2403
2428
|
/**
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2429
|
+
* @deprecated Use {@linkcode unbundle} instead.
|
|
2430
|
+
* @default true
|
|
2431
|
+
*/
|
|
2407
2432
|
bundle?: boolean;
|
|
2408
2433
|
/**
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2434
|
+
* Use a fixed extension for output files.
|
|
2435
|
+
* The extension will always be `.cjs` or `.mjs`.
|
|
2436
|
+
* Otherwise, it will depend on the package type.
|
|
2437
|
+
*
|
|
2438
|
+
* Defaults to `true` if {@linkcode platform} is set to `node`,
|
|
2439
|
+
* `false` otherwise.
|
|
2440
|
+
*
|
|
2441
|
+
* @default platform === 'node'
|
|
2442
|
+
*/
|
|
2418
2443
|
fixedExtension?: boolean;
|
|
2419
2444
|
/**
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2445
|
+
* Custom extensions for output files.
|
|
2446
|
+
* {@linkcode fixedExtension} will be overridden by this option.
|
|
2447
|
+
*/
|
|
2423
2448
|
outExtensions?: OutExtensionFactory;
|
|
2424
2449
|
/**
|
|
2425
|
-
|
|
2426
|
-
|
|
2450
|
+
* @deprecated Use {@linkcode outExtensions} instead.
|
|
2451
|
+
*/
|
|
2427
2452
|
outExtension?: OutExtensionFactory;
|
|
2428
2453
|
/**
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2454
|
+
* If enabled, appends hash to chunk filenames.
|
|
2455
|
+
* @default true
|
|
2456
|
+
*/
|
|
2432
2457
|
hash?: boolean;
|
|
2433
2458
|
/**
|
|
2434
|
-
|
|
2435
|
-
|
|
2459
|
+
* @default true
|
|
2460
|
+
*/
|
|
2436
2461
|
cjsDefault?: boolean;
|
|
2437
2462
|
/**
|
|
2438
|
-
|
|
2439
|
-
|
|
2463
|
+
* Use with caution; ensure you understand the implications.
|
|
2464
|
+
*/
|
|
2440
2465
|
outputOptions?: OutputOptions | ((options: OutputOptions, format: NormalizedFormat, context: {
|
|
2441
2466
|
cjsDts: boolean;
|
|
2442
2467
|
}) => Awaitable<OutputOptions | void | null>);
|
|
2443
2468
|
/**
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2469
|
+
* The working directory of the config file.
|
|
2470
|
+
* - Defaults to {@linkcode process.cwd | process.cwd()} for root config.
|
|
2471
|
+
* - Defaults to the package directory for {@linkcode workspace} config.
|
|
2472
|
+
*
|
|
2473
|
+
* @default process.cwd()
|
|
2474
|
+
*/
|
|
2450
2475
|
cwd?: string;
|
|
2451
2476
|
/**
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2477
|
+
* The name to show in CLI output. This is useful for monorepos or workspaces.
|
|
2478
|
+
* When using workspace mode, this option defaults to the package name from package.json.
|
|
2479
|
+
* In non-workspace mode, this option must be set explicitly for the name to show in the CLI output.
|
|
2480
|
+
*/
|
|
2456
2481
|
name?: string;
|
|
2457
2482
|
/**
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2483
|
+
* Log level.
|
|
2484
|
+
* @default 'info'
|
|
2485
|
+
*/
|
|
2461
2486
|
logLevel?: LogLevel;
|
|
2462
2487
|
/**
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2488
|
+
* If true, fails the build on warnings.
|
|
2489
|
+
* @default false
|
|
2490
|
+
*/
|
|
2466
2491
|
failOnWarn?: boolean | CIOption;
|
|
2467
2492
|
/**
|
|
2468
|
-
|
|
2469
|
-
|
|
2493
|
+
* Suppress warnings whose message matches the given pattern(s).
|
|
2494
|
+
*
|
|
2495
|
+
* Accepts a string (substring match), a `RegExp`, an array of either, or a
|
|
2496
|
+
* predicate function. Matched warnings are dropped before `failOnWarn` is
|
|
2497
|
+
* applied, so they won't fail the build.
|
|
2498
|
+
*/
|
|
2499
|
+
suppressWarnings?: Arrayable<RegExp | string> | ((msg: string) => boolean);
|
|
2500
|
+
/**
|
|
2501
|
+
* Custom logger.
|
|
2502
|
+
*/
|
|
2470
2503
|
customLogger?: Logger;
|
|
2471
2504
|
/**
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2505
|
+
* Reuse config from Vite or Vitest (experimental)
|
|
2506
|
+
* @default false
|
|
2507
|
+
*/
|
|
2475
2508
|
fromVite?: boolean | "vitest";
|
|
2476
2509
|
/**
|
|
2477
|
-
|
|
2478
|
-
|
|
2510
|
+
* @default false
|
|
2511
|
+
*/
|
|
2479
2512
|
watch?: boolean | Arrayable<string>;
|
|
2480
2513
|
/**
|
|
2481
|
-
|
|
2482
|
-
|
|
2514
|
+
* Files or patterns to not watch while in watch mode.
|
|
2515
|
+
*/
|
|
2483
2516
|
ignoreWatch?: Arrayable<string | RegExp>;
|
|
2484
2517
|
/**
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2518
|
+
* **[experimental]** Enable devtools.
|
|
2519
|
+
*
|
|
2520
|
+
* DevTools is still under development, and this is for early testers only.
|
|
2521
|
+
*
|
|
2522
|
+
* This may slow down the build process significantly.
|
|
2523
|
+
*
|
|
2524
|
+
* @default false
|
|
2525
|
+
*/
|
|
2493
2526
|
devtools?: WithEnabled<DevtoolsOptions>;
|
|
2494
2527
|
/**
|
|
2495
|
-
|
|
2496
|
-
|
|
2528
|
+
* You can specify command to be executed after a successful build, specially useful for Watch mode
|
|
2529
|
+
*/
|
|
2497
2530
|
onSuccess?: string | ((config: ResolvedConfig, signal: AbortSignal) => void | Promise<void>);
|
|
2498
2531
|
/**
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2532
|
+
* Enables generation of TypeScript declaration files (`.d.ts`).
|
|
2533
|
+
*
|
|
2534
|
+
* By default, this option is auto-detected based on your project's `package.json`:
|
|
2535
|
+
* - If {@linkcode exe} is enabled, declaration file generation is disabled by default.
|
|
2536
|
+
* - If the `types` field is present, or if the main `exports` contains a `types` entry, declaration file generation is enabled by default.
|
|
2537
|
+
* - Otherwise, declaration file generation is disabled by default.
|
|
2538
|
+
*/
|
|
2506
2539
|
dts?: WithEnabled<DtsOptions>;
|
|
2507
2540
|
/**
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2541
|
+
* Enable unused dependencies check with `unplugin-unused`
|
|
2542
|
+
* Requires `unplugin-unused` to be installed.
|
|
2543
|
+
* @default false
|
|
2544
|
+
*/
|
|
2512
2545
|
unused?: WithEnabled<UnusedOptions>;
|
|
2513
2546
|
/**
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2547
|
+
* Run `publint` after bundling.
|
|
2548
|
+
* Requires `publint` to be installed.
|
|
2549
|
+
* @default false
|
|
2550
|
+
*/
|
|
2518
2551
|
publint?: WithEnabled<PublintOptions>;
|
|
2519
2552
|
/**
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2553
|
+
* Run `arethetypeswrong` after bundling.
|
|
2554
|
+
* Requires `@arethetypeswrong/core` to be installed.
|
|
2555
|
+
*
|
|
2556
|
+
* @default false
|
|
2557
|
+
* @see https://github.com/arethetypeswrong/arethetypeswrong.github.io
|
|
2558
|
+
*/
|
|
2526
2559
|
attw?: WithEnabled<AttwOptions>;
|
|
2527
2560
|
/**
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2561
|
+
* Enable size reporting after bundling.
|
|
2562
|
+
* @default true
|
|
2563
|
+
*/
|
|
2531
2564
|
report?: WithEnabled<ReportOptions>;
|
|
2532
2565
|
/**
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2566
|
+
* `import.meta.glob` support.
|
|
2567
|
+
* @see https://vite.dev/guide/features.html#glob-import
|
|
2568
|
+
* @default true
|
|
2569
|
+
*/
|
|
2537
2570
|
globImport?: boolean;
|
|
2538
2571
|
/**
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2572
|
+
* Generate package exports for `package.json`.
|
|
2573
|
+
*
|
|
2574
|
+
* This will set the `exports` field in `package.json` to point to the
|
|
2575
|
+
* generated files.
|
|
2576
|
+
*
|
|
2577
|
+
* @default false
|
|
2578
|
+
*/
|
|
2546
2579
|
exports?: WithEnabled<ExportsOptions>;
|
|
2547
2580
|
/**
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2581
|
+
* **[experimental]** CSS options.
|
|
2582
|
+
* Requires `@tsdown/css` to be installed.
|
|
2583
|
+
*/
|
|
2551
2584
|
css?: CssOptions;
|
|
2552
2585
|
/**
|
|
2553
|
-
|
|
2554
|
-
|
|
2586
|
+
* @deprecated Use {@linkcode CssOptions.inject | css.inject} instead.
|
|
2587
|
+
*/
|
|
2555
2588
|
injectStyle?: boolean;
|
|
2556
2589
|
/**
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2590
|
+
* @alias copy
|
|
2591
|
+
* @deprecated Alias for {@linkcode copy}, will be removed in the future.
|
|
2592
|
+
*/
|
|
2560
2593
|
publicDir?: CopyOptions | CopyOptionsFn;
|
|
2561
2594
|
/**
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2595
|
+
* Copy files to another directory.
|
|
2596
|
+
* @example
|
|
2597
|
+
* ```ts
|
|
2598
|
+
* [
|
|
2599
|
+
* 'src/assets',
|
|
2600
|
+
* 'src/env.d.ts',
|
|
2601
|
+
* 'src/styles/**\/*.css',
|
|
2602
|
+
* { from: 'src/assets', to: 'dist/assets' },
|
|
2603
|
+
* { from: 'src/styles/**\/*.css', to: 'dist', flatten: true },
|
|
2604
|
+
* ]
|
|
2605
|
+
* ```
|
|
2606
|
+
*/
|
|
2574
2607
|
copy?: CopyOptions | CopyOptionsFn;
|
|
2575
2608
|
hooks?: Partial<TsdownHooks> | ((hooks: Hookable<TsdownHooks>) => Awaitable<void>);
|
|
2576
2609
|
/**
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2610
|
+
* **[experimental]** Bundle as executable using Node.js SEA (Single Executable Applications).
|
|
2611
|
+
*
|
|
2612
|
+
* This will bundle the output into a single executable file using Node.js SEA.
|
|
2613
|
+
* Note that this is only supported on Node.js 25.7.0 and later, and is not supported in Bun or Deno.
|
|
2614
|
+
*
|
|
2615
|
+
* @default false
|
|
2616
|
+
*/
|
|
2584
2617
|
exe?: WithEnabled<ExeOptions>;
|
|
2585
2618
|
/**
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2619
|
+
* **[experimental]** Enable workspace mode.
|
|
2620
|
+
* This allows you to build multiple packages in a monorepo.
|
|
2621
|
+
*/
|
|
2589
2622
|
workspace?: Workspace | Arrayable<string> | true;
|
|
2590
2623
|
}
|
|
2591
2624
|
interface InlineConfig extends UserConfig {
|
|
2592
2625
|
/**
|
|
2593
|
-
|
|
2594
|
-
|
|
2626
|
+
* Config file path
|
|
2627
|
+
*/
|
|
2595
2628
|
config?: boolean | string;
|
|
2596
2629
|
/**
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2630
|
+
* Config loader to use. It can only be set via CLI or API.
|
|
2631
|
+
* @default 'auto'
|
|
2632
|
+
*/
|
|
2600
2633
|
configLoader?: "auto" | "native" | "tsx" | "unrun";
|
|
2601
2634
|
/**
|
|
2602
|
-
|
|
2603
|
-
|
|
2635
|
+
* Filter configs by cwd or name.
|
|
2636
|
+
*/
|
|
2604
2637
|
filter?: RegExp | Arrayable<string>;
|
|
2605
2638
|
}
|
|
2606
2639
|
type UserConfigFn = (inlineConfig: InlineConfig, context: {
|
|
@@ -2608,14 +2641,14 @@ type UserConfigFn = (inlineConfig: InlineConfig, context: {
|
|
|
2608
2641
|
rootConfig?: UserConfig;
|
|
2609
2642
|
}) => Awaitable<Arrayable<UserConfig>>;
|
|
2610
2643
|
type UserConfigExport = Awaitable<Arrayable<UserConfig> | UserConfigFn>;
|
|
2611
|
-
type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "fromVite" | "publicDir" | "bundle" | "injectStyle" | "removeNodeProtocol" | "outExtension" | "external" | "noExternal" | "inlineOnly" | "skipNodeModulesBundle" | "logLevel" | "failOnWarn" | "customLogger" | "envFile" | "envPrefix">, "globalName" | "inputOptions" | "outputOptions" | "minify" | "define" | "alias" | "onSuccess" | "outExtensions" | "hooks" | "copy" | "loader" | "name" | "banner" | "footer" | "checks" | "css">, {
|
|
2644
|
+
type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "fromVite" | "publicDir" | "bundle" | "injectStyle" | "removeNodeProtocol" | "outExtension" | "external" | "noExternal" | "inlineOnly" | "skipNodeModulesBundle" | "logLevel" | "failOnWarn" | "suppressWarnings" | "customLogger" | "envFile" | "envPrefix">, "globalName" | "inputOptions" | "outputOptions" | "minify" | "define" | "alias" | "onSuccess" | "outExtensions" | "hooks" | "copy" | "loader" | "name" | "banner" | "footer" | "checks" | "css">, {
|
|
2612
2645
|
/**
|
|
2613
|
-
|
|
2614
|
-
|
|
2646
|
+
* Resolved entry map (after glob expansion)
|
|
2647
|
+
*/
|
|
2615
2648
|
entry: Record<string, string>;
|
|
2616
2649
|
/**
|
|
2617
|
-
|
|
2618
|
-
|
|
2650
|
+
* Original entry config before glob resolution (for watch mode re-globbing)
|
|
2651
|
+
*/
|
|
2619
2652
|
rawEntry?: TsdownInputOption;
|
|
2620
2653
|
nameLabel: string | undefined;
|
|
2621
2654
|
format: NormalizedFormat;
|
|
@@ -2627,8 +2660,8 @@ type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "from
|
|
|
2627
2660
|
ignoreWatch: Array<string | RegExp>;
|
|
2628
2661
|
deps: ResolvedDepsConfig;
|
|
2629
2662
|
/**
|
|
2630
|
-
|
|
2631
|
-
|
|
2663
|
+
* Resolved root directory of input files
|
|
2664
|
+
*/
|
|
2632
2665
|
root: string;
|
|
2633
2666
|
configDeps: Set<string>;
|
|
2634
2667
|
dts: false | DtsOptions;
|
|
@@ -2642,40 +2675,42 @@ type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "from
|
|
|
2642
2675
|
exe: false | ExeOptions;
|
|
2643
2676
|
}>; //#endregion
|
|
2644
2677
|
//#endregion
|
|
2645
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.
|
|
2678
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.7_@tsdown+exe@0.22.7_@type_53c241a653f2227a5df8ba2949047afe/node_modules/tsdown/dist/config-Cna24Xzf.d.mts
|
|
2646
2679
|
//#region src/config/options.d.ts
|
|
2647
2680
|
/**
|
|
2648
|
-
* Resolve user config into resolved configs
|
|
2649
|
-
*
|
|
2650
|
-
* **Internal API, not for public use**
|
|
2651
|
-
* @private
|
|
2652
|
-
*/
|
|
2681
|
+
* Resolve user config into resolved configs
|
|
2682
|
+
*
|
|
2683
|
+
* **Internal API, not for public use**
|
|
2684
|
+
* @private
|
|
2685
|
+
*/
|
|
2653
2686
|
declare function resolveUserConfig(userConfig: UserConfig, inlineConfig: InlineConfig, configDeps: Set<string>): Promise<ResolvedConfig[]>;
|
|
2654
2687
|
declare function mergeConfig(defaults: UserConfig, ...overrides: UserConfig[]): UserConfig;
|
|
2655
2688
|
declare function mergeConfig(defaults: InlineConfig, ...overrides: InlineConfig[]): InlineConfig; //#endregion
|
|
2656
2689
|
//#region src/config.d.ts
|
|
2657
2690
|
/**
|
|
2658
|
-
* Defines the configuration for tsdown.
|
|
2659
|
-
*/
|
|
2691
|
+
* Defines the configuration for tsdown.
|
|
2692
|
+
*/
|
|
2660
2693
|
declare function defineConfig(options: UserConfig): UserConfig;
|
|
2661
2694
|
declare function defineConfig(options: UserConfig[]): UserConfig[];
|
|
2662
2695
|
declare function defineConfig(options: UserConfigFn): UserConfigFn;
|
|
2663
2696
|
declare function defineConfig(options: UserConfigExport): UserConfigExport; //#endregion
|
|
2664
2697
|
//#endregion
|
|
2665
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.
|
|
2698
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.7_@tsdown+exe@0.22.7_@type_53c241a653f2227a5df8ba2949047afe/node_modules/tsdown/dist/index.d.mts
|
|
2666
2699
|
//#region src/build.d.ts
|
|
2667
2700
|
/**
|
|
2668
|
-
* Build with tsdown.
|
|
2669
|
-
*/
|
|
2701
|
+
* Build with tsdown.
|
|
2702
|
+
*/
|
|
2670
2703
|
declare function build$1(inlineConfig?: InlineConfig): Promise<TsdownBundle[]>;
|
|
2671
2704
|
/**
|
|
2672
|
-
* Build with `ResolvedConfigs`.
|
|
2673
|
-
*
|
|
2674
|
-
* **Internal API, not for public use**
|
|
2675
|
-
* @private
|
|
2676
|
-
*/
|
|
2705
|
+
* Build with `ResolvedConfigs`.
|
|
2706
|
+
*
|
|
2707
|
+
* **Internal API, not for public use**
|
|
2708
|
+
* @private
|
|
2709
|
+
*/
|
|
2677
2710
|
declare function buildWithConfigs(configs: ResolvedConfig[], configDeps: Set<string>, _restart: () => void): Promise<TsdownBundle[]>; //#endregion
|
|
2678
2711
|
//#region src/features/debug.d.ts
|
|
2679
2712
|
declare function enableDebug(debug?: boolean | Arrayable<string>): void; //#endregion
|
|
2713
|
+
//#region src/index.d.ts
|
|
2714
|
+
declare const version: string; //#endregion
|
|
2680
2715
|
//#endregion
|
|
2681
|
-
export { type AttwOptions, type BuildContext, CIOption, type ChunkAddon, type ChunkAddonFunction, type ChunkAddonObject, type CopyEntry, type CopyOptions, type CopyOptionsFn, type DepsConfig, type DevtoolsOptions, DtsOptions, type ExeOptions, type ExportsOptions, Format, InlineConfig, type Logger, type NoExternalFn, NormalizedFormat, type OutExtensionContext, type OutExtensionFactory, type OutExtensionObject, type PackageJsonWithPath, type PackageType, type PublintOptions, type ReportOptions, ResolvedConfig, type ResolvedDepsConfig, Rolldown, type RolldownChunk, type RolldownContext, type SeaConfig, Sourcemap, type TreeshakingOptions, type TsdownBundle, type TsdownHooks, TsdownInputOption, type TsdownPlugin, type TsdownPluginOption, type UnusedOptions, UserConfig, UserConfigExport, UserConfigFn, WithEnabled, Workspace, build$1 as build, buildWithConfigs, defineConfig, enableDebug, globalLogger, mergeConfig, resolveUserConfig };
|
|
2716
|
+
export { type AttwOptions, type BuildContext, CIOption, type ChunkAddon, type ChunkAddonFunction, type ChunkAddonObject, type CopyEntry, type CopyOptions, type CopyOptionsFn, type DepsConfig, type DevtoolsOptions, DtsOptions, type ExeOptions, type ExportsOptions, Format, InlineConfig, type Logger, type NoExternalFn, NormalizedFormat, type OutExtensionContext, type OutExtensionFactory, type OutExtensionObject, type PackageJsonWithPath, type PackageType, type PublintOptions, type ReportOptions, ResolvedConfig, type ResolvedDepsConfig, Rolldown, type RolldownChunk, type RolldownContext, type SeaConfig, Sourcemap, type TreeshakingOptions, type TsdownBundle, type TsdownHooks, TsdownInputOption, type TsdownPlugin, type TsdownPluginOption, type UnusedOptions, UserConfig, UserConfigExport, UserConfigFn, WithEnabled, Workspace, build$1 as build, buildWithConfigs, defineConfig, enableDebug, globalLogger, mergeConfig, resolveUserConfig, version };
|