tsdown 0.18.2 → 0.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config-DlCfPR2i.mjs +794 -0
- package/dist/config-NHDK5cAy.d.mts +16 -0
- package/dist/config.d.mts +3 -13
- package/dist/config.mjs +3 -2
- package/dist/{index-BJCpuL9t.d.mts → index-BfO1W_C3.d.mts} +383 -18
- package/dist/index.d.mts +3 -14
- package/dist/index.mjs +4 -4
- package/dist/{package-CpLZpKe2.mjs → logger-s1ImI5j1.mjs} +11 -8
- package/dist/package-BZkqghxy.mjs +5 -0
- package/dist/plugins.d.mts +1 -1
- package/dist/plugins.mjs +3 -2
- package/dist/run.mjs +5 -4
- package/dist/{src-aipTTo-5.mjs → src-DrqLE2Pt.mjs} +37 -658
- package/package.json +12 -11
- package/dist/config-DLSWqKoz.mjs +0 -7
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { f as UserConfig, i as InlineConfig, m as UserConfigFn, p as UserConfigExport } from "./index-BfO1W_C3.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/config/options.d.ts
|
|
4
|
+
declare function mergeConfig(defaults: UserConfig, overrides: UserConfig): UserConfig;
|
|
5
|
+
declare function mergeConfig(defaults: InlineConfig, overrides: InlineConfig): InlineConfig;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/config.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Defines the configuration for tsdown.
|
|
10
|
+
*/
|
|
11
|
+
declare function defineConfig(options: UserConfig): UserConfig;
|
|
12
|
+
declare function defineConfig(options: UserConfig[]): UserConfig[];
|
|
13
|
+
declare function defineConfig(options: UserConfigFn): UserConfigFn;
|
|
14
|
+
declare function defineConfig(options: UserConfigExport): UserConfigExport;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { mergeConfig as n, defineConfig as t };
|
package/dist/config.d.mts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Defines the configuration for tsdown.
|
|
7
|
-
*/
|
|
8
|
-
declare function defineConfig(options: UserConfig): UserConfig;
|
|
9
|
-
declare function defineConfig(options: UserConfig[]): UserConfig[];
|
|
10
|
-
declare function defineConfig(options: UserConfigFn): UserConfigFn;
|
|
11
|
-
declare function defineConfig(options: UserConfigExport): UserConfigExport;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { type UserConfig, type UserConfigExport, type UserConfigFn, defineConfig };
|
|
1
|
+
import { f as UserConfig, m as UserConfigFn, p as UserConfigExport } from "./index-BfO1W_C3.mjs";
|
|
2
|
+
import { n as mergeConfig, t as defineConfig } from "./config-NHDK5cAy.mjs";
|
|
3
|
+
export { UserConfig, UserConfigExport, UserConfigFn, defineConfig, mergeConfig };
|
package/dist/config.mjs
CHANGED
|
@@ -3,15 +3,14 @@ import { BuildOptions, ExternalOption, InputOptions, InternalModuleFormat, Minif
|
|
|
3
3
|
import { Hookable } from "hookable";
|
|
4
4
|
import { Options as DtsOptions } from "rolldown-plugin-dts";
|
|
5
5
|
import { StartOptions } from "@vitejs/devtools/cli-commands";
|
|
6
|
-
import { PackageJson } from "pkg-types";
|
|
7
6
|
import { CheckPackageOptions } from "@arethetypeswrong/core";
|
|
8
|
-
import { Options
|
|
7
|
+
import { Options } from "publint";
|
|
9
8
|
import { Options as UnusedOptions } from "unplugin-unused";
|
|
10
9
|
|
|
11
10
|
//#region src/utils/types.d.ts
|
|
12
11
|
type Overwrite<T, U> = Omit<T, keyof U> & U;
|
|
13
12
|
type Awaitable<T> = T | Promise<T>;
|
|
14
|
-
type MarkPartial<T, K extends keyof T> = Omit<Required<T>, K> & Partial<Pick<T, K>>;
|
|
13
|
+
type MarkPartial<T, K$1 extends keyof T> = Omit<Required<T>, K$1> & Partial<Pick<T, K$1>>;
|
|
15
14
|
type Arrayable<T> = T | T[];
|
|
16
15
|
//#endregion
|
|
17
16
|
//#region src/features/copy.d.ts
|
|
@@ -44,6 +43,22 @@ interface CopyEntry {
|
|
|
44
43
|
type CopyOptions = Arrayable<string | CopyEntry>;
|
|
45
44
|
type CopyOptionsFn = (options: ResolvedConfig) => Awaitable<CopyOptions>;
|
|
46
45
|
//#endregion
|
|
46
|
+
//#region src/features/css.d.ts
|
|
47
|
+
interface CssOptions {
|
|
48
|
+
/**
|
|
49
|
+
* Enable/disable CSS code splitting.
|
|
50
|
+
* When set to `false`, all CSS in the entire project will be extracted into a single CSS file.
|
|
51
|
+
* When set to `true`, CSS imported in async JS chunks will be preserved as chunks.
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
splitting?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Specify the name of the CSS file.
|
|
57
|
+
* @default 'style.css'
|
|
58
|
+
*/
|
|
59
|
+
fileName?: string;
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
47
62
|
//#region src/features/debug.d.ts
|
|
48
63
|
interface DebugOptions extends NonNullable<InputOptions["debug"]> {
|
|
49
64
|
/**
|
|
@@ -92,6 +107,309 @@ interface TsdownHooks {
|
|
|
92
107
|
}) => void | Promise<void>;
|
|
93
108
|
}
|
|
94
109
|
//#endregion
|
|
110
|
+
//#region node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.d.mts
|
|
111
|
+
|
|
112
|
+
interface PackageJson {
|
|
113
|
+
/**
|
|
114
|
+
* The name is what your thing is called.
|
|
115
|
+
* Some rules:
|
|
116
|
+
* - The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
|
|
117
|
+
* - The name can’t start with a dot or an underscore.
|
|
118
|
+
* - New packages must not have uppercase letters in the name.
|
|
119
|
+
* - 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.
|
|
120
|
+
*/
|
|
121
|
+
name?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Version must be parseable by `node-semver`, which is bundled with npm as a dependency. (`npm install semver` to use it yourself.)
|
|
124
|
+
*/
|
|
125
|
+
version?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Put a description in it. It’s a string. This helps people discover your package, as it’s listed in `npm search`.
|
|
128
|
+
*/
|
|
129
|
+
description?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Put keywords in it. It’s an array of strings. This helps people discover your package as it’s listed in `npm search`.
|
|
132
|
+
*/
|
|
133
|
+
keywords?: string[];
|
|
134
|
+
/**
|
|
135
|
+
* The url to the project homepage.
|
|
136
|
+
*/
|
|
137
|
+
homepage?: string;
|
|
138
|
+
/**
|
|
139
|
+
* 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.
|
|
140
|
+
*/
|
|
141
|
+
bugs?: string | {
|
|
142
|
+
url?: string;
|
|
143
|
+
email?: string;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* 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.
|
|
147
|
+
*/
|
|
148
|
+
license?: string;
|
|
149
|
+
/**
|
|
150
|
+
* 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.
|
|
151
|
+
* For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:
|
|
152
|
+
*/
|
|
153
|
+
repository?: string | {
|
|
154
|
+
type: string;
|
|
155
|
+
url: string;
|
|
156
|
+
/**
|
|
157
|
+
* 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:
|
|
158
|
+
*/
|
|
159
|
+
directory?: string;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* The `scripts` field is a dictionary containing script commands that are run at various times in the lifecycle of your package.
|
|
163
|
+
*/
|
|
164
|
+
scripts?: PackageJsonScripts;
|
|
165
|
+
/**
|
|
166
|
+
* If you set `"private": true` in your package.json, then npm will refuse to publish it.
|
|
167
|
+
*/
|
|
168
|
+
private?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* The “author” is one person.
|
|
171
|
+
*/
|
|
172
|
+
author?: PackageJsonPerson;
|
|
173
|
+
/**
|
|
174
|
+
* “contributors” is an array of people.
|
|
175
|
+
*/
|
|
176
|
+
contributors?: PackageJsonPerson[];
|
|
177
|
+
/**
|
|
178
|
+
* An object containing a URL that provides up-to-date information
|
|
179
|
+
* about ways to help fund development of your package,
|
|
180
|
+
* a string URL, or an array of objects and string URLs
|
|
181
|
+
*/
|
|
182
|
+
funding?: PackageJsonFunding | PackageJsonFunding[];
|
|
183
|
+
/**
|
|
184
|
+
* 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.
|
|
185
|
+
*/
|
|
186
|
+
files?: string[];
|
|
187
|
+
/**
|
|
188
|
+
* 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.
|
|
189
|
+
* This should be a module ID relative to the root of your package folder.
|
|
190
|
+
* For most modules, it makes the most sense to have a main script and often not much else.
|
|
191
|
+
*/
|
|
192
|
+
main?: string;
|
|
193
|
+
/**
|
|
194
|
+
* 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)
|
|
195
|
+
*/
|
|
196
|
+
browser?: string | Record<string, string | false>;
|
|
197
|
+
/**
|
|
198
|
+
* 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.
|
|
199
|
+
*/
|
|
200
|
+
unpkg?: string;
|
|
201
|
+
/**
|
|
202
|
+
* 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.
|
|
203
|
+
*/
|
|
204
|
+
bin?: string | Record<string, string>;
|
|
205
|
+
/**
|
|
206
|
+
* Specify either a single file or an array of filenames to put in place for the `man` program to find.
|
|
207
|
+
*/
|
|
208
|
+
man?: string | string[];
|
|
209
|
+
/**
|
|
210
|
+
* 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.
|
|
211
|
+
*/
|
|
212
|
+
dependencies?: Record<string, string>;
|
|
213
|
+
/**
|
|
214
|
+
* 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.
|
|
215
|
+
* In this case, it’s best to map these additional items in a `devDependencies` object.
|
|
216
|
+
*/
|
|
217
|
+
devDependencies?: Record<string, string>;
|
|
218
|
+
/**
|
|
219
|
+
* 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.
|
|
220
|
+
*/
|
|
221
|
+
optionalDependencies?: Record<string, string>;
|
|
222
|
+
/**
|
|
223
|
+
* 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.
|
|
224
|
+
*/
|
|
225
|
+
peerDependencies?: Record<string, string>;
|
|
226
|
+
/**
|
|
227
|
+
* TypeScript typings, typically ending by `.d.ts`.
|
|
228
|
+
*/
|
|
229
|
+
types?: string;
|
|
230
|
+
/**
|
|
231
|
+
* This field is synonymous with `types`.
|
|
232
|
+
*/
|
|
233
|
+
typings?: string;
|
|
234
|
+
/**
|
|
235
|
+
* Non-Standard Node.js alternate entry-point to main.
|
|
236
|
+
* An initial implementation for supporting CJS packages (from main), and use module for ESM modules.
|
|
237
|
+
*/
|
|
238
|
+
module?: string;
|
|
239
|
+
/**
|
|
240
|
+
* Make main entry-point be loaded as an ESM module, support "export" syntax instead of "require"
|
|
241
|
+
*
|
|
242
|
+
* Docs:
|
|
243
|
+
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_package_json_type_field
|
|
244
|
+
*
|
|
245
|
+
* @default 'commonjs'
|
|
246
|
+
* @since Node.js v14
|
|
247
|
+
*/
|
|
248
|
+
type?: "module" | "commonjs";
|
|
249
|
+
/**
|
|
250
|
+
* Alternate and extensible alternative to "main" entry point.
|
|
251
|
+
*
|
|
252
|
+
* When using `{type: "module"}`, any ESM module file MUST end with `.mjs` extension.
|
|
253
|
+
*
|
|
254
|
+
* Docs:
|
|
255
|
+
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_exports_sugar
|
|
256
|
+
*
|
|
257
|
+
* @since Node.js v12.7
|
|
258
|
+
*/
|
|
259
|
+
exports?: PackageJsonExports;
|
|
260
|
+
/**
|
|
261
|
+
* Docs:
|
|
262
|
+
* - https://nodejs.org/api/packages.html#imports
|
|
263
|
+
*/
|
|
264
|
+
imports?: Record<string, string | Record<string, string>>;
|
|
265
|
+
/**
|
|
266
|
+
* The field is used to define a set of sub-packages (or workspaces) within a monorepo.
|
|
267
|
+
*
|
|
268
|
+
* This field is an array of glob patterns or an object with specific configurations for managing
|
|
269
|
+
* multiple packages in a single repository.
|
|
270
|
+
*/
|
|
271
|
+
workspaces?: string[] | {
|
|
272
|
+
/**
|
|
273
|
+
* Workspace package paths. Glob patterns are supported.
|
|
274
|
+
*/
|
|
275
|
+
packages?: string[];
|
|
276
|
+
/**
|
|
277
|
+
* Packages to block from hoisting to the workspace root.
|
|
278
|
+
* Uses glob patterns to match module paths in the dependency tree.
|
|
279
|
+
*
|
|
280
|
+
* Docs:
|
|
281
|
+
* - https://classic.yarnpkg.com/blog/2018/02/15/nohoist/
|
|
282
|
+
*/
|
|
283
|
+
nohoist?: string[];
|
|
284
|
+
};
|
|
285
|
+
/**
|
|
286
|
+
* The field is used to specify different TypeScript declaration files for
|
|
287
|
+
* different versions of TypeScript, allowing for version-specific type definitions.
|
|
288
|
+
*/
|
|
289
|
+
typesVersions?: Record<string, Record<string, string[]>>;
|
|
290
|
+
/**
|
|
291
|
+
* You can specify which operating systems your module will run on:
|
|
292
|
+
* ```json
|
|
293
|
+
* {
|
|
294
|
+
* "os": ["darwin", "linux"]
|
|
295
|
+
* }
|
|
296
|
+
* ```
|
|
297
|
+
* You can also block instead of allowing operating systems, just prepend the blocked os with a '!':
|
|
298
|
+
* ```json
|
|
299
|
+
* {
|
|
300
|
+
* "os": ["!win32"]
|
|
301
|
+
* }
|
|
302
|
+
* ```
|
|
303
|
+
* The host operating system is determined by `process.platform`
|
|
304
|
+
* It is allowed to both block and allow an item, although there isn't any good reason to do this.
|
|
305
|
+
*/
|
|
306
|
+
os?: string[];
|
|
307
|
+
/**
|
|
308
|
+
* If your code only runs on certain cpu architectures, you can specify which ones.
|
|
309
|
+
* ```json
|
|
310
|
+
* {
|
|
311
|
+
* "cpu": ["x64", "ia32"]
|
|
312
|
+
* }
|
|
313
|
+
* ```
|
|
314
|
+
* Like the `os` option, you can also block architectures:
|
|
315
|
+
* ```json
|
|
316
|
+
* {
|
|
317
|
+
* "cpu": ["!arm", "!mips"]
|
|
318
|
+
* }
|
|
319
|
+
* ```
|
|
320
|
+
* The host architecture is determined by `process.arch`
|
|
321
|
+
*/
|
|
322
|
+
cpu?: string[];
|
|
323
|
+
/**
|
|
324
|
+
* This is a set of config values that will be used at publish-time.
|
|
325
|
+
*/
|
|
326
|
+
publishConfig?: {
|
|
327
|
+
/**
|
|
328
|
+
* The registry that will be used if the package is published.
|
|
329
|
+
*/
|
|
330
|
+
registry?: string;
|
|
331
|
+
/**
|
|
332
|
+
* The tag that will be used if the package is published.
|
|
333
|
+
*/
|
|
334
|
+
tag?: string;
|
|
335
|
+
/**
|
|
336
|
+
* The access level that will be used if the package is published.
|
|
337
|
+
*/
|
|
338
|
+
access?: "public" | "restricted";
|
|
339
|
+
/**
|
|
340
|
+
* **pnpm-only**
|
|
341
|
+
*
|
|
342
|
+
* By default, for portability reasons, no files except those listed in
|
|
343
|
+
* the bin field will be marked as executable in the resulting package
|
|
344
|
+
* archive. The executableFiles field lets you declare additional fields
|
|
345
|
+
* that must have the executable flag (+x) set even if
|
|
346
|
+
* they aren't directly accessible through the bin field.
|
|
347
|
+
*/
|
|
348
|
+
executableFiles?: string[];
|
|
349
|
+
/**
|
|
350
|
+
* **pnpm-only**
|
|
351
|
+
*
|
|
352
|
+
* You also can use the field `publishConfig.directory` to customize
|
|
353
|
+
* the published subdirectory relative to the current `package.json`.
|
|
354
|
+
*
|
|
355
|
+
* It is expected to have a modified version of the current package in
|
|
356
|
+
* the specified directory (usually using third party build tools).
|
|
357
|
+
*/
|
|
358
|
+
directory?: string;
|
|
359
|
+
/**
|
|
360
|
+
* **pnpm-only**
|
|
361
|
+
*
|
|
362
|
+
* When set to `true`, the project will be symlinked from the
|
|
363
|
+
* `publishConfig.directory` location during local development.
|
|
364
|
+
* @default true
|
|
365
|
+
*/
|
|
366
|
+
linkDirectory?: boolean;
|
|
367
|
+
} & Pick<PackageJson, "bin" | "main" | "exports" | "types" | "typings" | "module" | "browser" | "unpkg" | "typesVersions" | "os" | "cpu">;
|
|
368
|
+
/**
|
|
369
|
+
* See: https://nodejs.org/api/packages.html#packagemanager
|
|
370
|
+
* This field defines which package manager is expected to be used when working on the current project.
|
|
371
|
+
* Should be of the format: `<name>@<version>[#hash]`
|
|
372
|
+
*/
|
|
373
|
+
packageManager?: string;
|
|
374
|
+
[key: string]: any;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* See: https://docs.npmjs.com/cli/v11/using-npm/scripts#pre--post-scripts
|
|
378
|
+
*/
|
|
379
|
+
type PackageJsonScriptWithPreAndPost<S extends string> = S | `${"pre" | "post"}${S}`;
|
|
380
|
+
/**
|
|
381
|
+
* See: https://docs.npmjs.com/cli/v11/using-npm/scripts#life-cycle-operation-order
|
|
382
|
+
*/
|
|
383
|
+
type PackageJsonNpmLifeCycleScripts = "dependencies" | "prepublishOnly" | PackageJsonScriptWithPreAndPost<"install" | "pack" | "prepare" | "publish" | "restart" | "start" | "stop" | "test" | "version">;
|
|
384
|
+
/**
|
|
385
|
+
* See: https://pnpm.io/scripts#lifecycle-scripts
|
|
386
|
+
*/
|
|
387
|
+
type PackageJsonPnpmLifeCycleScripts = "pnpm:devPreinstall";
|
|
388
|
+
type PackageJsonCommonScripts = "build" | "coverage" | "deploy" | "dev" | "format" | "lint" | "preview" | "release" | "typecheck" | "watch";
|
|
389
|
+
type PackageJsonScriptName = PackageJsonCommonScripts | PackageJsonNpmLifeCycleScripts | PackageJsonPnpmLifeCycleScripts | (string & {});
|
|
390
|
+
type PackageJsonScripts = { [P in PackageJsonScriptName]?: string };
|
|
391
|
+
/**
|
|
392
|
+
* 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.
|
|
393
|
+
*/
|
|
394
|
+
type PackageJsonPerson = string | {
|
|
395
|
+
name: string;
|
|
396
|
+
email?: string;
|
|
397
|
+
url?: string;
|
|
398
|
+
};
|
|
399
|
+
type PackageJsonFunding = string | {
|
|
400
|
+
url: string;
|
|
401
|
+
type?: string;
|
|
402
|
+
};
|
|
403
|
+
type PackageJsonExportKey = "." | "import" | "require" | "types" | "node" | "browser" | "default" | (string & {});
|
|
404
|
+
type PackageJsonExportsObject = { [P in PackageJsonExportKey]?: string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject> };
|
|
405
|
+
type PackageJsonExports = string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>;
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Defines a PackageJson structure.
|
|
409
|
+
* @param pkg - The `package.json` content as an object. See {@link PackageJson}.
|
|
410
|
+
* @returns the same `package.json` object.
|
|
411
|
+
*/
|
|
412
|
+
//#endregion
|
|
95
413
|
//#region src/utils/package.d.ts
|
|
96
414
|
interface PackageJsonWithPath extends PackageJson {
|
|
97
415
|
packageJsonPath: string;
|
|
@@ -145,6 +463,29 @@ interface AttwOptions extends CheckPackageOptions {
|
|
|
145
463
|
* @default 'warn'
|
|
146
464
|
*/
|
|
147
465
|
level?: "error" | "warn";
|
|
466
|
+
/**
|
|
467
|
+
* List of problem types to ignore by rule name.
|
|
468
|
+
*
|
|
469
|
+
* The available values are:
|
|
470
|
+
* - `no-resolution`
|
|
471
|
+
* - `untyped-resolution`
|
|
472
|
+
* - `false-cjs`
|
|
473
|
+
* - `false-esm`
|
|
474
|
+
* - `cjs-resolves-to-esm`
|
|
475
|
+
* - `fallback-condition`
|
|
476
|
+
* - `cjs-only-exports-default`
|
|
477
|
+
* - `named-exports`
|
|
478
|
+
* - `false-export-default`
|
|
479
|
+
* - `missing-export-equals`
|
|
480
|
+
* - `unexpected-module-syntax`
|
|
481
|
+
* - `internal-resolution-error`
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* ```ts
|
|
485
|
+
* ignoreRules: ['no-resolution', 'false-cjs']
|
|
486
|
+
* ```
|
|
487
|
+
*/
|
|
488
|
+
ignoreRules?: string[];
|
|
148
489
|
}
|
|
149
490
|
//#endregion
|
|
150
491
|
//#region src/utils/chunks.d.ts
|
|
@@ -157,6 +498,19 @@ interface TsdownBundle extends AsyncDisposable {
|
|
|
157
498
|
config: ResolvedConfig;
|
|
158
499
|
}
|
|
159
500
|
//#endregion
|
|
501
|
+
//#region src/utils/logger.d.ts
|
|
502
|
+
type LogType = "error" | "warn" | "info";
|
|
503
|
+
type LogLevel = LogType | "silent";
|
|
504
|
+
interface Logger {
|
|
505
|
+
level: LogLevel;
|
|
506
|
+
info: (...args: any[]) => void;
|
|
507
|
+
warn: (...args: any[]) => void;
|
|
508
|
+
warnOnce: (...args: any[]) => void;
|
|
509
|
+
error: (...args: any[]) => void;
|
|
510
|
+
success: (...args: any[]) => void;
|
|
511
|
+
}
|
|
512
|
+
declare const globalLogger: Logger;
|
|
513
|
+
//#endregion
|
|
160
514
|
//#region src/features/pkg/exports.d.ts
|
|
161
515
|
interface ExportsOptions {
|
|
162
516
|
/**
|
|
@@ -166,6 +520,11 @@ interface ExportsOptions {
|
|
|
166
520
|
*/
|
|
167
521
|
devExports?: boolean | string;
|
|
168
522
|
/**
|
|
523
|
+
* Exports for package.json file.
|
|
524
|
+
* @default true
|
|
525
|
+
*/
|
|
526
|
+
packageJson?: boolean;
|
|
527
|
+
/**
|
|
169
528
|
* Exports for all files.
|
|
170
529
|
*/
|
|
171
530
|
all?: boolean;
|
|
@@ -187,18 +546,8 @@ interface ExportsOptions {
|
|
|
187
546
|
}) => Awaitable<Record<string, any>>;
|
|
188
547
|
}
|
|
189
548
|
//#endregion
|
|
190
|
-
//#region src/
|
|
191
|
-
|
|
192
|
-
type LogLevel = LogType | "silent";
|
|
193
|
-
interface Logger {
|
|
194
|
-
level: LogLevel;
|
|
195
|
-
info: (...args: any[]) => void;
|
|
196
|
-
warn: (...args: any[]) => void;
|
|
197
|
-
warnOnce: (...args: any[]) => void;
|
|
198
|
-
error: (...args: any[]) => void;
|
|
199
|
-
success: (...args: any[]) => void;
|
|
200
|
-
}
|
|
201
|
-
declare const globalLogger: Logger;
|
|
549
|
+
//#region src/features/pkg/publint.d.ts
|
|
550
|
+
interface PublintOptions extends Options {}
|
|
202
551
|
//#endregion
|
|
203
552
|
//#region src/features/report.d.ts
|
|
204
553
|
interface ReportOptions {
|
|
@@ -343,7 +692,7 @@ interface UserConfig {
|
|
|
343
692
|
*/
|
|
344
693
|
target?: string | string[] | false;
|
|
345
694
|
/**
|
|
346
|
-
* Compile-time env variables.
|
|
695
|
+
* Compile-time env variables, which can be accessed via `import.meta.env` or `process.env`.
|
|
347
696
|
* @example
|
|
348
697
|
* ```json
|
|
349
698
|
* {
|
|
@@ -353,6 +702,17 @@ interface UserConfig {
|
|
|
353
702
|
* ```
|
|
354
703
|
*/
|
|
355
704
|
env?: Record<string, any>;
|
|
705
|
+
/**
|
|
706
|
+
* Path to env file providing compile-time env variables.
|
|
707
|
+
* @example
|
|
708
|
+
* `.env`, `.env.production`, etc.
|
|
709
|
+
*/
|
|
710
|
+
envFile?: string;
|
|
711
|
+
/**
|
|
712
|
+
* When loading env variables from `envFile`, only include variables with these prefixes.
|
|
713
|
+
* @default 'TSDOWN_'
|
|
714
|
+
*/
|
|
715
|
+
envPrefix?: string | string[];
|
|
356
716
|
define?: Record<string, string>;
|
|
357
717
|
/** @default false */
|
|
358
718
|
shims?: boolean;
|
|
@@ -585,6 +945,10 @@ interface UserConfig {
|
|
|
585
945
|
*/
|
|
586
946
|
exports?: WithEnabled<ExportsOptions>;
|
|
587
947
|
/**
|
|
948
|
+
* **[experimental]** CSS options.
|
|
949
|
+
*/
|
|
950
|
+
css?: CssOptions;
|
|
951
|
+
/**
|
|
588
952
|
* @deprecated Alias for `copy`, will be removed in the future.
|
|
589
953
|
*/
|
|
590
954
|
publicDir?: CopyOptions | CopyOptionsFn;
|
|
@@ -628,7 +992,7 @@ type UserConfigFn = (inlineConfig: InlineConfig, context: {
|
|
|
628
992
|
ci: boolean;
|
|
629
993
|
}) => Awaitable<Arrayable<UserConfig>>;
|
|
630
994
|
type UserConfigExport = Awaitable<Arrayable<UserConfig> | UserConfigFn>;
|
|
631
|
-
type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "fromVite" | "publicDir" | "silent" | "bundle" | "removeNodeProtocol" | "logLevel" | "failOnWarn" | "customLogger">, "globalName" | "inputOptions" | "outputOptions" | "minify" | "define" | "alias" | "external" | "onSuccess" | "outExtensions" | "hooks" | "copy" | "loader" | "name" | "banner" | "footer">, {
|
|
995
|
+
type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "fromVite" | "publicDir" | "silent" | "bundle" | "removeNodeProtocol" | "logLevel" | "failOnWarn" | "customLogger" | "envFile" | "envPrefix">, "globalName" | "inputOptions" | "outputOptions" | "minify" | "define" | "alias" | "external" | "onSuccess" | "outExtensions" | "hooks" | "copy" | "loader" | "name" | "banner" | "footer">, {
|
|
632
996
|
/** Resolved entry map (after glob expansion) */
|
|
633
997
|
entry: Record<string, string>;
|
|
634
998
|
nameLabel: string | undefined;
|
|
@@ -641,6 +1005,7 @@ type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "from
|
|
|
641
1005
|
ignoreWatch: Array<string | RegExp>;
|
|
642
1006
|
noExternal?: NoExternalFn;
|
|
643
1007
|
inlineOnly?: Array<string | RegExp>;
|
|
1008
|
+
css: Required<CssOptions>;
|
|
644
1009
|
dts: false | DtsOptions;
|
|
645
1010
|
report: false | ReportOptions;
|
|
646
1011
|
tsconfig: false | string;
|
|
@@ -651,4 +1016,4 @@ type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "from
|
|
|
651
1016
|
unused: false | UnusedOptions;
|
|
652
1017
|
}>;
|
|
653
1018
|
//#endregion
|
|
654
|
-
export { OutExtensionFactory as A,
|
|
1019
|
+
export { OutExtensionFactory as A, CopyOptions as B, RolldownChunk as C, ChunkAddonFunction as D, ChunkAddon as E, RolldownContext as F, TsdownHooks as I, DebugOptions as L, PackageJsonWithPath as M, PackageType as N, ChunkAddonObject as O, BuildContext as P, CssOptions as R, globalLogger as S, AttwOptions as T, CopyOptionsFn as V, ReportOptions as _, NoExternalFn as a, ExportsOptions as b, Sourcemap as c, UnusedOptions as d, UserConfig as f, Workspace as g, WithEnabled as h, InlineConfig as i, OutExtensionObject as j, OutExtensionContext as k, TreeshakingOptions as l, UserConfigFn as m, DtsOptions as n, NormalizedFormat as o, UserConfigExport as p, Format as r, ResolvedConfig as s, CIOption as t, TsdownInputOption as u, ReportPlugin as v, TsdownBundle as w, Logger as x, PublintOptions as y, CopyEntry as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as OutExtensionFactory, B as
|
|
2
|
-
import { defineConfig } from "./config.mjs";
|
|
1
|
+
import { A as OutExtensionFactory, B as CopyOptions, C as RolldownChunk, D as ChunkAddonFunction, E as ChunkAddon, F as RolldownContext, I as TsdownHooks, L as DebugOptions, M as PackageJsonWithPath, N as PackageType, O as ChunkAddonObject, P as BuildContext, R as CssOptions, S as globalLogger, T as AttwOptions, V as CopyOptionsFn, _ as ReportOptions, a as NoExternalFn, b as ExportsOptions, c as Sourcemap, d as UnusedOptions, f as UserConfig, g as Workspace, h as WithEnabled, i as InlineConfig, j as OutExtensionObject, k as OutExtensionContext, l as TreeshakingOptions, m as UserConfigFn, n as DtsOptions, o as NormalizedFormat, p as UserConfigExport, r as Format, s as ResolvedConfig, t as CIOption, u as TsdownInputOption, w as TsdownBundle, x as Logger, y as PublintOptions, z as CopyEntry } from "./index-BfO1W_C3.mjs";
|
|
2
|
+
import { n as mergeConfig, t as defineConfig } from "./config-NHDK5cAy.mjs";
|
|
3
3
|
import * as Rolldown from "rolldown";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
@@ -7,16 +7,5 @@ import * as Rolldown from "rolldown";
|
|
|
7
7
|
* Build with tsdown.
|
|
8
8
|
*/
|
|
9
9
|
declare function build(userOptions?: InlineConfig): Promise<TsdownBundle[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Build a single configuration, without watch and shortcuts features.
|
|
12
|
-
*
|
|
13
|
-
* Internal API, not for public use
|
|
14
|
-
*
|
|
15
|
-
* @private
|
|
16
|
-
* @param config Resolved options
|
|
17
|
-
*/
|
|
18
|
-
declare function buildSingle(config: ResolvedConfig, configFiles: string[], isDualFormat: boolean, clean: () => Promise<void>, restart: () => void, done: (bundle: TsdownBundle) => Promise<void>): Promise<TsdownBundle>;
|
|
19
|
-
/** @internal */
|
|
20
|
-
declare const shimFile: string;
|
|
21
10
|
//#endregion
|
|
22
|
-
export { AttwOptions, BuildContext, CIOption, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, DebugOptions, DtsOptions, ExportsOptions, Format, InlineConfig, type Logger, NoExternalFn, NormalizedFormat, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageJsonWithPath, PackageType, PublintOptions, ReportOptions, ResolvedConfig, Rolldown, RolldownChunk, RolldownContext, Sourcemap, TreeshakingOptions, TsdownBundle, TsdownHooks, TsdownInputOption, UnusedOptions, UserConfig, UserConfigExport, UserConfigFn, WithEnabled, Workspace, build,
|
|
11
|
+
export { AttwOptions, BuildContext, CIOption, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, CssOptions, DebugOptions, DtsOptions, ExportsOptions, Format, InlineConfig, type Logger, NoExternalFn, NormalizedFormat, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageJsonWithPath, PackageType, PublintOptions, ReportOptions, ResolvedConfig, Rolldown, RolldownChunk, RolldownContext, Sourcemap, TreeshakingOptions, TsdownBundle, TsdownHooks, TsdownInputOption, UnusedOptions, UserConfig, UserConfigExport, UserConfigFn, WithEnabled, Workspace, build, defineConfig, globalLogger, mergeConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { a as globalLogger } from "./logger-s1ImI5j1.mjs";
|
|
2
|
+
import { n as mergeConfig, t as defineConfig } from "./config-DlCfPR2i.mjs";
|
|
3
|
+
import { i as shimFile, n as build, r as buildSingle, t as Rolldown } from "./src-DrqLE2Pt.mjs";
|
|
4
4
|
|
|
5
|
-
export { Rolldown, build, buildSingle, defineConfig, globalLogger, shimFile };
|
|
5
|
+
export { Rolldown, build, buildSingle, defineConfig, globalLogger, mergeConfig, shimFile };
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { createRequire as __cjs_createRequire } from "node:module";
|
|
2
2
|
const __cjs_require = __cjs_createRequire(import.meta.url);
|
|
3
|
-
import {
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
4
|
import process from "node:process";
|
|
5
|
+
import { bgRed, bgYellow, blue, green, rgb, yellow } from "ansis";
|
|
5
6
|
const picomatch = __cjs_require("picomatch");
|
|
6
7
|
|
|
8
|
+
//#region rolldown:runtime
|
|
9
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
7
12
|
//#region src/utils/general.ts
|
|
8
13
|
function toArray(val, defaultValue) {
|
|
9
14
|
if (Array.isArray(val)) return val;
|
|
@@ -39,9 +44,11 @@ function pkgExists(moduleName) {
|
|
|
39
44
|
} catch {}
|
|
40
45
|
return false;
|
|
41
46
|
}
|
|
42
|
-
async function importWithError(moduleName) {
|
|
47
|
+
async function importWithError(moduleName, resolvePaths) {
|
|
48
|
+
let resolved;
|
|
49
|
+
if (resolvePaths) resolved = __require.resolve(moduleName, { paths: resolvePaths });
|
|
43
50
|
try {
|
|
44
|
-
return await import(moduleName);
|
|
51
|
+
return await import(resolved || moduleName);
|
|
45
52
|
} catch (error) {
|
|
46
53
|
throw new Error(`Failed to import module "${moduleName}". Please ensure it is installed.`, { cause: error });
|
|
47
54
|
}
|
|
@@ -163,8 +170,4 @@ function hue2rgb(p, q, t) {
|
|
|
163
170
|
}
|
|
164
171
|
|
|
165
172
|
//#endregion
|
|
166
|
-
|
|
167
|
-
var version = "0.18.2";
|
|
168
|
-
|
|
169
|
-
//#endregion
|
|
170
|
-
export { getNameLabel as a, importWithError as c, pkgExists as d, promiseWithResolvers as f, toArray as g, slash as h, generateColor as i, matchPattern as l, resolveRegex as m, LogLevels as n, globalLogger as o, resolveComma as p, createLogger as r, prettyFormat as s, version as t, noop as u };
|
|
173
|
+
export { globalLogger as a, matchPattern as c, promiseWithResolvers as d, resolveComma as f, toArray as h, getNameLabel as i, noop as l, slash as m, createLogger as n, prettyFormat as o, resolveRegex as p, generateColor as r, importWithError as s, LogLevels as t, pkgExists as u };
|
package/dist/plugins.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as ResolvedConfig, v as ReportPlugin, w as TsdownBundle, x as Logger } from "./index-BfO1W_C3.mjs";
|
|
2
2
|
import { Plugin } from "rolldown";
|
|
3
3
|
|
|
4
4
|
//#region src/features/external.d.ts
|
package/dist/plugins.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./
|
|
1
|
+
import "./logger-s1ImI5j1.mjs";
|
|
2
|
+
import "./config-DlCfPR2i.mjs";
|
|
3
|
+
import { a as WatchPlugin, c as NodeProtocolPlugin, l as ExternalPlugin, o as ShebangPlugin, s as ReportPlugin } from "./src-DrqLE2Pt.mjs";
|
|
3
4
|
|
|
4
5
|
export { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin, WatchPlugin };
|