@voidzero-dev/vite-plus-core 0.0.0-0bfcc90f.20260209-0731
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 +41 -0
- package/dist/pluginutils/filter/composable-filters.d.ts +90 -0
- package/dist/pluginutils/filter/composable-filters.js +256 -0
- package/dist/pluginutils/filter/filter-vite-plugins.d.ts +28 -0
- package/dist/pluginutils/filter/filter-vite-plugins.js +75 -0
- package/dist/pluginutils/filter/index.d.ts +3 -0
- package/dist/pluginutils/filter/index.js +3 -0
- package/dist/pluginutils/filter/simple-filters.d.ts +71 -0
- package/dist/pluginutils/filter/simple-filters.js +70 -0
- package/dist/pluginutils/index.d.ts +1 -0
- package/dist/pluginutils/index.js +1 -0
- package/dist/pluginutils/utils.d.ts +2 -0
- package/dist/pluginutils/utils.js +17 -0
- package/dist/rolldown/cli-setup.d.mts +1 -0
- package/dist/rolldown/cli-setup.mjs +17 -0
- package/dist/rolldown/cli.d.mts +1 -0
- package/dist/rolldown/cli.mjs +608 -0
- package/dist/rolldown/config.d.mts +7 -0
- package/dist/rolldown/config.mjs +10 -0
- package/dist/rolldown/experimental-index.d.mts +194 -0
- package/dist/rolldown/experimental-index.mjs +291 -0
- package/dist/rolldown/experimental-runtime-types.d.ts +98 -0
- package/dist/rolldown/filter-index.d.mts +197 -0
- package/dist/rolldown/filter-index.mjs +369 -0
- package/dist/rolldown/get-log-filter.d.mts +7 -0
- package/dist/rolldown/get-log-filter.mjs +47 -0
- package/dist/rolldown/index.d.mts +4 -0
- package/dist/rolldown/index.mjs +57 -0
- package/dist/rolldown/parallel-plugin-worker.d.mts +1 -0
- package/dist/rolldown/parallel-plugin-worker.mjs +32 -0
- package/dist/rolldown/parallel-plugin.d.mts +14 -0
- package/dist/rolldown/parallel-plugin.mjs +7 -0
- package/dist/rolldown/parse-ast-index.d.mts +8 -0
- package/dist/rolldown/parse-ast-index.mjs +47 -0
- package/dist/rolldown/plugins-index.d.mts +30 -0
- package/dist/rolldown/plugins-index.mjs +40 -0
- package/dist/rolldown/shared/binding-D-XMzSaG.d.mts +1665 -0
- package/dist/rolldown/shared/binding-DuOSzYPt.mjs +587 -0
- package/dist/rolldown/shared/bindingify-input-options-Bu6nUTgS.mjs +2257 -0
- package/dist/rolldown/shared/constructors-DZVRHTli.mjs +61 -0
- package/dist/rolldown/shared/constructors-KD7LvxpN.d.mts +28 -0
- package/dist/rolldown/shared/define-config-BVG4QvnP.mjs +7 -0
- package/dist/rolldown/shared/define-config-U4pj0ZDn.d.mts +3616 -0
- package/dist/rolldown/shared/load-config-O1K_tT_z.mjs +114 -0
- package/dist/rolldown/shared/logging-CE90D8JR.d.mts +50 -0
- package/dist/rolldown/shared/logs-NH298mHo.mjs +183 -0
- package/dist/rolldown/shared/misc-CCZIsXVO.mjs +22 -0
- package/dist/rolldown/shared/normalize-string-or-regex-DeZqg15i.mjs +61 -0
- package/dist/rolldown/shared/parse-DLraxqjd.mjs +56 -0
- package/dist/rolldown/shared/prompt-DeISmFRp.mjs +847 -0
- package/dist/rolldown/shared/rolldown-O0UKbTKf.mjs +42 -0
- package/dist/rolldown/shared/rolldown-build-BIs7C4B_.mjs +3354 -0
- package/dist/rolldown/shared/watch-DQXGaDjx.mjs +379 -0
- package/dist/tsdown/build-l5WhXg4M-BBPqZr0m.js +4933 -0
- package/dist/tsdown/chunk-CdeBBKNj.js +44 -0
- package/dist/tsdown/debug-Cb_Nqpo4-BueIRvg1.js +18 -0
- package/dist/tsdown/detect-CCATtVj7-B86m8IqW.js +165 -0
- package/dist/tsdown/dist-BUOkzr_P.js +201 -0
- package/dist/tsdown/dist-BVMGwPdF.js +32363 -0
- package/dist/tsdown/dist-dc0X0G6b.js +742 -0
- package/dist/tsdown/filename-7rlgePeo.js +31 -0
- package/dist/tsdown/index-node-BjDys8jy--sqPE5mM.js +251 -0
- package/dist/tsdown/index-types.d.ts +2163 -0
- package/dist/tsdown/index.js +14 -0
- package/dist/tsdown/main-d9yZSQqW.js +926 -0
- package/dist/tsdown/node-Cb5OsnKg.js +271 -0
- package/dist/tsdown/npm_cjs_chunk_chunk.cjs +11 -0
- package/dist/tsdown/npm_cjs_chunk_range.cjs +484 -0
- package/dist/tsdown/npm_cjs_chunk_semver.cjs +362 -0
- package/dist/tsdown/npm_entry_picomatch.cjs +1676 -0
- package/dist/tsdown/npm_entry_semver_functions_coerce.cjs +52 -0
- package/dist/tsdown/npm_entry_semver_functions_satisfies.cjs +23 -0
- package/dist/tsdown/npm_entry_semver_ranges_min-version.cjs +48 -0
- package/dist/tsdown/npm_entry_tree-kill.cjs +103 -0
- package/dist/tsdown/resolver-j7HY1N36-CIu_7LX6.js +20 -0
- package/dist/tsdown/run.js +537 -0
- package/dist/tsdown/tsc-context-BNYuT3cE.js +25 -0
- package/dist/tsdown/tsc-reo6aLWc.js +423 -0
- package/dist/vite/client/client.mjs +1140 -0
- package/dist/vite/client/env.mjs +19 -0
- package/dist/vite/client.d.ts +279 -0
- package/dist/vite/misc/false.d.ts +2 -0
- package/dist/vite/misc/false.js +1 -0
- package/dist/vite/misc/true.d.ts +2 -0
- package/dist/vite/misc/true.js +1 -0
- package/dist/vite/node/chunks/build2.js +5538 -0
- package/dist/vite/node/chunks/chunk.js +45 -0
- package/dist/vite/node/chunks/dist.js +6758 -0
- package/dist/vite/node/chunks/dist2.js +6651 -0
- package/dist/vite/node/chunks/fetchableEnvironments.js +41395 -0
- package/dist/vite/node/chunks/lib.js +377 -0
- package/dist/vite/node/chunks/logger.js +332 -0
- package/dist/vite/node/chunks/moduleRunnerTransport.d.ts +96 -0
- package/dist/vite/node/chunks/postcss-import.js +479 -0
- package/dist/vite/node/cli.js +699 -0
- package/dist/vite/node/index.d.ts +3807 -0
- package/dist/vite/node/index.js +15 -0
- package/dist/vite/node/internal.d.ts +2 -0
- package/dist/vite/node/internal.js +3 -0
- package/dist/vite/node/module-runner.d.ts +311 -0
- package/dist/vite/node/module-runner.js +1159 -0
- package/dist/vite/types/customEvent.d.ts +52 -0
- package/dist/vite/types/hmrPayload.d.ts +80 -0
- package/dist/vite/types/hot.d.ts +39 -0
- package/dist/vite/types/import-meta.d.ts +5 -0
- package/dist/vite/types/importGlob.d.ts +89 -0
- package/dist/vite/types/importMeta.d.ts +30 -0
- package/dist/vite/types/internal/cssPreprocessorOptions.d.ts +44 -0
- package/dist/vite/types/internal/esbuildOptions.d.ts +28 -0
- package/dist/vite/types/internal/lightningcssOptions.d.ts +18 -0
- package/dist/vite/types/internal/rollupTypeCompat.d.ts +24 -0
- package/dist/vite/types/internal/terserOptions.d.ts +11 -0
- package/dist/vite/types/metadata.d.ts +47 -0
- package/package.json +204 -0
|
@@ -0,0 +1,2163 @@
|
|
|
1
|
+
import * as Rolldown from "@voidzero-dev/vite-plus-core/rolldown";
|
|
2
|
+
import { BuildOptions, ChecksOptions, ExternalOption, InputOptions, InternalModuleFormat, MinifyOptions, ModuleFormat, ModuleTypes, OutputAsset, OutputChunk, OutputOptions, TreeshakingOptions } from "@voidzero-dev/vite-plus-core/rolldown";
|
|
3
|
+
import { IsolatedDeclarationsOptions } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/hookable@6.0.1/node_modules/hookable/dist/index.d.mts
|
|
6
|
+
//#region src/types.d.ts
|
|
7
|
+
type HookCallback = (...arguments_: any) => Promise<void> | void;
|
|
8
|
+
type HookKeys<T> = keyof T & string;
|
|
9
|
+
type DeprecatedHook<T> = {
|
|
10
|
+
message?: string;
|
|
11
|
+
to: HookKeys<T>;
|
|
12
|
+
};
|
|
13
|
+
type ValueOf<C> = C extends Record<any, any> ? C[keyof C] : never;
|
|
14
|
+
type Strings<T> = Exclude<keyof T, number | symbol>;
|
|
15
|
+
type KnownKeys<T> = keyof { [K in keyof T as string extends K ? never : number extends K ? never : K]: never };
|
|
16
|
+
type StripGeneric<T> = Pick<T, KnownKeys<T> extends keyof T ? KnownKeys<T> : never>;
|
|
17
|
+
type OnlyGeneric<T> = Omit<T, KnownKeys<T> extends keyof T ? KnownKeys<T> : never>;
|
|
18
|
+
type Namespaces<T> = ValueOf<{ [key in Strings<T>]: key extends `${infer Namespace}:${string}` ? Namespace : never }>;
|
|
19
|
+
type BareHooks<T> = ValueOf<{ [key in Strings<T>]: key extends `${string}:${string}` ? never : key }>;
|
|
20
|
+
type HooksInNamespace<T, Namespace extends string> = ValueOf<{ [key in Strings<T>]: key extends `${Namespace}:${infer HookName}` ? HookName : never }>;
|
|
21
|
+
type WithoutNamespace<T, Namespace extends string> = { [key in HooksInNamespace<T, Namespace>]: `${Namespace}:${key}` extends keyof T ? T[`${Namespace}:${key}`] : never };
|
|
22
|
+
type NestedHooks<T> = (Partial<StripGeneric<T>> | Partial<OnlyGeneric<T>>) & Partial<{ [key in Namespaces<StripGeneric<T>>]: NestedHooks<WithoutNamespace<T, key>> }> & Partial<{ [key in BareHooks<StripGeneric<T>>]: T[key] }>; //#endregion
|
|
23
|
+
//#region src/hookable.d.ts
|
|
24
|
+
type InferCallback<HT, HN extends keyof HT> = HT[HN] extends HookCallback ? HT[HN] : never;
|
|
25
|
+
type InferSpyEvent<HT extends Record<string, any>> = { [key in keyof HT]: {
|
|
26
|
+
name: key;
|
|
27
|
+
args: Parameters<HT[key]>;
|
|
28
|
+
context: Record<string, any>;
|
|
29
|
+
} }[keyof HT];
|
|
30
|
+
declare class Hookable<HooksT extends Record<string, any> = Record<string, HookCallback>, HookNameT extends HookKeys<HooksT> = HookKeys<HooksT>> {
|
|
31
|
+
private _hooks;
|
|
32
|
+
private _before?;
|
|
33
|
+
private _after?;
|
|
34
|
+
private _deprecatedHooks;
|
|
35
|
+
private _deprecatedMessages?;
|
|
36
|
+
constructor();
|
|
37
|
+
hook<NameT extends HookNameT>(name: NameT, function_: InferCallback<HooksT, NameT>, options?: {
|
|
38
|
+
allowDeprecated?: boolean;
|
|
39
|
+
}): () => void;
|
|
40
|
+
hookOnce<NameT extends HookNameT>(name: NameT, function_: InferCallback<HooksT, NameT>): () => void;
|
|
41
|
+
removeHook<NameT extends HookNameT>(name: NameT, function_: InferCallback<HooksT, NameT>): void;
|
|
42
|
+
deprecateHook<NameT extends HookNameT>(name: NameT, deprecated: HookKeys<HooksT> | DeprecatedHook<HooksT>): void;
|
|
43
|
+
deprecateHooks(deprecatedHooks: Partial<Record<HookNameT, DeprecatedHook<HooksT>>>): void;
|
|
44
|
+
addHooks(configHooks: NestedHooks<HooksT>): () => void;
|
|
45
|
+
removeHooks(configHooks: NestedHooks<HooksT>): void;
|
|
46
|
+
removeAllHooks(): void;
|
|
47
|
+
callHook<NameT extends HookNameT>(name: NameT, ...args: Parameters<InferCallback<HooksT, NameT>>): Promise<any> | void;
|
|
48
|
+
callHookParallel<NameT extends HookNameT>(name: NameT, ...args: Parameters<InferCallback<HooksT, NameT>>): Promise<any[]> | void;
|
|
49
|
+
callHookWith<NameT extends HookNameT, CallFunction extends (hooks: HookCallback[], args: Parameters<InferCallback<HooksT, NameT>>, name: NameT) => any>(caller: CallFunction, name: NameT, args: Parameters<InferCallback<HooksT, NameT>>): ReturnType<CallFunction>;
|
|
50
|
+
beforeEach(function_: (event: InferSpyEvent<HooksT>) => void): () => void;
|
|
51
|
+
afterEach(function_: (event: InferSpyEvent<HooksT>) => void): () => void;
|
|
52
|
+
}
|
|
53
|
+
type CreateTask = (name?: string) => {
|
|
54
|
+
run: (function_: () => Promise<any> | any) => Promise<any> | any;
|
|
55
|
+
};
|
|
56
|
+
declare global {
|
|
57
|
+
interface Console {
|
|
58
|
+
createTask?: CreateTask;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** @deprecated */
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region ../../node_modules/.pnpm/get-tsconfig@4.13.1/node_modules/get-tsconfig/dist/index.d.cts
|
|
64
|
+
declare namespace TsConfigJson {
|
|
65
|
+
namespace CompilerOptions {
|
|
66
|
+
type JSX = 'preserve' | 'react' | 'react-jsx' | 'react-jsxdev' | 'react-native';
|
|
67
|
+
type Module = 'CommonJS' | 'AMD' | 'System' | 'UMD' | 'ES6' | 'ES2015' | 'ES2020' | 'ES2022' | 'ESNext' | 'Node16' | 'Node18' | 'Node20' | 'NodeNext' | 'Preserve' | 'None' // Lowercase alternatives
|
|
68
|
+
| 'commonjs' | 'amd' | 'system' | 'umd' | 'es6' | 'es2015' | 'es2020' | 'es2022' | 'esnext' | 'node16' | 'node18' | 'node20' | 'nodenext' | 'preserve' | 'none';
|
|
69
|
+
type NewLine = 'CRLF' | 'LF' // Lowercase alternatives
|
|
70
|
+
| 'crlf' | 'lf';
|
|
71
|
+
type Target = 'ES3' | 'ES5' | 'ES6' | 'ES2015' | 'ES2016' | 'ES2017' | 'ES2018' | 'ES2019' | 'ES2020' | 'ES2021' | 'ES2022' | 'ES2023' | 'ES2024' | 'ESNext' // Lowercase alternatives
|
|
72
|
+
| 'es3' | 'es5' | 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'es2023' | 'es2024' | 'esnext';
|
|
73
|
+
type Lib = 'ES5' | 'ES6' | 'ES7' | 'ES2015' | 'ES2015.Collection' | 'ES2015.Core' | 'ES2015.Generator' | 'ES2015.Iterable' | 'ES2015.Promise' | 'ES2015.Proxy' | 'ES2015.Reflect' | 'ES2015.Symbol.WellKnown' | 'ES2015.Symbol' | 'ES2016' | 'ES2016.Array.Include' | 'ES2017' | 'ES2017.ArrayBuffer' | 'ES2017.Date' | 'ES2017.Intl' | 'ES2017.Object' | 'ES2017.SharedMemory' | 'ES2017.String' | 'ES2017.TypedArrays' | 'ES2018' | 'ES2018.AsyncGenerator' | 'ES2018.AsyncIterable' | 'ES2018.Intl' | 'ES2018.Promise' | 'ES2018.Regexp' | 'ES2019' | 'ES2019.Array' | 'ES2019.Intl' | 'ES2019.Object' | 'ES2019.String' | 'ES2019.Symbol' | 'ES2020' | 'ES2020.BigInt' | 'ES2020.Date' | 'ES2020.Intl' | 'ES2020.Number' | 'ES2020.Promise' | 'ES2020.SharedMemory' | 'ES2020.String' | 'ES2020.Symbol.WellKnown' | 'ES2021' | 'ES2021.Intl' | 'ES2021.Promise' | 'ES2021.String' | 'ES2021.WeakRef' | 'ES2022' | 'ES2022.Array' | 'ES2022.Error' | 'ES2022.Intl' | 'ES2022.Object' | 'ES2022.RegExp' | 'ES2022.SharedMemory' | 'ES2022.String' | 'ES2023' | 'ES2023.Array' | 'ES2023.Collection' | 'ES2023.Intl' | 'ES2024' | 'ES2024.ArrayBuffer' | 'ES2024.Collection' | 'ES2024.Object' | 'ES2024.Promise' | 'ES2024.Regexp' | 'ES2024.SharedMemory' | 'ES2024.String' | 'ESNext' | 'ESNext.Array' | 'ESNext.AsyncIterable' | 'ESNext.BigInt' | 'ESNext.Collection' | 'ESNext.Decorators' | 'ESNext.Disposable' | 'ESNext.Error' | 'ESNext.Intl' | 'ESNext.Iterator' | 'ESNext.Object' | 'ESNext.Promise' | 'ESNext.Regexp' | 'ESNext.String' | 'ESNext.Symbol' | 'ESNext.WeakRef' | 'DOM' | 'DOM.AsyncIterable' | 'DOM.Iterable' | 'Decorators' | 'Decorators.Legacy' | 'ScriptHost' | 'WebWorker' | 'WebWorker.AsyncIterable' | 'WebWorker.ImportScripts' | 'WebWorker.Iterable' // Lowercase alternatives
|
|
74
|
+
| 'es5' | 'es6' | 'es7' | 'es2015' | 'es2015.collection' | 'es2015.core' | 'es2015.generator' | 'es2015.iterable' | 'es2015.promise' | 'es2015.proxy' | 'es2015.reflect' | 'es2015.symbol.wellknown' | 'es2015.symbol' | 'es2016' | 'es2016.array.include' | 'es2017' | 'es2017.arraybuffer' | 'es2017.date' | 'es2017.intl' | 'es2017.object' | 'es2017.sharedmemory' | 'es2017.string' | 'es2017.typedarrays' | 'es2018' | 'es2018.asyncgenerator' | 'es2018.asynciterable' | 'es2018.intl' | 'es2018.promise' | 'es2018.regexp' | 'es2019' | 'es2019.array' | 'es2019.intl' | 'es2019.object' | 'es2019.string' | 'es2019.symbol' | 'es2020' | 'es2020.bigint' | 'es2020.date' | 'es2020.intl' | 'es2020.number' | 'es2020.promise' | 'es2020.sharedmemory' | 'es2020.string' | 'es2020.symbol.wellknown' | 'es2021' | 'es2021.intl' | 'es2021.promise' | 'es2021.string' | 'es2021.weakref' | 'es2022' | 'es2022.array' | 'es2022.error' | 'es2022.intl' | 'es2022.object' | 'es2022.regexp' | 'es2022.sharedmemory' | 'es2022.string' | 'es2023' | 'es2023.array' | 'es2023.collection' | 'es2023.intl' | 'es2024' | 'es2024.arraybuffer' | 'es2024.collection' | 'es2024.object' | 'es2024.promise' | 'es2024.regexp' | 'es2024.sharedmemory' | 'es2024.string' | 'esnext' | 'esnext.array' | 'esnext.asynciterable' | 'esnext.bigint' | 'esnext.collection' | 'esnext.decorators' | 'esnext.disposable' | 'esnext.error' | 'esnext.intl' | 'esnext.iterator' | 'esnext.object' | 'esnext.promise' | 'esnext.regexp' | 'esnext.string' | 'esnext.symbol' | 'esnext.weakref' | 'dom' | 'dom.asynciterable' | 'dom.iterable' | 'decorators' | 'decorators.legacy' | 'scripthost' | 'webworker' | 'webworker.asynciterable' | 'webworker.importscripts' | 'webworker.iterable';
|
|
75
|
+
type Plugin = {
|
|
76
|
+
/**
|
|
77
|
+
Plugin name.
|
|
78
|
+
*/
|
|
79
|
+
name: string;
|
|
80
|
+
};
|
|
81
|
+
type ImportsNotUsedAsValues = 'remove' | 'preserve' | 'error';
|
|
82
|
+
type FallbackPolling = 'fixedPollingInterval' | 'priorityPollingInterval' | 'dynamicPriorityPolling' | 'fixedInterval' | 'priorityInterval' | 'dynamicPriority' | 'fixedChunkSize';
|
|
83
|
+
type WatchDirectory = 'useFsEvents' | 'fixedPollingInterval' | 'dynamicPriorityPolling' | 'fixedChunkSizePolling';
|
|
84
|
+
type WatchFile = 'fixedPollingInterval' | 'priorityPollingInterval' | 'dynamicPriorityPolling' | 'useFsEvents' | 'useFsEventsOnParentDirectory' | 'fixedChunkSizePolling';
|
|
85
|
+
type ModuleResolution = 'classic' | 'node' | 'node10' | 'node16' | 'nodenext' | 'bundler' // Pascal-cased alternatives
|
|
86
|
+
| 'Classic' | 'Node' | 'Node10' | 'Node16' | 'NodeNext' | 'Bundler';
|
|
87
|
+
type ModuleDetection = 'auto' | 'legacy' | 'force';
|
|
88
|
+
type IgnoreDeprecations = '5.0';
|
|
89
|
+
}
|
|
90
|
+
type CompilerOptions = {
|
|
91
|
+
/**
|
|
92
|
+
The character set of the input files.
|
|
93
|
+
@default 'utf8'
|
|
94
|
+
@deprecated This option will be removed in TypeScript 5.5.
|
|
95
|
+
*/
|
|
96
|
+
charset?: string;
|
|
97
|
+
/**
|
|
98
|
+
Enables building for project references.
|
|
99
|
+
@default true
|
|
100
|
+
*/
|
|
101
|
+
composite?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
Generates corresponding d.ts files.
|
|
104
|
+
@default false
|
|
105
|
+
*/
|
|
106
|
+
declaration?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
Specify output directory for generated declaration files.
|
|
109
|
+
*/
|
|
110
|
+
declarationDir?: string;
|
|
111
|
+
/**
|
|
112
|
+
Show diagnostic information.
|
|
113
|
+
@default false
|
|
114
|
+
*/
|
|
115
|
+
diagnostics?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
Reduce the number of projects loaded automatically by TypeScript.
|
|
118
|
+
@default false
|
|
119
|
+
*/
|
|
120
|
+
disableReferencedProjectLoad?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
Enforces using indexed accessors for keys declared using an indexed type.
|
|
123
|
+
@default false
|
|
124
|
+
*/
|
|
125
|
+
noPropertyAccessFromIndexSignature?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.
|
|
128
|
+
@default false
|
|
129
|
+
*/
|
|
130
|
+
emitBOM?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
Only emit `.d.ts` declaration files.
|
|
133
|
+
@default false
|
|
134
|
+
*/
|
|
135
|
+
emitDeclarationOnly?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
Differentiate between undefined and not present when type checking.
|
|
138
|
+
@default false
|
|
139
|
+
*/
|
|
140
|
+
exactOptionalPropertyTypes?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
Enable incremental compilation.
|
|
143
|
+
@default `composite`
|
|
144
|
+
*/
|
|
145
|
+
incremental?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
Specify file to store incremental compilation information.
|
|
148
|
+
@default '.tsbuildinfo'
|
|
149
|
+
*/
|
|
150
|
+
tsBuildInfoFile?: string;
|
|
151
|
+
/**
|
|
152
|
+
Emit a single file with source maps instead of having a separate file.
|
|
153
|
+
@default false
|
|
154
|
+
*/
|
|
155
|
+
inlineSourceMap?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
Emit the source alongside the sourcemaps within a single file.
|
|
158
|
+
Requires `--inlineSourceMap` to be set.
|
|
159
|
+
@default false
|
|
160
|
+
*/
|
|
161
|
+
inlineSources?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
Specify what JSX code is generated.
|
|
164
|
+
@default 'preserve'
|
|
165
|
+
*/
|
|
166
|
+
jsx?: CompilerOptions.JSX;
|
|
167
|
+
/**
|
|
168
|
+
Specifies the object invoked for `createElement` and `__spread` when targeting `'react'` JSX emit.
|
|
169
|
+
@default 'React'
|
|
170
|
+
*/
|
|
171
|
+
reactNamespace?: string;
|
|
172
|
+
/**
|
|
173
|
+
Specify the JSX factory function to use when targeting React JSX emit, e.g. `React.createElement` or `h`.
|
|
174
|
+
@default 'React.createElement'
|
|
175
|
+
*/
|
|
176
|
+
jsxFactory?: string;
|
|
177
|
+
/**
|
|
178
|
+
Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.
|
|
179
|
+
@default 'React.Fragment'
|
|
180
|
+
*/
|
|
181
|
+
jsxFragmentFactory?: string;
|
|
182
|
+
/**
|
|
183
|
+
Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.
|
|
184
|
+
@default 'react'
|
|
185
|
+
*/
|
|
186
|
+
jsxImportSource?: string;
|
|
187
|
+
/**
|
|
188
|
+
Print names of files part of the compilation.
|
|
189
|
+
@default false
|
|
190
|
+
*/
|
|
191
|
+
listFiles?: boolean;
|
|
192
|
+
/**
|
|
193
|
+
Specifies the location where debugger should locate map files instead of generated locations.
|
|
194
|
+
*/
|
|
195
|
+
mapRoot?: string;
|
|
196
|
+
/**
|
|
197
|
+
Specify module code generation: 'None', 'CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015' or 'ESNext'. Only 'AMD' and 'System' can be used in conjunction with `--outFile`. 'ES6' and 'ES2015' values may be used when targeting 'ES5' or lower.
|
|
198
|
+
@default ['ES3', 'ES5'].includes(target) ? 'CommonJS' : 'ES6'
|
|
199
|
+
*/
|
|
200
|
+
module?: CompilerOptions.Module;
|
|
201
|
+
/**
|
|
202
|
+
Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6).
|
|
203
|
+
@default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node'
|
|
204
|
+
*/
|
|
205
|
+
moduleResolution?: CompilerOptions.ModuleResolution;
|
|
206
|
+
/**
|
|
207
|
+
Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix).
|
|
208
|
+
@default 'LF'
|
|
209
|
+
*/
|
|
210
|
+
newLine?: CompilerOptions.NewLine;
|
|
211
|
+
/**
|
|
212
|
+
Disable full type checking (only critical parse and emit errors will be reported).
|
|
213
|
+
@default false
|
|
214
|
+
*/
|
|
215
|
+
noCheck?: boolean;
|
|
216
|
+
/**
|
|
217
|
+
Do not emit output.
|
|
218
|
+
@default false
|
|
219
|
+
*/
|
|
220
|
+
noEmit?: boolean;
|
|
221
|
+
/**
|
|
222
|
+
Do not generate custom helper functions like `__extends` in compiled output.
|
|
223
|
+
@default false
|
|
224
|
+
*/
|
|
225
|
+
noEmitHelpers?: boolean;
|
|
226
|
+
/**
|
|
227
|
+
Do not emit outputs if any type checking errors were reported.
|
|
228
|
+
@default false
|
|
229
|
+
*/
|
|
230
|
+
noEmitOnError?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
Warn on expressions and declarations with an implied 'any' type.
|
|
233
|
+
@default false
|
|
234
|
+
*/
|
|
235
|
+
noImplicitAny?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
Raise error on 'this' expressions with an implied any type.
|
|
238
|
+
@default false
|
|
239
|
+
*/
|
|
240
|
+
noImplicitThis?: boolean;
|
|
241
|
+
/**
|
|
242
|
+
Report errors on unused locals.
|
|
243
|
+
@default false
|
|
244
|
+
*/
|
|
245
|
+
noUnusedLocals?: boolean;
|
|
246
|
+
/**
|
|
247
|
+
Report errors on unused parameters.
|
|
248
|
+
@default false
|
|
249
|
+
*/
|
|
250
|
+
noUnusedParameters?: boolean;
|
|
251
|
+
/**
|
|
252
|
+
Do not include the default library file (lib.d.ts).
|
|
253
|
+
@default false
|
|
254
|
+
*/
|
|
255
|
+
noLib?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
Do not add triple-slash references or module import targets to the list of compiled files.
|
|
258
|
+
@default false
|
|
259
|
+
*/
|
|
260
|
+
noResolve?: boolean;
|
|
261
|
+
/**
|
|
262
|
+
Disable strict checking of generic signatures in function types.
|
|
263
|
+
@default false
|
|
264
|
+
@deprecated This option will be removed in TypeScript 5.5.
|
|
265
|
+
*/
|
|
266
|
+
noStrictGenericChecks?: boolean;
|
|
267
|
+
/**
|
|
268
|
+
@deprecated use `skipLibCheck` instead.
|
|
269
|
+
*/
|
|
270
|
+
skipDefaultLibCheck?: boolean;
|
|
271
|
+
/**
|
|
272
|
+
Skip type checking of declaration files.
|
|
273
|
+
@default false
|
|
274
|
+
*/
|
|
275
|
+
skipLibCheck?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
Concatenate and emit output to single file.
|
|
278
|
+
*/
|
|
279
|
+
outFile?: string;
|
|
280
|
+
/**
|
|
281
|
+
Redirect output structure to the directory.
|
|
282
|
+
*/
|
|
283
|
+
outDir?: string;
|
|
284
|
+
/**
|
|
285
|
+
Do not erase const enum declarations in generated code.
|
|
286
|
+
@default false
|
|
287
|
+
*/
|
|
288
|
+
preserveConstEnums?: boolean;
|
|
289
|
+
/**
|
|
290
|
+
Do not resolve symlinks to their real path; treat a symlinked file like a real one.
|
|
291
|
+
@default false
|
|
292
|
+
*/
|
|
293
|
+
preserveSymlinks?: boolean;
|
|
294
|
+
/**
|
|
295
|
+
Keep outdated console output in watch mode instead of clearing the screen.
|
|
296
|
+
@default false
|
|
297
|
+
*/
|
|
298
|
+
preserveWatchOutput?: boolean;
|
|
299
|
+
/**
|
|
300
|
+
Stylize errors and messages using color and context (experimental).
|
|
301
|
+
@default true // Unless piping to another program or redirecting output to a file.
|
|
302
|
+
*/
|
|
303
|
+
pretty?: boolean;
|
|
304
|
+
/**
|
|
305
|
+
Do not emit comments to output.
|
|
306
|
+
@default false
|
|
307
|
+
*/
|
|
308
|
+
removeComments?: boolean;
|
|
309
|
+
/**
|
|
310
|
+
Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files.
|
|
311
|
+
@default false
|
|
312
|
+
*/
|
|
313
|
+
rewriteRelativeImportExtensions?: boolean;
|
|
314
|
+
/**
|
|
315
|
+
Specifies the root directory of input files.
|
|
316
|
+
Use to control the output directory structure with `--outDir`.
|
|
317
|
+
*/
|
|
318
|
+
rootDir?: string;
|
|
319
|
+
/**
|
|
320
|
+
Unconditionally emit imports for unresolved files.
|
|
321
|
+
@default false
|
|
322
|
+
*/
|
|
323
|
+
isolatedModules?: boolean;
|
|
324
|
+
/**
|
|
325
|
+
Require sufficient annotation on exports so other tools can trivially generate declaration files.
|
|
326
|
+
@default false
|
|
327
|
+
*/
|
|
328
|
+
isolatedDeclarations?: boolean;
|
|
329
|
+
/**
|
|
330
|
+
Generates corresponding '.map' file.
|
|
331
|
+
@default false
|
|
332
|
+
*/
|
|
333
|
+
sourceMap?: boolean;
|
|
334
|
+
/**
|
|
335
|
+
Specifies the location where debugger should locate TypeScript files instead of source locations.
|
|
336
|
+
*/
|
|
337
|
+
sourceRoot?: string;
|
|
338
|
+
/**
|
|
339
|
+
Suppress excess property checks for object literals.
|
|
340
|
+
@default false
|
|
341
|
+
@deprecated This option will be removed in TypeScript 5.5.
|
|
342
|
+
*/
|
|
343
|
+
suppressExcessPropertyErrors?: boolean;
|
|
344
|
+
/**
|
|
345
|
+
Suppress noImplicitAny errors for indexing objects lacking index signatures.
|
|
346
|
+
@default false
|
|
347
|
+
@deprecated This option will be removed in TypeScript 5.5.
|
|
348
|
+
*/
|
|
349
|
+
suppressImplicitAnyIndexErrors?: boolean;
|
|
350
|
+
/**
|
|
351
|
+
Do not emit declarations for code that has an `@internal` annotation.
|
|
352
|
+
*/
|
|
353
|
+
stripInternal?: boolean;
|
|
354
|
+
/**
|
|
355
|
+
Specify ECMAScript target version.
|
|
356
|
+
@default 'es3'
|
|
357
|
+
*/
|
|
358
|
+
target?: CompilerOptions.Target;
|
|
359
|
+
/**
|
|
360
|
+
Default catch clause variables as `unknown` instead of `any`.
|
|
361
|
+
@default false
|
|
362
|
+
*/
|
|
363
|
+
useUnknownInCatchVariables?: boolean;
|
|
364
|
+
/**
|
|
365
|
+
Watch input files.
|
|
366
|
+
@default false
|
|
367
|
+
@deprecated Use watchOptions instead.
|
|
368
|
+
*/
|
|
369
|
+
watch?: boolean;
|
|
370
|
+
/**
|
|
371
|
+
Specify the polling strategy to use when the system runs out of or doesn't support native file watchers.
|
|
372
|
+
@deprecated Use watchOptions.fallbackPolling instead.
|
|
373
|
+
*/
|
|
374
|
+
fallbackPolling?: CompilerOptions.FallbackPolling;
|
|
375
|
+
/**
|
|
376
|
+
Specify the strategy for watching directories under systems that lack recursive file-watching functionality.
|
|
377
|
+
@default 'useFsEvents'
|
|
378
|
+
@deprecated Use watchOptions.watchDirectory instead.
|
|
379
|
+
*/
|
|
380
|
+
watchDirectory?: CompilerOptions.WatchDirectory;
|
|
381
|
+
/**
|
|
382
|
+
Specify the strategy for watching individual files.
|
|
383
|
+
@default 'useFsEvents'
|
|
384
|
+
@deprecated Use watchOptions.watchFile instead.
|
|
385
|
+
*/
|
|
386
|
+
watchFile?: CompilerOptions.WatchFile;
|
|
387
|
+
/**
|
|
388
|
+
Enables experimental support for ES7 decorators.
|
|
389
|
+
@default false
|
|
390
|
+
*/
|
|
391
|
+
experimentalDecorators?: boolean;
|
|
392
|
+
/**
|
|
393
|
+
Emit design-type metadata for decorated declarations in source.
|
|
394
|
+
@default false
|
|
395
|
+
*/
|
|
396
|
+
emitDecoratorMetadata?: boolean;
|
|
397
|
+
/**
|
|
398
|
+
Do not report errors on unused labels.
|
|
399
|
+
@default false
|
|
400
|
+
*/
|
|
401
|
+
allowUnusedLabels?: boolean;
|
|
402
|
+
/**
|
|
403
|
+
Report error when not all code paths in function return a value.
|
|
404
|
+
@default false
|
|
405
|
+
*/
|
|
406
|
+
noImplicitReturns?: boolean;
|
|
407
|
+
/**
|
|
408
|
+
Add `undefined` to a type when accessed using an index.
|
|
409
|
+
@default false
|
|
410
|
+
*/
|
|
411
|
+
noUncheckedIndexedAccess?: boolean;
|
|
412
|
+
/**
|
|
413
|
+
Report error if failed to find a source file for a side effect import.
|
|
414
|
+
@default false
|
|
415
|
+
*/
|
|
416
|
+
noUncheckedSideEffectImports?: boolean;
|
|
417
|
+
/**
|
|
418
|
+
Report errors for fallthrough cases in switch statement.
|
|
419
|
+
@default false
|
|
420
|
+
*/
|
|
421
|
+
noFallthroughCasesInSwitch?: boolean;
|
|
422
|
+
/**
|
|
423
|
+
Ensure overriding members in derived classes are marked with an override modifier.
|
|
424
|
+
@default false
|
|
425
|
+
*/
|
|
426
|
+
noImplicitOverride?: boolean;
|
|
427
|
+
/**
|
|
428
|
+
Do not report errors on unreachable code.
|
|
429
|
+
@default false
|
|
430
|
+
*/
|
|
431
|
+
allowUnreachableCode?: boolean;
|
|
432
|
+
/**
|
|
433
|
+
Disallow inconsistently-cased references to the same file.
|
|
434
|
+
@default true
|
|
435
|
+
*/
|
|
436
|
+
forceConsistentCasingInFileNames?: boolean;
|
|
437
|
+
/**
|
|
438
|
+
Emit a v8 CPU profile of the compiler run for debugging.
|
|
439
|
+
@default 'profile.cpuprofile'
|
|
440
|
+
*/
|
|
441
|
+
generateCpuProfile?: string;
|
|
442
|
+
/**
|
|
443
|
+
Generates an event trace and a list of types.
|
|
444
|
+
*/
|
|
445
|
+
generateTrace?: boolean;
|
|
446
|
+
/**
|
|
447
|
+
Base directory to resolve non-relative module names.
|
|
448
|
+
*/
|
|
449
|
+
baseUrl?: string;
|
|
450
|
+
/**
|
|
451
|
+
Specify path mapping to be computed relative to baseUrl option.
|
|
452
|
+
*/
|
|
453
|
+
paths?: Record<string, string[]>;
|
|
454
|
+
/**
|
|
455
|
+
List of TypeScript language server plugins to load.
|
|
456
|
+
*/
|
|
457
|
+
plugins?: CompilerOptions.Plugin[];
|
|
458
|
+
/**
|
|
459
|
+
Specify list of root directories to be used when resolving modules.
|
|
460
|
+
*/
|
|
461
|
+
rootDirs?: string[];
|
|
462
|
+
/**
|
|
463
|
+
Specify list of directories for type definition files to be included.
|
|
464
|
+
*/
|
|
465
|
+
typeRoots?: string[];
|
|
466
|
+
/**
|
|
467
|
+
Type declaration files to be included in compilation.
|
|
468
|
+
*/
|
|
469
|
+
types?: string[];
|
|
470
|
+
/**
|
|
471
|
+
Enable tracing of the name resolution process.
|
|
472
|
+
@default false
|
|
473
|
+
*/
|
|
474
|
+
traceResolution?: boolean;
|
|
475
|
+
/**
|
|
476
|
+
Allow javascript files to be compiled.
|
|
477
|
+
@default false
|
|
478
|
+
*/
|
|
479
|
+
allowJs?: boolean;
|
|
480
|
+
/**
|
|
481
|
+
Do not truncate error messages.
|
|
482
|
+
@default false
|
|
483
|
+
*/
|
|
484
|
+
noErrorTruncation?: boolean;
|
|
485
|
+
/**
|
|
486
|
+
Allow default imports from modules with no default export. This does not affect code emit, just typechecking.
|
|
487
|
+
@default module === 'system' || esModuleInterop
|
|
488
|
+
*/
|
|
489
|
+
allowSyntheticDefaultImports?: boolean;
|
|
490
|
+
/**
|
|
491
|
+
Do not emit `'use strict'` directives in module output.
|
|
492
|
+
@default false
|
|
493
|
+
@deprecated This option will be removed in TypeScript 5.5.
|
|
494
|
+
*/
|
|
495
|
+
noImplicitUseStrict?: boolean;
|
|
496
|
+
/**
|
|
497
|
+
Enable to list all emitted files.
|
|
498
|
+
@default false
|
|
499
|
+
*/
|
|
500
|
+
listEmittedFiles?: boolean;
|
|
501
|
+
/**
|
|
502
|
+
Disable size limit for JavaScript project.
|
|
503
|
+
@default false
|
|
504
|
+
*/
|
|
505
|
+
disableSizeLimit?: boolean;
|
|
506
|
+
/**
|
|
507
|
+
List of library files to be included in the compilation.
|
|
508
|
+
*/
|
|
509
|
+
lib?: CompilerOptions.Lib[];
|
|
510
|
+
/**
|
|
511
|
+
Enable strict null checks.
|
|
512
|
+
@default false
|
|
513
|
+
*/
|
|
514
|
+
strictNullChecks?: boolean;
|
|
515
|
+
/**
|
|
516
|
+
The maximum dependency depth to search under `node_modules` and load JavaScript files. Only applicable with `--allowJs`.
|
|
517
|
+
@default 0
|
|
518
|
+
*/
|
|
519
|
+
maxNodeModuleJsDepth?: number;
|
|
520
|
+
/**
|
|
521
|
+
Import emit helpers (e.g. `__extends`, `__rest`, etc..) from tslib.
|
|
522
|
+
@default false
|
|
523
|
+
*/
|
|
524
|
+
importHelpers?: boolean;
|
|
525
|
+
/**
|
|
526
|
+
Specify emit/checking behavior for imports that are only used for types.
|
|
527
|
+
@default 'remove'
|
|
528
|
+
@deprecated Use `verbatimModuleSyntax` instead.
|
|
529
|
+
*/
|
|
530
|
+
importsNotUsedAsValues?: CompilerOptions.ImportsNotUsedAsValues;
|
|
531
|
+
/**
|
|
532
|
+
Parse in strict mode and emit `'use strict'` for each source file.
|
|
533
|
+
@default false
|
|
534
|
+
*/
|
|
535
|
+
alwaysStrict?: boolean;
|
|
536
|
+
/**
|
|
537
|
+
Enable all strict type checking options.
|
|
538
|
+
@default false
|
|
539
|
+
*/
|
|
540
|
+
strict?: boolean;
|
|
541
|
+
/**
|
|
542
|
+
Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions.
|
|
543
|
+
@default false
|
|
544
|
+
*/
|
|
545
|
+
strictBindCallApply?: boolean;
|
|
546
|
+
/**
|
|
547
|
+
Provide full support for iterables in `for-of`, spread, and destructuring when targeting `ES5` or `ES3`.
|
|
548
|
+
@default false
|
|
549
|
+
*/
|
|
550
|
+
downlevelIteration?: boolean;
|
|
551
|
+
/**
|
|
552
|
+
Report errors in `.js` files.
|
|
553
|
+
@default false
|
|
554
|
+
*/
|
|
555
|
+
checkJs?: boolean;
|
|
556
|
+
/**
|
|
557
|
+
Built-in iterators are instantiated with a `TReturn` type of undefined instead of `any`.
|
|
558
|
+
@default false
|
|
559
|
+
*/
|
|
560
|
+
strictBuiltinIteratorReturn?: boolean;
|
|
561
|
+
/**
|
|
562
|
+
Disable bivariant parameter checking for function types.
|
|
563
|
+
@default false
|
|
564
|
+
*/
|
|
565
|
+
strictFunctionTypes?: boolean;
|
|
566
|
+
/**
|
|
567
|
+
Ensure non-undefined class properties are initialized in the constructor.
|
|
568
|
+
@default false
|
|
569
|
+
*/
|
|
570
|
+
strictPropertyInitialization?: boolean;
|
|
571
|
+
/**
|
|
572
|
+
Emit `__importStar` and `__importDefault` helpers for runtime Babel ecosystem compatibility and enable `--allowSyntheticDefaultImports` for typesystem compatibility.
|
|
573
|
+
@default false
|
|
574
|
+
*/
|
|
575
|
+
esModuleInterop?: boolean;
|
|
576
|
+
/**
|
|
577
|
+
Allow accessing UMD globals from modules.
|
|
578
|
+
@default false
|
|
579
|
+
*/
|
|
580
|
+
allowUmdGlobalAccess?: boolean;
|
|
581
|
+
/**
|
|
582
|
+
Resolve `keyof` to string valued property names only (no numbers or symbols).
|
|
583
|
+
@default false
|
|
584
|
+
@deprecated This option will be removed in TypeScript 5.5.
|
|
585
|
+
*/
|
|
586
|
+
keyofStringsOnly?: boolean;
|
|
587
|
+
/**
|
|
588
|
+
Emit ECMAScript standard class fields.
|
|
589
|
+
@default false
|
|
590
|
+
*/
|
|
591
|
+
useDefineForClassFields?: boolean;
|
|
592
|
+
/**
|
|
593
|
+
Generates a sourcemap for each corresponding `.d.ts` file.
|
|
594
|
+
@default false
|
|
595
|
+
*/
|
|
596
|
+
declarationMap?: boolean;
|
|
597
|
+
/**
|
|
598
|
+
Include modules imported with `.json` extension.
|
|
599
|
+
@default false
|
|
600
|
+
*/
|
|
601
|
+
resolveJsonModule?: boolean;
|
|
602
|
+
/**
|
|
603
|
+
Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it.
|
|
604
|
+
@default false
|
|
605
|
+
*/
|
|
606
|
+
assumeChangesOnlyAffectDirectDependencies?: boolean;
|
|
607
|
+
/**
|
|
608
|
+
Output more detailed compiler performance information after building.
|
|
609
|
+
@default false
|
|
610
|
+
*/
|
|
611
|
+
extendedDiagnostics?: boolean;
|
|
612
|
+
/**
|
|
613
|
+
Print names of files that are part of the compilation and then stop processing.
|
|
614
|
+
@default false
|
|
615
|
+
*/
|
|
616
|
+
listFilesOnly?: boolean;
|
|
617
|
+
/**
|
|
618
|
+
Disable preferring source files instead of declaration files when referencing composite projects.
|
|
619
|
+
@default true if composite, false otherwise
|
|
620
|
+
*/
|
|
621
|
+
disableSourceOfProjectReferenceRedirect?: boolean;
|
|
622
|
+
/**
|
|
623
|
+
Opt a project out of multi-project reference checking when editing.
|
|
624
|
+
@default false
|
|
625
|
+
*/
|
|
626
|
+
disableSolutionSearching?: boolean;
|
|
627
|
+
/**
|
|
628
|
+
Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation.
|
|
629
|
+
@default false
|
|
630
|
+
*/
|
|
631
|
+
explainFiles?: boolean;
|
|
632
|
+
/**
|
|
633
|
+
Preserve unused imported values in the JavaScript output that would otherwise be removed.
|
|
634
|
+
@default true
|
|
635
|
+
@deprecated Use `verbatimModuleSyntax` instead.
|
|
636
|
+
*/
|
|
637
|
+
preserveValueImports?: boolean;
|
|
638
|
+
/**
|
|
639
|
+
List of file name suffixes to search when resolving a module.
|
|
640
|
+
*/
|
|
641
|
+
moduleSuffixes?: string[];
|
|
642
|
+
/**
|
|
643
|
+
Control what method is used to detect module-format JS files.
|
|
644
|
+
@default 'auto'
|
|
645
|
+
*/
|
|
646
|
+
moduleDetection?: CompilerOptions.ModuleDetection;
|
|
647
|
+
/**
|
|
648
|
+
Allows TypeScript files to import each other with a TypeScript-specific extension like .ts, .mts, or .tsx.
|
|
649
|
+
@default false
|
|
650
|
+
*/
|
|
651
|
+
allowImportingTsExtensions?: boolean;
|
|
652
|
+
/**
|
|
653
|
+
Forces TypeScript to consult the exports field of package.json files if it ever reads from a package in node_modules.
|
|
654
|
+
@default false
|
|
655
|
+
*/
|
|
656
|
+
resolvePackageJsonExports?: boolean;
|
|
657
|
+
/**
|
|
658
|
+
Forces TypeScript to consult the imports field of package.json files when performing a lookup that starts with # from a file whose ancestor directory contains a package.json.
|
|
659
|
+
@default false
|
|
660
|
+
*/
|
|
661
|
+
resolvePackageJsonImports?: boolean;
|
|
662
|
+
/**
|
|
663
|
+
Suppress errors for file formats that TypeScript does not understand.
|
|
664
|
+
@default false
|
|
665
|
+
*/
|
|
666
|
+
allowArbitraryExtensions?: boolean;
|
|
667
|
+
/**
|
|
668
|
+
List of additional conditions that should succeed when TypeScript resolves from package.json.
|
|
669
|
+
*/
|
|
670
|
+
customConditions?: string[];
|
|
671
|
+
/**
|
|
672
|
+
Anything that uses the type modifier is dropped entirely.
|
|
673
|
+
@default false
|
|
674
|
+
*/
|
|
675
|
+
verbatimModuleSyntax?: boolean;
|
|
676
|
+
/**
|
|
677
|
+
Suppress deprecation warnings
|
|
678
|
+
*/
|
|
679
|
+
ignoreDeprecations?: CompilerOptions.IgnoreDeprecations;
|
|
680
|
+
/**
|
|
681
|
+
Do not allow runtime constructs that are not part of ECMAScript.
|
|
682
|
+
@default false
|
|
683
|
+
*/
|
|
684
|
+
erasableSyntaxOnly?: boolean;
|
|
685
|
+
/**
|
|
686
|
+
Enable lib replacement.
|
|
687
|
+
@default true
|
|
688
|
+
*/
|
|
689
|
+
libReplacement?: boolean;
|
|
690
|
+
};
|
|
691
|
+
namespace WatchOptions {
|
|
692
|
+
type WatchFileKind = 'FixedPollingInterval' | 'PriorityPollingInterval' | 'DynamicPriorityPolling' | 'FixedChunkSizePolling' | 'UseFsEvents' | 'UseFsEventsOnParentDirectory';
|
|
693
|
+
type WatchDirectoryKind = 'UseFsEvents' | 'FixedPollingInterval' | 'DynamicPriorityPolling' | 'FixedChunkSizePolling';
|
|
694
|
+
type PollingWatchKind = 'FixedInterval' | 'PriorityInterval' | 'DynamicPriority' | 'FixedChunkSize';
|
|
695
|
+
}
|
|
696
|
+
type WatchOptions = {
|
|
697
|
+
/**
|
|
698
|
+
Specify the strategy for watching individual files.
|
|
699
|
+
@default 'UseFsEvents'
|
|
700
|
+
*/
|
|
701
|
+
watchFile?: WatchOptions.WatchFileKind | Lowercase<WatchOptions.WatchFileKind>;
|
|
702
|
+
/**
|
|
703
|
+
Specify the strategy for watching directories under systems that lack recursive file-watching functionality.
|
|
704
|
+
@default 'UseFsEvents'
|
|
705
|
+
*/
|
|
706
|
+
watchDirectory?: WatchOptions.WatchDirectoryKind | Lowercase<WatchOptions.WatchDirectoryKind>;
|
|
707
|
+
/**
|
|
708
|
+
Specify the polling strategy to use when the system runs out of or doesn't support native file watchers.
|
|
709
|
+
*/
|
|
710
|
+
fallbackPolling?: WatchOptions.PollingWatchKind | Lowercase<WatchOptions.PollingWatchKind>;
|
|
711
|
+
/**
|
|
712
|
+
Enable synchronous updates on directory watchers for platforms that don't support recursive watching natively.
|
|
713
|
+
*/
|
|
714
|
+
synchronousWatchDirectory?: boolean;
|
|
715
|
+
/**
|
|
716
|
+
Specifies a list of directories to exclude from watch.
|
|
717
|
+
*/
|
|
718
|
+
excludeDirectories?: string[];
|
|
719
|
+
/**
|
|
720
|
+
Specifies a list of files to exclude from watch.
|
|
721
|
+
*/
|
|
722
|
+
excludeFiles?: string[];
|
|
723
|
+
};
|
|
724
|
+
/**
|
|
725
|
+
Auto type (.d.ts) acquisition options for this project.
|
|
726
|
+
*/
|
|
727
|
+
type TypeAcquisition = {
|
|
728
|
+
/**
|
|
729
|
+
Enable auto type acquisition.
|
|
730
|
+
*/
|
|
731
|
+
enable?: boolean;
|
|
732
|
+
/**
|
|
733
|
+
Specifies a list of type declarations to be included in auto type acquisition. For example, `['jquery', 'lodash']`.
|
|
734
|
+
*/
|
|
735
|
+
include?: string[];
|
|
736
|
+
/**
|
|
737
|
+
Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`.
|
|
738
|
+
*/
|
|
739
|
+
exclude?: string[];
|
|
740
|
+
/**
|
|
741
|
+
Disable infering what types should be added based on filenames in a project.
|
|
742
|
+
*/
|
|
743
|
+
disableFilenameBasedTypeAcquisition?: boolean;
|
|
744
|
+
};
|
|
745
|
+
type References = {
|
|
746
|
+
/**
|
|
747
|
+
A normalized path on disk.
|
|
748
|
+
*/
|
|
749
|
+
path: string;
|
|
750
|
+
/**
|
|
751
|
+
The path as the user originally wrote it.
|
|
752
|
+
*/
|
|
753
|
+
originalPath?: string;
|
|
754
|
+
/**
|
|
755
|
+
True if the output of this reference should be prepended to the output of this project.
|
|
756
|
+
Only valid for `--outFile` compilations.
|
|
757
|
+
@deprecated This option will be removed in TypeScript 5.5.
|
|
758
|
+
*/
|
|
759
|
+
prepend?: boolean;
|
|
760
|
+
/**
|
|
761
|
+
True if it is intended that this reference form a circularity.
|
|
762
|
+
*/
|
|
763
|
+
circular?: boolean;
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7).
|
|
768
|
+
|
|
769
|
+
@category File
|
|
770
|
+
*/
|
|
771
|
+
type TsConfigJson = {
|
|
772
|
+
/**
|
|
773
|
+
Instructs the TypeScript compiler how to compile `.ts` files.
|
|
774
|
+
*/
|
|
775
|
+
compilerOptions?: TsConfigJson.CompilerOptions;
|
|
776
|
+
/**
|
|
777
|
+
Instructs the TypeScript compiler how to watch files.
|
|
778
|
+
*/
|
|
779
|
+
watchOptions?: TsConfigJson.WatchOptions;
|
|
780
|
+
/**
|
|
781
|
+
Auto type (.d.ts) acquisition options for this project.
|
|
782
|
+
*/
|
|
783
|
+
typeAcquisition?: TsConfigJson.TypeAcquisition;
|
|
784
|
+
/**
|
|
785
|
+
Enable Compile-on-Save for this project.
|
|
786
|
+
*/
|
|
787
|
+
compileOnSave?: boolean;
|
|
788
|
+
/**
|
|
789
|
+
Path to base configuration file to inherit from.
|
|
790
|
+
*/
|
|
791
|
+
extends?: string | string[];
|
|
792
|
+
/**
|
|
793
|
+
If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included.
|
|
794
|
+
*/
|
|
795
|
+
files?: string[];
|
|
796
|
+
/**
|
|
797
|
+
Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property.
|
|
798
|
+
Glob patterns require TypeScript version 2.0 or later.
|
|
799
|
+
*/
|
|
800
|
+
exclude?: string[];
|
|
801
|
+
/**
|
|
802
|
+
Specifies a list of glob patterns that match files to be included in compilation.
|
|
803
|
+
If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`.
|
|
804
|
+
*/
|
|
805
|
+
include?: string[];
|
|
806
|
+
/**
|
|
807
|
+
Referenced projects.
|
|
808
|
+
*/
|
|
809
|
+
references?: TsConfigJson.References[];
|
|
810
|
+
};
|
|
811
|
+
//#endregion
|
|
812
|
+
//#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.22.1_@typescript+native-preview@7.0.0-dev.20260122.2_oxc-resolver_d2e4a246ecba2d40b4415d1b79df8dc9/node_modules/rolldown-plugin-dts/dist/index.d.mts
|
|
813
|
+
//#region src/options.d.ts
|
|
814
|
+
interface GeneralOptions {
|
|
815
|
+
/**
|
|
816
|
+
* The directory in which the plugin will search for the `tsconfig.json` file.
|
|
817
|
+
*/
|
|
818
|
+
cwd?: string;
|
|
819
|
+
/**
|
|
820
|
+
* Set to `true` if your entry files are `.d.ts` files instead of `.ts` files.
|
|
821
|
+
*
|
|
822
|
+
* When enabled, the plugin will skip generating a `.d.ts` file for the entry point.
|
|
823
|
+
*/
|
|
824
|
+
dtsInput?: boolean;
|
|
825
|
+
/**
|
|
826
|
+
* If `true`, the plugin will emit only `.d.ts` files and remove all other output chunks.
|
|
827
|
+
*
|
|
828
|
+
* This is especially useful when generating `.d.ts` files for the CommonJS format as part of a separate build step.
|
|
829
|
+
*/
|
|
830
|
+
emitDtsOnly?: boolean;
|
|
831
|
+
/**
|
|
832
|
+
* The path to the `tsconfig.json` file.
|
|
833
|
+
*
|
|
834
|
+
* If set to `false`, the plugin will ignore any `tsconfig.json` file.
|
|
835
|
+
* You can still specify `compilerOptions` directly in the options.
|
|
836
|
+
*
|
|
837
|
+
* @default 'tsconfig.json'
|
|
838
|
+
*/
|
|
839
|
+
tsconfig?: string | boolean;
|
|
840
|
+
/**
|
|
841
|
+
* Pass a raw `tsconfig.json` object directly to the plugin.
|
|
842
|
+
*
|
|
843
|
+
* @see https://www.typescriptlang.org/tsconfig
|
|
844
|
+
*/
|
|
845
|
+
tsconfigRaw?: Omit<TsConfigJson, "compilerOptions">;
|
|
846
|
+
/**
|
|
847
|
+
* Override the `compilerOptions` specified in `tsconfig.json`.
|
|
848
|
+
*
|
|
849
|
+
* @see https://www.typescriptlang.org/tsconfig/#compilerOptions
|
|
850
|
+
*/
|
|
851
|
+
compilerOptions?: TsConfigJson.CompilerOptions;
|
|
852
|
+
/**
|
|
853
|
+
* If `true`, the plugin will generate declaration maps (`.d.ts.map`) for `.d.ts` files.
|
|
854
|
+
*/
|
|
855
|
+
sourcemap?: boolean;
|
|
856
|
+
/**
|
|
857
|
+
* Specifies a resolver to resolve type definitions, especially for `node_modules`.
|
|
858
|
+
*
|
|
859
|
+
* - `'oxc'`: Uses Oxc's module resolution, which is faster and more efficient.
|
|
860
|
+
* - `'tsc'`: Uses TypeScript's native module resolution, which may be more compatible with complex setups, but slower.
|
|
861
|
+
*
|
|
862
|
+
* @default 'oxc'
|
|
863
|
+
*/
|
|
864
|
+
resolver?: "oxc" | "tsc";
|
|
865
|
+
/**
|
|
866
|
+
* Determines how the default export is emitted.
|
|
867
|
+
*
|
|
868
|
+
* If set to `true`, and you are only exporting a single item using `export default ...`,
|
|
869
|
+
* the output will use `export = ...` instead of the standard ES module syntax.
|
|
870
|
+
* This is useful for compatibility with CommonJS.
|
|
871
|
+
*/
|
|
872
|
+
cjsDefault?: boolean;
|
|
873
|
+
/**
|
|
874
|
+
* Indicates whether the generated `.d.ts` files have side effects.
|
|
875
|
+
* - If set to `true`, Rolldown will treat the `.d.ts` files as having side effects during tree-shaking.
|
|
876
|
+
* - If set to `false`, Rolldown may consider the `.d.ts` files as side-effect-free, potentially removing them if they are not imported.
|
|
877
|
+
*
|
|
878
|
+
* @default false
|
|
879
|
+
*/
|
|
880
|
+
sideEffects?: boolean;
|
|
881
|
+
}
|
|
882
|
+
interface TscOptions {
|
|
883
|
+
/**
|
|
884
|
+
* Build mode for the TypeScript compiler:
|
|
885
|
+
*
|
|
886
|
+
* - 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.
|
|
887
|
+
* - 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.
|
|
888
|
+
*
|
|
889
|
+
* @default false
|
|
890
|
+
*/
|
|
891
|
+
build?: boolean;
|
|
892
|
+
/**
|
|
893
|
+
* If your tsconfig.json has
|
|
894
|
+
* [`references`](https://www.typescriptlang.org/tsconfig/#references) option,
|
|
895
|
+
* `rolldown-plugin-dts` will use [`tsc
|
|
896
|
+
* -b`](https://www.typescriptlang.org/docs/handbook/project-references.html#build-mode-for-typescript)
|
|
897
|
+
* to build the project and all referenced projects before emitting `.d.ts`
|
|
898
|
+
* files.
|
|
899
|
+
*
|
|
900
|
+
* In such case, if this option is `true`, `rolldown-plugin-dts` will write
|
|
901
|
+
* down all built files into your disk, including
|
|
902
|
+
* [`.tsbuildinfo`](https://www.typescriptlang.org/tsconfig/#tsBuildInfoFile)
|
|
903
|
+
* and other built files. This is equivalent to running `tsc -b` in your
|
|
904
|
+
* project.
|
|
905
|
+
*
|
|
906
|
+
* Otherwise, if this option is `false`, `rolldown-plugin-dts` will write
|
|
907
|
+
* built files only into memory and leave a small footprint in your disk.
|
|
908
|
+
*
|
|
909
|
+
* Enabling this option will decrease the build time by caching previous build
|
|
910
|
+
* results. This is helpful when you have a large project with multiple
|
|
911
|
+
* referenced projects.
|
|
912
|
+
*
|
|
913
|
+
* By default, `incremental` is `true` if your tsconfig has
|
|
914
|
+
* [`incremental`](https://www.typescriptlang.org/tsconfig/#incremental) or
|
|
915
|
+
* [`tsBuildInfoFile`](https://www.typescriptlang.org/tsconfig/#tsBuildInfoFile)
|
|
916
|
+
* enabled.
|
|
917
|
+
*
|
|
918
|
+
* This option is only used when {@link Options.oxc} is
|
|
919
|
+
* `false`.
|
|
920
|
+
*/
|
|
921
|
+
incremental?: boolean;
|
|
922
|
+
/**
|
|
923
|
+
* If `true`, the plugin will generate `.d.ts` files using `vue-tsc`.
|
|
924
|
+
*/
|
|
925
|
+
vue?: boolean;
|
|
926
|
+
/**
|
|
927
|
+
* If `true`, the plugin will generate `.d.ts` files using `@ts-macro/tsc`.
|
|
928
|
+
*/
|
|
929
|
+
tsMacro?: boolean;
|
|
930
|
+
/**
|
|
931
|
+
* If `true`, the plugin will launch a separate process for `tsc` or `vue-tsc`.
|
|
932
|
+
* This enables processing multiple projects in parallel.
|
|
933
|
+
*/
|
|
934
|
+
parallel?: boolean;
|
|
935
|
+
/**
|
|
936
|
+
* If `true`, the plugin will prepare all files listed in `tsconfig.json` for `tsc` or `vue-tsc`.
|
|
937
|
+
*
|
|
938
|
+
* This is especially useful when you have a single `tsconfig.json` for multiple projects in a monorepo.
|
|
939
|
+
*/
|
|
940
|
+
eager?: boolean;
|
|
941
|
+
/**
|
|
942
|
+
* If `true`, the plugin will create a new isolated context for each build,
|
|
943
|
+
* ensuring that previously generated `.d.ts` code and caches are not reused.
|
|
944
|
+
*
|
|
945
|
+
* By default, the plugin may reuse internal caches or incremental build artifacts
|
|
946
|
+
* to speed up repeated builds. Enabling this option forces a clean context,
|
|
947
|
+
* guaranteeing that all type definitions are generated from scratch.
|
|
948
|
+
*
|
|
949
|
+
* @default false
|
|
950
|
+
*/
|
|
951
|
+
newContext?: boolean;
|
|
952
|
+
/**
|
|
953
|
+
* If `true`, the plugin will emit `.d.ts` files for `.js` files as well.
|
|
954
|
+
* This is useful when you want to generate type definitions for JavaScript files with JSDoc comments.
|
|
955
|
+
*
|
|
956
|
+
* Enabled by default when `allowJs` in compilerOptions is `true`.
|
|
957
|
+
* This option is only used when {@link Options.oxc} is
|
|
958
|
+
* `false`.
|
|
959
|
+
*/
|
|
960
|
+
emitJs?: boolean;
|
|
961
|
+
}
|
|
962
|
+
interface Options extends GeneralOptions, TscOptions {
|
|
963
|
+
/**
|
|
964
|
+
* If `true`, the plugin will generate `.d.ts` files using Oxc,
|
|
965
|
+
* which is significantly faster than the TypeScript compiler.
|
|
966
|
+
*
|
|
967
|
+
* This option is automatically enabled when `isolatedDeclarations` in `compilerOptions` is set to `true`.
|
|
968
|
+
*/
|
|
969
|
+
oxc?: boolean | Omit<IsolatedDeclarationsOptions, "sourcemap">;
|
|
970
|
+
/**
|
|
971
|
+
* **[Experimental]** Enables DTS generation using `tsgo`.
|
|
972
|
+
*
|
|
973
|
+
* To use this option, make sure `@typescript/native-preview` is installed as a dependency,
|
|
974
|
+
* or provide a custom path to the `tsgo` binary using the `path` option.
|
|
975
|
+
*
|
|
976
|
+
* **Note:** This option is not yet recommended for production environments.
|
|
977
|
+
* `tsconfigRaw` and `isolatedDeclarations` options will be ignored when this option is enabled.
|
|
978
|
+
*
|
|
979
|
+
*
|
|
980
|
+
* ```ts
|
|
981
|
+
* // Use tsgo from `@typescript/native-preview` dependency
|
|
982
|
+
* tsgo: true
|
|
983
|
+
*
|
|
984
|
+
* // Use custom tsgo path (e.g., managed by Nix)
|
|
985
|
+
* tsgo: { path: '/path/to/tsgo' }
|
|
986
|
+
* ```
|
|
987
|
+
*/
|
|
988
|
+
tsgo?: boolean | TsgoOptions;
|
|
989
|
+
}
|
|
990
|
+
interface TsgoOptions {
|
|
991
|
+
enabled?: boolean;
|
|
992
|
+
/**
|
|
993
|
+
* Custom path to the `tsgo` binary.
|
|
994
|
+
*/
|
|
995
|
+
path?: string;
|
|
996
|
+
}
|
|
997
|
+
//#endregion
|
|
998
|
+
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.0.0-alpha.26_@pnpm+logger@1001.0.1_vite@packages+core_vue@3.5.27_typescript@5.9.3_/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
|
|
999
|
+
//#region src/node/cli-commands.d.ts
|
|
1000
|
+
interface StartOptions {
|
|
1001
|
+
root?: string;
|
|
1002
|
+
config?: string;
|
|
1003
|
+
host: string;
|
|
1004
|
+
port?: string | number;
|
|
1005
|
+
open?: boolean;
|
|
1006
|
+
}
|
|
1007
|
+
//#endregion
|
|
1008
|
+
//#region ../../node_modules/.pnpm/@arethetypeswrong+core@0.18.2/node_modules/@arethetypeswrong/core/dist/checkPackage.d.ts
|
|
1009
|
+
interface CheckPackageOptions {
|
|
1010
|
+
/**
|
|
1011
|
+
* Exhaustive list of entrypoints to check. The package root is `"."`.
|
|
1012
|
+
* Specifying this option disables automatic entrypoint discovery,
|
|
1013
|
+
* and overrides the `includeEntrypoints` and `excludeEntrypoints` options.
|
|
1014
|
+
*/
|
|
1015
|
+
entrypoints?: string[];
|
|
1016
|
+
/**
|
|
1017
|
+
* Entrypoints to check in addition to automatically discovered ones.
|
|
1018
|
+
*/
|
|
1019
|
+
includeEntrypoints?: string[];
|
|
1020
|
+
/**
|
|
1021
|
+
* Entrypoints to exclude from checking.
|
|
1022
|
+
*/
|
|
1023
|
+
excludeEntrypoints?: (string | RegExp)[];
|
|
1024
|
+
/**
|
|
1025
|
+
* Whether to automatically consider all published files as entrypoints
|
|
1026
|
+
* in the absence of any other detected or configured entrypoints.
|
|
1027
|
+
*/
|
|
1028
|
+
entrypointsLegacy?: boolean;
|
|
1029
|
+
}
|
|
1030
|
+
//#endregion
|
|
1031
|
+
//#region ../../node_modules/.pnpm/publint@0.3.16/node_modules/publint/src/index.d.ts
|
|
1032
|
+
interface PackFile {
|
|
1033
|
+
name: string;
|
|
1034
|
+
data: string | ArrayBuffer | Uint8Array;
|
|
1035
|
+
}
|
|
1036
|
+
interface Options$2 {
|
|
1037
|
+
/**
|
|
1038
|
+
* Path to your package that contains a package.json file.
|
|
1039
|
+
*
|
|
1040
|
+
* ::: info Environment notes
|
|
1041
|
+
* - **Node.js**: Defaults to `process.cwd()`.
|
|
1042
|
+
* - **Browser**: Automatically inferred from `{ tarball: ArrayBuffer | ReadableStream }`. If `{ files: PackFile[] }` is used,
|
|
1043
|
+
* this must be the shared directory of all files in `files`. e.g. if `name` has `"package/src/index.js",
|
|
1044
|
+
* the `pkgDir` should be `"package"`.
|
|
1045
|
+
* :::
|
|
1046
|
+
*/
|
|
1047
|
+
pkgDir?: string;
|
|
1048
|
+
/**
|
|
1049
|
+
* The level of messages to log (default: `'suggestion'`).
|
|
1050
|
+
* - `suggestion`: logs all messages
|
|
1051
|
+
* - `warning`: logs only `warning` and `error` messages
|
|
1052
|
+
* - `error`: logs only `error` messages
|
|
1053
|
+
*/
|
|
1054
|
+
level?: 'suggestion' | 'warning' | 'error';
|
|
1055
|
+
/**
|
|
1056
|
+
* The package manager to use for packing the `pkgDir`. The list of
|
|
1057
|
+
* packed files is used in certain linting rules, e.g. files marked as
|
|
1058
|
+
* entrypoints but not published.
|
|
1059
|
+
* - `'auto'`: Automatically detects the package manager using
|
|
1060
|
+
* [`package-manager-detector`](https://github.com/antfu-collective/package-manager-detector).
|
|
1061
|
+
* - `'npm'`/`'yarn'`/`'pnpm'`/`'bun'`: Uses the respective package manager to pack.
|
|
1062
|
+
* - `{ tarball }`: The packed tarball represented as an `ArrayBuffer` or a `ReadableStream`.
|
|
1063
|
+
* - `{ files }`: The manually-unpacked files from a tarball.
|
|
1064
|
+
* - `false`: Skips packing the package. This should only be used if all the files
|
|
1065
|
+
* in `pkgDir` are assumed to be published, e.g. in `node_modules`.
|
|
1066
|
+
*
|
|
1067
|
+
* ::: info Environment notes
|
|
1068
|
+
* - **Node.js**: Defaults to `'auto'`. All options above are supported. When using a package manager
|
|
1069
|
+
* to pack, lifecycle scripts like `prepack` and `postpack` are ignored
|
|
1070
|
+
* (except for yarn as it does not allow ignoring lifecycle scripts).
|
|
1071
|
+
* - **Browser**: Only `{ tarball }` and `{ files }` are supported and either **must be passed** to work,
|
|
1072
|
+
* as the browser does not have access to the file system.
|
|
1073
|
+
* :::
|
|
1074
|
+
*/
|
|
1075
|
+
pack?: 'auto' | 'npm' | 'yarn' | 'pnpm' | 'bun' | {
|
|
1076
|
+
tarball: ArrayBuffer | ReadableStream<Uint8Array>;
|
|
1077
|
+
} | {
|
|
1078
|
+
files: PackFile[];
|
|
1079
|
+
} | false;
|
|
1080
|
+
/**
|
|
1081
|
+
* Report warnings as errors.
|
|
1082
|
+
*/
|
|
1083
|
+
strict?: boolean;
|
|
1084
|
+
}
|
|
1085
|
+
//#endregion
|
|
1086
|
+
//#region ../../node_modules/.pnpm/unplugin@2.3.11/node_modules/unplugin/dist/index.d.ts
|
|
1087
|
+
/**
|
|
1088
|
+
* Array, or not yet
|
|
1089
|
+
*/
|
|
1090
|
+
type Arrayable$1<T> = T | Array<T>;
|
|
1091
|
+
type StringOrRegExp = string | RegExp;
|
|
1092
|
+
type FilterPattern = Arrayable$1<StringOrRegExp>;
|
|
1093
|
+
//#endregion
|
|
1094
|
+
//#region ../../node_modules/.pnpm/unplugin-unused@0.5.6/node_modules/unplugin-unused/dist/options-CGknhUOq.d.mts
|
|
1095
|
+
//#region src/core/options.d.ts
|
|
1096
|
+
type DepKind = "dependencies" | "devDependencies" | "peerDependencies";
|
|
1097
|
+
interface Options$1 {
|
|
1098
|
+
root?: string;
|
|
1099
|
+
include?: FilterPattern;
|
|
1100
|
+
exclude?: FilterPattern;
|
|
1101
|
+
ignore?: string[] | Partial<Record<DepKind, string[]>>;
|
|
1102
|
+
/**
|
|
1103
|
+
* @default 'warning'
|
|
1104
|
+
*/
|
|
1105
|
+
level?: "warning" | "error";
|
|
1106
|
+
/**
|
|
1107
|
+
* @default ['dependencies', 'peerDependencies']
|
|
1108
|
+
*/
|
|
1109
|
+
depKinds?: Array<DepKind>;
|
|
1110
|
+
}
|
|
1111
|
+
//#endregion
|
|
1112
|
+
//#region ../../node_modules/.pnpm/tsdown@0.20.2_@arethetypeswrong+core@0.18.2_@typescript+native-preview@7.0.0-dev.202601_11c6934cad7d4cedf7999249d5905a1c/node_modules/tsdown/dist/types-CNIFJKMX.d.mts
|
|
1113
|
+
//#region src/utils/types.d.ts
|
|
1114
|
+
type Overwrite<T, U> = Omit<T, keyof U> & U;
|
|
1115
|
+
type Awaitable<T> = T | Promise<T>;
|
|
1116
|
+
type MarkPartial<T, K extends keyof T> = Omit<Required<T>, K> & Partial<Pick<T, K>>;
|
|
1117
|
+
type Arrayable<T> = T | T[]; //#endregion
|
|
1118
|
+
//#region src/features/copy.d.ts
|
|
1119
|
+
interface CopyEntry {
|
|
1120
|
+
/**
|
|
1121
|
+
* Source path or glob pattern.
|
|
1122
|
+
*/
|
|
1123
|
+
from: string | string[];
|
|
1124
|
+
/**
|
|
1125
|
+
* Destination path.
|
|
1126
|
+
* If not specified, defaults to the output directory ("outDir").
|
|
1127
|
+
*/
|
|
1128
|
+
to?: string;
|
|
1129
|
+
/**
|
|
1130
|
+
* Whether to flatten the copied files (not preserving directory structure).
|
|
1131
|
+
*
|
|
1132
|
+
* @default true
|
|
1133
|
+
*/
|
|
1134
|
+
flatten?: boolean;
|
|
1135
|
+
/**
|
|
1136
|
+
* Output copied items to console.
|
|
1137
|
+
* @default false
|
|
1138
|
+
*/
|
|
1139
|
+
verbose?: boolean;
|
|
1140
|
+
/**
|
|
1141
|
+
* Change destination file or folder name.
|
|
1142
|
+
*/
|
|
1143
|
+
rename?: string | ((name: string, extension: string, fullPath: string) => string);
|
|
1144
|
+
}
|
|
1145
|
+
type CopyOptions = Arrayable<string | CopyEntry>;
|
|
1146
|
+
type CopyOptionsFn = (options: ResolvedConfig) => Awaitable<CopyOptions>; //#endregion
|
|
1147
|
+
//#region src/features/css/index.d.ts
|
|
1148
|
+
interface CssOptions {
|
|
1149
|
+
/**
|
|
1150
|
+
* Enable/disable CSS code splitting.
|
|
1151
|
+
* When set to `false`, all CSS in the entire project will be extracted into a single CSS file.
|
|
1152
|
+
* When set to `true`, CSS imported in async JS chunks will be preserved as chunks.
|
|
1153
|
+
* @default true
|
|
1154
|
+
*/
|
|
1155
|
+
splitting?: boolean;
|
|
1156
|
+
/**
|
|
1157
|
+
* Specify the name of the CSS file.
|
|
1158
|
+
* @default 'style.css'
|
|
1159
|
+
*/
|
|
1160
|
+
fileName?: string;
|
|
1161
|
+
} //#endregion
|
|
1162
|
+
//#region src/features/devtools.d.ts
|
|
1163
|
+
interface DevtoolsOptions extends NonNullable<InputOptions["devtools"]> {
|
|
1164
|
+
/**
|
|
1165
|
+
* **[experimental]** Enable devtools integration. `@vitejs/devtools` must be installed as a dependency.
|
|
1166
|
+
*
|
|
1167
|
+
* Defaults to true, if `@vitejs/devtools` is installed.
|
|
1168
|
+
*/
|
|
1169
|
+
ui?: boolean | Partial<StartOptions>;
|
|
1170
|
+
/**
|
|
1171
|
+
* Clean devtools stale sessions.
|
|
1172
|
+
*
|
|
1173
|
+
* @default true
|
|
1174
|
+
*/
|
|
1175
|
+
clean?: boolean;
|
|
1176
|
+
} //#endregion
|
|
1177
|
+
//#region src/features/hooks.d.ts
|
|
1178
|
+
interface BuildContext {
|
|
1179
|
+
options: ResolvedConfig;
|
|
1180
|
+
hooks: Hookable<TsdownHooks>;
|
|
1181
|
+
}
|
|
1182
|
+
interface RolldownContext {
|
|
1183
|
+
buildOptions: BuildOptions;
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* Hooks for tsdown.
|
|
1187
|
+
*/
|
|
1188
|
+
interface TsdownHooks {
|
|
1189
|
+
/**
|
|
1190
|
+
* Invoked before each tsdown build starts.
|
|
1191
|
+
* Use this hook to perform setup or preparation tasks.
|
|
1192
|
+
*/
|
|
1193
|
+
"build:prepare": (ctx: BuildContext) => void | Promise<void>;
|
|
1194
|
+
/**
|
|
1195
|
+
* Invoked before each Rolldown build.
|
|
1196
|
+
* For dual-format builds, this hook is called for each format.
|
|
1197
|
+
* Useful for configuring or modifying the build context before bundling.
|
|
1198
|
+
*/
|
|
1199
|
+
"build:before": (ctx: BuildContext & RolldownContext) => void | Promise<void>;
|
|
1200
|
+
/**
|
|
1201
|
+
* Invoked after each tsdown build completes.
|
|
1202
|
+
* Use this hook for cleanup or post-processing tasks.
|
|
1203
|
+
*/
|
|
1204
|
+
"build:done": (ctx: BuildContext & {
|
|
1205
|
+
chunks: RolldownChunk[];
|
|
1206
|
+
}) => void | Promise<void>;
|
|
1207
|
+
} //#endregion
|
|
1208
|
+
//#region node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.d.mts
|
|
1209
|
+
interface PackageJson {
|
|
1210
|
+
/**
|
|
1211
|
+
* The name is what your thing is called.
|
|
1212
|
+
* Some rules:
|
|
1213
|
+
* - The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
|
|
1214
|
+
* - The name can’t start with a dot or an underscore.
|
|
1215
|
+
* - New packages must not have uppercase letters in the name.
|
|
1216
|
+
* - 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.
|
|
1217
|
+
*/
|
|
1218
|
+
name?: string;
|
|
1219
|
+
/**
|
|
1220
|
+
* Version must be parseable by `node-semver`, which is bundled with npm as a dependency. (`npm install semver` to use it yourself.)
|
|
1221
|
+
*/
|
|
1222
|
+
version?: string;
|
|
1223
|
+
/**
|
|
1224
|
+
* Put a description in it. It’s a string. This helps people discover your package, as it’s listed in `npm search`.
|
|
1225
|
+
*/
|
|
1226
|
+
description?: string;
|
|
1227
|
+
/**
|
|
1228
|
+
* Put keywords in it. It’s an array of strings. This helps people discover your package as it’s listed in `npm search`.
|
|
1229
|
+
*/
|
|
1230
|
+
keywords?: string[];
|
|
1231
|
+
/**
|
|
1232
|
+
* The url to the project homepage.
|
|
1233
|
+
*/
|
|
1234
|
+
homepage?: string;
|
|
1235
|
+
/**
|
|
1236
|
+
* 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.
|
|
1237
|
+
*/
|
|
1238
|
+
bugs?: string | {
|
|
1239
|
+
url?: string;
|
|
1240
|
+
email?: string;
|
|
1241
|
+
};
|
|
1242
|
+
/**
|
|
1243
|
+
* 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.
|
|
1244
|
+
*/
|
|
1245
|
+
license?: string;
|
|
1246
|
+
/**
|
|
1247
|
+
* 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.
|
|
1248
|
+
* For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:
|
|
1249
|
+
*/
|
|
1250
|
+
repository?: string | {
|
|
1251
|
+
type: string;
|
|
1252
|
+
url: string;
|
|
1253
|
+
/**
|
|
1254
|
+
* 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:
|
|
1255
|
+
*/
|
|
1256
|
+
directory?: string;
|
|
1257
|
+
};
|
|
1258
|
+
/**
|
|
1259
|
+
* The `scripts` field is a dictionary containing script commands that are run at various times in the lifecycle of your package.
|
|
1260
|
+
*/
|
|
1261
|
+
scripts?: PackageJsonScripts;
|
|
1262
|
+
/**
|
|
1263
|
+
* If you set `"private": true` in your package.json, then npm will refuse to publish it.
|
|
1264
|
+
*/
|
|
1265
|
+
private?: boolean;
|
|
1266
|
+
/**
|
|
1267
|
+
* The “author” is one person.
|
|
1268
|
+
*/
|
|
1269
|
+
author?: PackageJsonPerson;
|
|
1270
|
+
/**
|
|
1271
|
+
* “contributors” is an array of people.
|
|
1272
|
+
*/
|
|
1273
|
+
contributors?: PackageJsonPerson[];
|
|
1274
|
+
/**
|
|
1275
|
+
* An object containing a URL that provides up-to-date information
|
|
1276
|
+
* about ways to help fund development of your package,
|
|
1277
|
+
* a string URL, or an array of objects and string URLs
|
|
1278
|
+
*/
|
|
1279
|
+
funding?: PackageJsonFunding | PackageJsonFunding[];
|
|
1280
|
+
/**
|
|
1281
|
+
* 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.
|
|
1282
|
+
*/
|
|
1283
|
+
files?: string[];
|
|
1284
|
+
/**
|
|
1285
|
+
* 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.
|
|
1286
|
+
* This should be a module ID relative to the root of your package folder.
|
|
1287
|
+
* For most modules, it makes the most sense to have a main script and often not much else.
|
|
1288
|
+
*/
|
|
1289
|
+
main?: string;
|
|
1290
|
+
/**
|
|
1291
|
+
* 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)
|
|
1292
|
+
*/
|
|
1293
|
+
browser?: string | Record<string, string | false>;
|
|
1294
|
+
/**
|
|
1295
|
+
* 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.
|
|
1296
|
+
*/
|
|
1297
|
+
unpkg?: string;
|
|
1298
|
+
/**
|
|
1299
|
+
* 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.
|
|
1300
|
+
*/
|
|
1301
|
+
bin?: string | Record<string, string>;
|
|
1302
|
+
/**
|
|
1303
|
+
* Specify either a single file or an array of filenames to put in place for the `man` program to find.
|
|
1304
|
+
*/
|
|
1305
|
+
man?: string | string[];
|
|
1306
|
+
/**
|
|
1307
|
+
* 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.
|
|
1308
|
+
*/
|
|
1309
|
+
dependencies?: Record<string, string>;
|
|
1310
|
+
/**
|
|
1311
|
+
* 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.
|
|
1312
|
+
* In this case, it’s best to map these additional items in a `devDependencies` object.
|
|
1313
|
+
*/
|
|
1314
|
+
devDependencies?: Record<string, string>;
|
|
1315
|
+
/**
|
|
1316
|
+
* 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.
|
|
1317
|
+
*/
|
|
1318
|
+
optionalDependencies?: Record<string, string>;
|
|
1319
|
+
/**
|
|
1320
|
+
* 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.
|
|
1321
|
+
*/
|
|
1322
|
+
peerDependencies?: Record<string, string>;
|
|
1323
|
+
/**
|
|
1324
|
+
* TypeScript typings, typically ending by `.d.ts`.
|
|
1325
|
+
*/
|
|
1326
|
+
types?: string;
|
|
1327
|
+
/**
|
|
1328
|
+
* This field is synonymous with `types`.
|
|
1329
|
+
*/
|
|
1330
|
+
typings?: string;
|
|
1331
|
+
/**
|
|
1332
|
+
* Non-Standard Node.js alternate entry-point to main.
|
|
1333
|
+
* An initial implementation for supporting CJS packages (from main), and use module for ESM modules.
|
|
1334
|
+
*/
|
|
1335
|
+
module?: string;
|
|
1336
|
+
/**
|
|
1337
|
+
* Make main entry-point be loaded as an ESM module, support "export" syntax instead of "require"
|
|
1338
|
+
*
|
|
1339
|
+
* Docs:
|
|
1340
|
+
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_package_json_type_field
|
|
1341
|
+
*
|
|
1342
|
+
* @default 'commonjs'
|
|
1343
|
+
* @since Node.js v14
|
|
1344
|
+
*/
|
|
1345
|
+
type?: "module" | "commonjs";
|
|
1346
|
+
/**
|
|
1347
|
+
* Alternate and extensible alternative to "main" entry point.
|
|
1348
|
+
*
|
|
1349
|
+
* When using `{type: "module"}`, any ESM module file MUST end with `.mjs` extension.
|
|
1350
|
+
*
|
|
1351
|
+
* Docs:
|
|
1352
|
+
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_exports_sugar
|
|
1353
|
+
*
|
|
1354
|
+
* @since Node.js v12.7
|
|
1355
|
+
*/
|
|
1356
|
+
exports?: PackageJsonExports;
|
|
1357
|
+
/**
|
|
1358
|
+
* Docs:
|
|
1359
|
+
* - https://nodejs.org/api/packages.html#imports
|
|
1360
|
+
*/
|
|
1361
|
+
imports?: Record<string, string | Record<string, string>>;
|
|
1362
|
+
/**
|
|
1363
|
+
* The field is used to define a set of sub-packages (or workspaces) within a monorepo.
|
|
1364
|
+
*
|
|
1365
|
+
* This field is an array of glob patterns or an object with specific configurations for managing
|
|
1366
|
+
* multiple packages in a single repository.
|
|
1367
|
+
*/
|
|
1368
|
+
workspaces?: string[] | {
|
|
1369
|
+
/**
|
|
1370
|
+
* Workspace package paths. Glob patterns are supported.
|
|
1371
|
+
*/
|
|
1372
|
+
packages?: string[];
|
|
1373
|
+
/**
|
|
1374
|
+
* Packages to block from hoisting to the workspace root.
|
|
1375
|
+
* Uses glob patterns to match module paths in the dependency tree.
|
|
1376
|
+
*
|
|
1377
|
+
* Docs:
|
|
1378
|
+
* - https://classic.yarnpkg.com/blog/2018/02/15/nohoist/
|
|
1379
|
+
*/
|
|
1380
|
+
nohoist?: string[];
|
|
1381
|
+
};
|
|
1382
|
+
/**
|
|
1383
|
+
* The field is used to specify different TypeScript declaration files for
|
|
1384
|
+
* different versions of TypeScript, allowing for version-specific type definitions.
|
|
1385
|
+
*/
|
|
1386
|
+
typesVersions?: Record<string, Record<string, string[]>>;
|
|
1387
|
+
/**
|
|
1388
|
+
* You can specify which operating systems your module will run on:
|
|
1389
|
+
* ```json
|
|
1390
|
+
* {
|
|
1391
|
+
* "os": ["darwin", "linux"]
|
|
1392
|
+
* }
|
|
1393
|
+
* ```
|
|
1394
|
+
* You can also block instead of allowing operating systems, just prepend the blocked os with a '!':
|
|
1395
|
+
* ```json
|
|
1396
|
+
* {
|
|
1397
|
+
* "os": ["!win32"]
|
|
1398
|
+
* }
|
|
1399
|
+
* ```
|
|
1400
|
+
* The host operating system is determined by `process.platform`
|
|
1401
|
+
* It is allowed to both block and allow an item, although there isn't any good reason to do this.
|
|
1402
|
+
*/
|
|
1403
|
+
os?: string[];
|
|
1404
|
+
/**
|
|
1405
|
+
* If your code only runs on certain cpu architectures, you can specify which ones.
|
|
1406
|
+
* ```json
|
|
1407
|
+
* {
|
|
1408
|
+
* "cpu": ["x64", "ia32"]
|
|
1409
|
+
* }
|
|
1410
|
+
* ```
|
|
1411
|
+
* Like the `os` option, you can also block architectures:
|
|
1412
|
+
* ```json
|
|
1413
|
+
* {
|
|
1414
|
+
* "cpu": ["!arm", "!mips"]
|
|
1415
|
+
* }
|
|
1416
|
+
* ```
|
|
1417
|
+
* The host architecture is determined by `process.arch`
|
|
1418
|
+
*/
|
|
1419
|
+
cpu?: string[];
|
|
1420
|
+
/**
|
|
1421
|
+
* This is a set of config values that will be used at publish-time.
|
|
1422
|
+
*/
|
|
1423
|
+
publishConfig?: {
|
|
1424
|
+
/**
|
|
1425
|
+
* The registry that will be used if the package is published.
|
|
1426
|
+
*/
|
|
1427
|
+
registry?: string;
|
|
1428
|
+
/**
|
|
1429
|
+
* The tag that will be used if the package is published.
|
|
1430
|
+
*/
|
|
1431
|
+
tag?: string;
|
|
1432
|
+
/**
|
|
1433
|
+
* The access level that will be used if the package is published.
|
|
1434
|
+
*/
|
|
1435
|
+
access?: "public" | "restricted";
|
|
1436
|
+
/**
|
|
1437
|
+
* **pnpm-only**
|
|
1438
|
+
*
|
|
1439
|
+
* By default, for portability reasons, no files except those listed in
|
|
1440
|
+
* the bin field will be marked as executable in the resulting package
|
|
1441
|
+
* archive. The executableFiles field lets you declare additional fields
|
|
1442
|
+
* that must have the executable flag (+x) set even if
|
|
1443
|
+
* they aren't directly accessible through the bin field.
|
|
1444
|
+
*/
|
|
1445
|
+
executableFiles?: string[];
|
|
1446
|
+
/**
|
|
1447
|
+
* **pnpm-only**
|
|
1448
|
+
*
|
|
1449
|
+
* You also can use the field `publishConfig.directory` to customize
|
|
1450
|
+
* the published subdirectory relative to the current `package.json`.
|
|
1451
|
+
*
|
|
1452
|
+
* It is expected to have a modified version of the current package in
|
|
1453
|
+
* the specified directory (usually using third party build tools).
|
|
1454
|
+
*/
|
|
1455
|
+
directory?: string;
|
|
1456
|
+
/**
|
|
1457
|
+
* **pnpm-only**
|
|
1458
|
+
*
|
|
1459
|
+
* When set to `true`, the project will be symlinked from the
|
|
1460
|
+
* `publishConfig.directory` location during local development.
|
|
1461
|
+
* @default true
|
|
1462
|
+
*/
|
|
1463
|
+
linkDirectory?: boolean;
|
|
1464
|
+
} & Pick<PackageJson, "bin" | "main" | "exports" | "types" | "typings" | "module" | "browser" | "unpkg" | "typesVersions" | "os" | "cpu">;
|
|
1465
|
+
/**
|
|
1466
|
+
* See: https://nodejs.org/api/packages.html#packagemanager
|
|
1467
|
+
* This field defines which package manager is expected to be used when working on the current project.
|
|
1468
|
+
* Should be of the format: `<name>@<version>[#hash]`
|
|
1469
|
+
*/
|
|
1470
|
+
packageManager?: string;
|
|
1471
|
+
[key: string]: any;
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* See: https://docs.npmjs.com/cli/v11/using-npm/scripts#pre--post-scripts
|
|
1475
|
+
*/
|
|
1476
|
+
type PackageJsonScriptWithPreAndPost<S extends string> = S | `${"pre" | "post"}${S}`;
|
|
1477
|
+
/**
|
|
1478
|
+
* See: https://docs.npmjs.com/cli/v11/using-npm/scripts#life-cycle-operation-order
|
|
1479
|
+
*/
|
|
1480
|
+
type PackageJsonNpmLifeCycleScripts = "dependencies" | "prepublishOnly" | PackageJsonScriptWithPreAndPost<"install" | "pack" | "prepare" | "publish" | "restart" | "start" | "stop" | "test" | "version">;
|
|
1481
|
+
/**
|
|
1482
|
+
* See: https://pnpm.io/scripts#lifecycle-scripts
|
|
1483
|
+
*/
|
|
1484
|
+
type PackageJsonPnpmLifeCycleScripts = "pnpm:devPreinstall";
|
|
1485
|
+
type PackageJsonCommonScripts = "build" | "coverage" | "deploy" | "dev" | "format" | "lint" | "preview" | "release" | "typecheck" | "watch";
|
|
1486
|
+
type PackageJsonScriptName = PackageJsonCommonScripts | PackageJsonNpmLifeCycleScripts | PackageJsonPnpmLifeCycleScripts | (string & {});
|
|
1487
|
+
type PackageJsonScripts = { [P in PackageJsonScriptName]?: string };
|
|
1488
|
+
/**
|
|
1489
|
+
* 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.
|
|
1490
|
+
*/
|
|
1491
|
+
type PackageJsonPerson = string | {
|
|
1492
|
+
name: string;
|
|
1493
|
+
email?: string;
|
|
1494
|
+
url?: string;
|
|
1495
|
+
};
|
|
1496
|
+
type PackageJsonFunding = string | {
|
|
1497
|
+
url: string;
|
|
1498
|
+
type?: string;
|
|
1499
|
+
};
|
|
1500
|
+
type PackageJsonExportKey = "." | "import" | "require" | "types" | "node" | "browser" | "default" | (string & {});
|
|
1501
|
+
type PackageJsonExportsObject = { [P in PackageJsonExportKey]?: string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject> };
|
|
1502
|
+
type PackageJsonExports = string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>;
|
|
1503
|
+
/**
|
|
1504
|
+
* Defines a PackageJson structure.
|
|
1505
|
+
* @param pkg - The `package.json` content as an object. See {@link PackageJson}.
|
|
1506
|
+
* @returns the same `package.json` object.
|
|
1507
|
+
*/
|
|
1508
|
+
//#endregion
|
|
1509
|
+
//#region src/utils/package.d.ts
|
|
1510
|
+
interface PackageJsonWithPath extends PackageJson {
|
|
1511
|
+
packageJsonPath: string;
|
|
1512
|
+
}
|
|
1513
|
+
type PackageType = "module" | "commonjs" | undefined; //#endregion
|
|
1514
|
+
//#region src/features/output.d.ts
|
|
1515
|
+
interface OutExtensionContext {
|
|
1516
|
+
options: InputOptions;
|
|
1517
|
+
format: NormalizedFormat;
|
|
1518
|
+
/** "type" field in project's package.json */
|
|
1519
|
+
pkgType?: PackageType;
|
|
1520
|
+
}
|
|
1521
|
+
interface OutExtensionObject {
|
|
1522
|
+
js?: string;
|
|
1523
|
+
dts?: string;
|
|
1524
|
+
}
|
|
1525
|
+
type OutExtensionFactory = (context: OutExtensionContext) => OutExtensionObject | undefined;
|
|
1526
|
+
interface ChunkAddonObject {
|
|
1527
|
+
js?: string;
|
|
1528
|
+
css?: string;
|
|
1529
|
+
dts?: string;
|
|
1530
|
+
}
|
|
1531
|
+
type ChunkAddonFunction = (ctx: {
|
|
1532
|
+
format: Format;
|
|
1533
|
+
fileName: string;
|
|
1534
|
+
}) => ChunkAddonObject | string | undefined;
|
|
1535
|
+
type ChunkAddon = ChunkAddonObject | ChunkAddonFunction | string; //#endregion
|
|
1536
|
+
//#region src/features/pkg/attw.d.ts
|
|
1537
|
+
interface AttwOptions extends CheckPackageOptions {
|
|
1538
|
+
/**
|
|
1539
|
+
* Profiles select a set of resolution modes to require/ignore. All are evaluated but failures outside
|
|
1540
|
+
* of those required are ignored.
|
|
1541
|
+
*
|
|
1542
|
+
* The available profiles are:
|
|
1543
|
+
* - `strict`: requires all resolutions
|
|
1544
|
+
* - `node16`: ignores node10 resolution failures
|
|
1545
|
+
* - `esm-only`: ignores CJS resolution failures
|
|
1546
|
+
*
|
|
1547
|
+
* @default 'strict'
|
|
1548
|
+
*/
|
|
1549
|
+
profile?: "strict" | "node16" | "esm-only";
|
|
1550
|
+
/**
|
|
1551
|
+
* The level of the check.
|
|
1552
|
+
*
|
|
1553
|
+
* The available levels are:
|
|
1554
|
+
* - `error`: fails the build
|
|
1555
|
+
* - `warn`: warns the build
|
|
1556
|
+
*
|
|
1557
|
+
* @default 'warn'
|
|
1558
|
+
*/
|
|
1559
|
+
level?: "error" | "warn";
|
|
1560
|
+
/**
|
|
1561
|
+
* List of problem types to ignore by rule name.
|
|
1562
|
+
*
|
|
1563
|
+
* The available values are:
|
|
1564
|
+
* - `no-resolution`
|
|
1565
|
+
* - `untyped-resolution`
|
|
1566
|
+
* - `false-cjs`
|
|
1567
|
+
* - `false-esm`
|
|
1568
|
+
* - `cjs-resolves-to-esm`
|
|
1569
|
+
* - `fallback-condition`
|
|
1570
|
+
* - `cjs-only-exports-default`
|
|
1571
|
+
* - `named-exports`
|
|
1572
|
+
* - `false-export-default`
|
|
1573
|
+
* - `missing-export-equals`
|
|
1574
|
+
* - `unexpected-module-syntax`
|
|
1575
|
+
* - `internal-resolution-error`
|
|
1576
|
+
*
|
|
1577
|
+
* @example
|
|
1578
|
+
* ```ts
|
|
1579
|
+
* ignoreRules: ['no-resolution', 'false-cjs']
|
|
1580
|
+
* ```
|
|
1581
|
+
*/
|
|
1582
|
+
ignoreRules?: string[];
|
|
1583
|
+
} //#endregion
|
|
1584
|
+
//#region src/utils/chunks.d.ts
|
|
1585
|
+
type RolldownChunk = (OutputChunk | OutputAsset) & {
|
|
1586
|
+
outDir: string;
|
|
1587
|
+
};
|
|
1588
|
+
type ChunksByFormat = Partial<Record<NormalizedFormat, RolldownChunk[]>>;
|
|
1589
|
+
interface TsdownBundle extends AsyncDisposable {
|
|
1590
|
+
chunks: RolldownChunk[];
|
|
1591
|
+
config: ResolvedConfig;
|
|
1592
|
+
} //#endregion
|
|
1593
|
+
//#region src/features/pkg/exports.d.ts
|
|
1594
|
+
interface ExportsOptions {
|
|
1595
|
+
/**
|
|
1596
|
+
* Generate exports that link to source code during development.
|
|
1597
|
+
* - string: add as a custom condition.
|
|
1598
|
+
* - true: all conditions point to source files, and add dist exports to `publishConfig`.
|
|
1599
|
+
*/
|
|
1600
|
+
devExports?: boolean | string;
|
|
1601
|
+
/**
|
|
1602
|
+
* Exports for package.json file.
|
|
1603
|
+
* @default true
|
|
1604
|
+
*/
|
|
1605
|
+
packageJson?: boolean;
|
|
1606
|
+
/**
|
|
1607
|
+
* Exports for all files.
|
|
1608
|
+
*/
|
|
1609
|
+
all?: boolean;
|
|
1610
|
+
/**
|
|
1611
|
+
* Specifies file patterns (as glob patterns or regular expressions) to exclude from package exports.
|
|
1612
|
+
* Use this to prevent certain files from being included in the exported package, such as test files, binaries, or internal utilities.
|
|
1613
|
+
*
|
|
1614
|
+
* **Note:** Do not include file extensions, and paths should be relative to the dist directory.
|
|
1615
|
+
*
|
|
1616
|
+
* @example
|
|
1617
|
+
* exclude: ['cli', '**\/*.test', /internal/]
|
|
1618
|
+
*/
|
|
1619
|
+
exclude?: (RegExp | string)[];
|
|
1620
|
+
/**
|
|
1621
|
+
* Generate legacy fields (`main` and `module`) for older Node.js and bundlers
|
|
1622
|
+
* that do not support package `exports` field.
|
|
1623
|
+
*
|
|
1624
|
+
* Defaults to false, if only ESM builds are included, true otherwise.
|
|
1625
|
+
*
|
|
1626
|
+
* @see {@link https://github.com/publint/publint/issues/24}
|
|
1627
|
+
*/
|
|
1628
|
+
legacy?: boolean;
|
|
1629
|
+
customExports?: (exports: Record<string, any>, context: {
|
|
1630
|
+
pkg: PackageJson;
|
|
1631
|
+
chunks: ChunksByFormat;
|
|
1632
|
+
isPublish: boolean;
|
|
1633
|
+
}) => Awaitable<Record<string, any>>;
|
|
1634
|
+
} //#endregion
|
|
1635
|
+
//#region src/features/pkg/publint.d.ts
|
|
1636
|
+
interface PublintOptions extends Omit<Options$2, "pack" | "pkgDir"> {} //#endregion
|
|
1637
|
+
//#region src/utils/logger.d.ts
|
|
1638
|
+
type LogType = "error" | "warn" | "info";
|
|
1639
|
+
type LogLevel = LogType | "silent";
|
|
1640
|
+
interface Logger {
|
|
1641
|
+
level: LogLevel;
|
|
1642
|
+
info: (...args: any[]) => void;
|
|
1643
|
+
warn: (...args: any[]) => void;
|
|
1644
|
+
warnOnce: (...args: any[]) => void;
|
|
1645
|
+
error: (...args: any[]) => void;
|
|
1646
|
+
success: (...args: any[]) => void;
|
|
1647
|
+
clearScreen: (type: LogType) => void;
|
|
1648
|
+
}
|
|
1649
|
+
declare const globalLogger: Logger; //#endregion
|
|
1650
|
+
//#region src/features/report.d.ts
|
|
1651
|
+
interface ReportOptions {
|
|
1652
|
+
/**
|
|
1653
|
+
* Enable/disable gzip-compressed size reporting.
|
|
1654
|
+
* Compressing large output files can be slow, so disabling this may increase build performance for large projects.
|
|
1655
|
+
*
|
|
1656
|
+
* @default true
|
|
1657
|
+
*/
|
|
1658
|
+
gzip?: boolean;
|
|
1659
|
+
/**
|
|
1660
|
+
* Enable/disable brotli-compressed size reporting.
|
|
1661
|
+
* Compressing large output files can be slow, so disabling this may increase build performance for large projects.
|
|
1662
|
+
*
|
|
1663
|
+
* @default false
|
|
1664
|
+
*/
|
|
1665
|
+
brotli?: boolean;
|
|
1666
|
+
/**
|
|
1667
|
+
* Skip reporting compressed size for files larger than this size.
|
|
1668
|
+
* @default 1_000_000 // 1MB
|
|
1669
|
+
*/
|
|
1670
|
+
maxCompressSize?: number;
|
|
1671
|
+
}
|
|
1672
|
+
//#endregion
|
|
1673
|
+
//#region src/config/types.d.ts
|
|
1674
|
+
type Sourcemap = boolean | "inline" | "hidden";
|
|
1675
|
+
type Format = ModuleFormat;
|
|
1676
|
+
type NormalizedFormat = InternalModuleFormat;
|
|
1677
|
+
/**
|
|
1678
|
+
* Extended input option that supports glob negation patterns.
|
|
1679
|
+
*
|
|
1680
|
+
* When using object form, values can be:
|
|
1681
|
+
* - A single glob pattern string
|
|
1682
|
+
* - An array of glob patterns, including negation patterns (prefixed with `!`)
|
|
1683
|
+
*
|
|
1684
|
+
* @example
|
|
1685
|
+
* ```ts
|
|
1686
|
+
* entry: {
|
|
1687
|
+
* // Single pattern
|
|
1688
|
+
* "utils/*": "./src/utils/*.ts",
|
|
1689
|
+
* // Array with negation pattern to exclude files
|
|
1690
|
+
* "hooks/*": ["./src/hooks/*.ts", "!./src/hooks/index.ts"],
|
|
1691
|
+
* }
|
|
1692
|
+
* ```
|
|
1693
|
+
*/
|
|
1694
|
+
type TsdownInputOption = Arrayable<string | Record<string, Arrayable<string>>>;
|
|
1695
|
+
interface Workspace {
|
|
1696
|
+
/**
|
|
1697
|
+
* Workspace directories. Glob patterns are supported.
|
|
1698
|
+
* - `auto`: Automatically detect `package.json` files in the workspace.
|
|
1699
|
+
* @default 'auto'
|
|
1700
|
+
*/
|
|
1701
|
+
include?: Arrayable<string> | "auto";
|
|
1702
|
+
/**
|
|
1703
|
+
* Exclude directories from workspace.
|
|
1704
|
+
* Defaults to all `node_modules`, `dist`, `test`, `tests`, `temp`, and `tmp` directories.
|
|
1705
|
+
*/
|
|
1706
|
+
exclude?: Arrayable<string>;
|
|
1707
|
+
/**
|
|
1708
|
+
* Path to the workspace configuration file.
|
|
1709
|
+
*/
|
|
1710
|
+
config?: boolean | string;
|
|
1711
|
+
}
|
|
1712
|
+
type NoExternalFn = (id: string, importer: string | undefined) => boolean | null | undefined | void;
|
|
1713
|
+
type CIOption = "ci-only" | "local-only";
|
|
1714
|
+
type WithEnabled<T> = boolean | undefined | CIOption | (T & {
|
|
1715
|
+
/** @default true */enabled?: boolean | CIOption;
|
|
1716
|
+
});
|
|
1717
|
+
/**
|
|
1718
|
+
* Options for tsdown.
|
|
1719
|
+
*/
|
|
1720
|
+
interface UserConfig {
|
|
1721
|
+
/**
|
|
1722
|
+
* Defaults to `'src/index.ts'` if it exists.
|
|
1723
|
+
*
|
|
1724
|
+
* Supports glob patterns with negation to exclude files:
|
|
1725
|
+
* @example
|
|
1726
|
+
* ```ts
|
|
1727
|
+
* entry: {
|
|
1728
|
+
* "hooks/*": ["./src/hooks/*.ts", "!./src/hooks/index.ts"],
|
|
1729
|
+
* }
|
|
1730
|
+
* ```
|
|
1731
|
+
*/
|
|
1732
|
+
entry?: TsdownInputOption;
|
|
1733
|
+
external?: ExternalOption;
|
|
1734
|
+
noExternal?: Arrayable<string | RegExp> | NoExternalFn;
|
|
1735
|
+
/**
|
|
1736
|
+
* Bundle only the dependencies listed here; throw an error if any others are missing.
|
|
1737
|
+
*
|
|
1738
|
+
* - `undefined` (default): Show warnings for bundled dependencies.
|
|
1739
|
+
* - `false`: Suppress all warnings about `inlineOnly` option.
|
|
1740
|
+
*
|
|
1741
|
+
* Note: Be sure to include all required sub-dependencies as well.
|
|
1742
|
+
*/
|
|
1743
|
+
inlineOnly?: Arrayable<string | RegExp> | false;
|
|
1744
|
+
/**
|
|
1745
|
+
* Skip bundling `node_modules`.
|
|
1746
|
+
* @default false
|
|
1747
|
+
*/
|
|
1748
|
+
skipNodeModulesBundle?: boolean;
|
|
1749
|
+
alias?: Record<string, string>;
|
|
1750
|
+
tsconfig?: string | boolean;
|
|
1751
|
+
/**
|
|
1752
|
+
* Specifies the target runtime platform for the build.
|
|
1753
|
+
*
|
|
1754
|
+
* - `node`: Node.js and compatible runtimes (e.g., Deno, Bun).
|
|
1755
|
+
* For CJS format, this is always set to `node` and cannot be changed.
|
|
1756
|
+
* - `neutral`: A platform-agnostic target with no specific runtime assumptions.
|
|
1757
|
+
* - `browser`: Web browsers.
|
|
1758
|
+
*
|
|
1759
|
+
* @default 'node'
|
|
1760
|
+
* @see https://tsdown.dev/options/platform
|
|
1761
|
+
*/
|
|
1762
|
+
platform?: "node" | "neutral" | "browser";
|
|
1763
|
+
/**
|
|
1764
|
+
* Specifies the compilation target environment(s).
|
|
1765
|
+
*
|
|
1766
|
+
* Determines the JavaScript version or runtime(s) for which the code should be compiled.
|
|
1767
|
+
* If not set, defaults to the value of `engines.node` in your project's `package.json`.
|
|
1768
|
+
* If no `engines.node` field exists, no syntax transformations are applied.
|
|
1769
|
+
*
|
|
1770
|
+
* Accepts a single target (e.g., `'es2020'`, `'node18'`), an array of targets, or `false` to disable all transformations.
|
|
1771
|
+
*
|
|
1772
|
+
* @see {@link https://tsdown.dev/options/target#supported-targets} for a list of valid targets and more details.
|
|
1773
|
+
*
|
|
1774
|
+
* @example
|
|
1775
|
+
* ```jsonc
|
|
1776
|
+
* // Target a single environment
|
|
1777
|
+
* { "target": "node18" }
|
|
1778
|
+
* ```
|
|
1779
|
+
*
|
|
1780
|
+
* @example
|
|
1781
|
+
* ```jsonc
|
|
1782
|
+
* // Target multiple environments
|
|
1783
|
+
* { "target": ["node18", "es2020"] }
|
|
1784
|
+
* ```
|
|
1785
|
+
*
|
|
1786
|
+
* @example
|
|
1787
|
+
* ```jsonc
|
|
1788
|
+
* // Disable all syntax transformations
|
|
1789
|
+
* { "target": false }
|
|
1790
|
+
* ```
|
|
1791
|
+
*/
|
|
1792
|
+
target?: string | string[] | false;
|
|
1793
|
+
/**
|
|
1794
|
+
* Compile-time env variables, which can be accessed via `import.meta.env` or `process.env`.
|
|
1795
|
+
* @example
|
|
1796
|
+
* ```json
|
|
1797
|
+
* {
|
|
1798
|
+
* "DEBUG": true,
|
|
1799
|
+
* "NODE_ENV": "production"
|
|
1800
|
+
* }
|
|
1801
|
+
* ```
|
|
1802
|
+
*/
|
|
1803
|
+
env?: Record<string, any>;
|
|
1804
|
+
/**
|
|
1805
|
+
* Path to env file providing compile-time env variables.
|
|
1806
|
+
* @example
|
|
1807
|
+
* `.env`, `.env.production`, etc.
|
|
1808
|
+
*/
|
|
1809
|
+
envFile?: string;
|
|
1810
|
+
/**
|
|
1811
|
+
* When loading env variables from `envFile`, only include variables with these prefixes.
|
|
1812
|
+
* @default 'TSDOWN_'
|
|
1813
|
+
*/
|
|
1814
|
+
envPrefix?: string | string[];
|
|
1815
|
+
define?: Record<string, string>;
|
|
1816
|
+
/** @default false */
|
|
1817
|
+
shims?: boolean;
|
|
1818
|
+
/**
|
|
1819
|
+
* Configure tree shaking options.
|
|
1820
|
+
* @see {@link https://rolldown.rs/options/treeshake} for more details.
|
|
1821
|
+
* @default true
|
|
1822
|
+
*/
|
|
1823
|
+
treeshake?: boolean | TreeshakingOptions;
|
|
1824
|
+
/**
|
|
1825
|
+
* Sets how input files are processed.
|
|
1826
|
+
* For example, use 'js' to treat files as JavaScript or 'base64' for images.
|
|
1827
|
+
* Lets you import or require files like images or fonts.
|
|
1828
|
+
* @example
|
|
1829
|
+
* ```json
|
|
1830
|
+
* { '.jpg': 'asset', '.png': 'base64' }
|
|
1831
|
+
* ```
|
|
1832
|
+
*/
|
|
1833
|
+
loader?: ModuleTypes;
|
|
1834
|
+
/**
|
|
1835
|
+
* If enabled, strips the `node:` protocol prefix from import source.
|
|
1836
|
+
*
|
|
1837
|
+
* @default false
|
|
1838
|
+
* @deprecated Use `nodeProtocol: 'strip'` instead.
|
|
1839
|
+
*
|
|
1840
|
+
* @example
|
|
1841
|
+
* // With removeNodeProtocol enabled:
|
|
1842
|
+
* import('node:fs'); // becomes import('fs')
|
|
1843
|
+
*/
|
|
1844
|
+
removeNodeProtocol?: boolean;
|
|
1845
|
+
/**
|
|
1846
|
+
* - If `true`, add `node:` prefix to built-in modules.
|
|
1847
|
+
* - If `'strip'`, strips the `node:` protocol prefix from import source.
|
|
1848
|
+
* - If `false`, does not modify the import source.
|
|
1849
|
+
*
|
|
1850
|
+
* @default false
|
|
1851
|
+
*
|
|
1852
|
+
* @example
|
|
1853
|
+
* // With nodeProtocol enabled:
|
|
1854
|
+
* import('fs'); // becomes import('node:fs')
|
|
1855
|
+
* // With nodeProtocol set to 'strip':
|
|
1856
|
+
* import('node:fs'); // becomes import('fs')
|
|
1857
|
+
* // With nodeProtocol set to false:
|
|
1858
|
+
* import('node:fs'); // remains import('node:fs')
|
|
1859
|
+
*
|
|
1860
|
+
*/
|
|
1861
|
+
nodeProtocol?: "strip" | boolean;
|
|
1862
|
+
/**
|
|
1863
|
+
* Controls which warnings are emitted during the build process. Each option can be set to `true` (emit warning) or `false` (suppress warning).
|
|
1864
|
+
*/
|
|
1865
|
+
checks?: ChecksOptions & {
|
|
1866
|
+
/**
|
|
1867
|
+
* If the config includes the `cjs` format and
|
|
1868
|
+
* one of its target >= node 20.19.0 / 22.12.0,
|
|
1869
|
+
* warn the user about the deprecation of CommonJS.
|
|
1870
|
+
*
|
|
1871
|
+
* @default true
|
|
1872
|
+
*/
|
|
1873
|
+
legacyCjs?: boolean;
|
|
1874
|
+
};
|
|
1875
|
+
plugins?: InputOptions["plugins"];
|
|
1876
|
+
/**
|
|
1877
|
+
* Use with caution; ensure you understand the implications.
|
|
1878
|
+
*/
|
|
1879
|
+
inputOptions?: InputOptions | ((options: InputOptions, format: NormalizedFormat, context: {
|
|
1880
|
+
cjsDts: boolean;
|
|
1881
|
+
}) => Awaitable<InputOptions | void | null>);
|
|
1882
|
+
/** @default 'es' */
|
|
1883
|
+
format?: Format | Format[] | Partial<Record<Format, Partial<ResolvedConfig>>>;
|
|
1884
|
+
globalName?: string;
|
|
1885
|
+
/** @default 'dist' */
|
|
1886
|
+
outDir?: string;
|
|
1887
|
+
/**
|
|
1888
|
+
* Whether to write the files to disk.
|
|
1889
|
+
* This option is incompatible with watch mode.
|
|
1890
|
+
* @default true
|
|
1891
|
+
*/
|
|
1892
|
+
write?: boolean;
|
|
1893
|
+
/**
|
|
1894
|
+
* Whether to generate source map files.
|
|
1895
|
+
*
|
|
1896
|
+
* Note that this option will always be `true` if you have
|
|
1897
|
+
* [`declarationMap`](https://www.typescriptlang.org/tsconfig/#declarationMap)
|
|
1898
|
+
* option enabled in your `tsconfig.json`.
|
|
1899
|
+
*
|
|
1900
|
+
* @default false
|
|
1901
|
+
*/
|
|
1902
|
+
sourcemap?: Sourcemap;
|
|
1903
|
+
/**
|
|
1904
|
+
* Clean directories before build.
|
|
1905
|
+
*
|
|
1906
|
+
* Default to output directory.
|
|
1907
|
+
* @default true
|
|
1908
|
+
*/
|
|
1909
|
+
clean?: boolean | string[];
|
|
1910
|
+
/**
|
|
1911
|
+
* @default false
|
|
1912
|
+
*/
|
|
1913
|
+
minify?: boolean | "dce-only" | MinifyOptions;
|
|
1914
|
+
footer?: ChunkAddon;
|
|
1915
|
+
banner?: ChunkAddon;
|
|
1916
|
+
/**
|
|
1917
|
+
* Determines whether unbundle mode is enabled.
|
|
1918
|
+
* When set to true, the output files will mirror the input file structure.
|
|
1919
|
+
* @default false
|
|
1920
|
+
*/
|
|
1921
|
+
unbundle?: boolean;
|
|
1922
|
+
/**
|
|
1923
|
+
* @deprecated Use `unbundle` instead.
|
|
1924
|
+
* @default true
|
|
1925
|
+
*/
|
|
1926
|
+
bundle?: boolean;
|
|
1927
|
+
/**
|
|
1928
|
+
* Use a fixed extension for output files.
|
|
1929
|
+
* The extension will always be `.cjs` or `.mjs`.
|
|
1930
|
+
* Otherwise, it will depend on the package type.
|
|
1931
|
+
*
|
|
1932
|
+
* Defaults to `true` if `platform` is set to `node`, `false` otherwise.
|
|
1933
|
+
*/
|
|
1934
|
+
fixedExtension?: boolean;
|
|
1935
|
+
/**
|
|
1936
|
+
* Custom extensions for output files.
|
|
1937
|
+
* `fixedExtension` will be overridden by this option.
|
|
1938
|
+
*/
|
|
1939
|
+
outExtensions?: OutExtensionFactory;
|
|
1940
|
+
/**
|
|
1941
|
+
* If enabled, appends hash to chunk filenames.
|
|
1942
|
+
* @default true
|
|
1943
|
+
*/
|
|
1944
|
+
hash?: boolean;
|
|
1945
|
+
/**
|
|
1946
|
+
* @default true
|
|
1947
|
+
*/
|
|
1948
|
+
cjsDefault?: boolean;
|
|
1949
|
+
/**
|
|
1950
|
+
* Use with caution; ensure you understand the implications.
|
|
1951
|
+
*/
|
|
1952
|
+
outputOptions?: OutputOptions | ((options: OutputOptions, format: NormalizedFormat, context: {
|
|
1953
|
+
cjsDts: boolean;
|
|
1954
|
+
}) => Awaitable<OutputOptions | void | null>);
|
|
1955
|
+
/**
|
|
1956
|
+
* The working directory of the config file.
|
|
1957
|
+
* - Defaults to `process.cwd()` for root config.
|
|
1958
|
+
* - Defaults to the package directory for workspace config.
|
|
1959
|
+
*/
|
|
1960
|
+
cwd?: string;
|
|
1961
|
+
/**
|
|
1962
|
+
* The name to show in CLI output. This is useful for monorepos or workspaces.
|
|
1963
|
+
* When using workspace mode, this option defaults to the package name from package.json.
|
|
1964
|
+
* In non-workspace mode, this option must be set explicitly for the name to show in the CLI output.
|
|
1965
|
+
*/
|
|
1966
|
+
name?: string;
|
|
1967
|
+
/**
|
|
1968
|
+
* Log level.
|
|
1969
|
+
* @default 'info'
|
|
1970
|
+
*/
|
|
1971
|
+
logLevel?: LogLevel;
|
|
1972
|
+
/**
|
|
1973
|
+
* If true, fails the build on warnings.
|
|
1974
|
+
* @default 'ci-only'
|
|
1975
|
+
*/
|
|
1976
|
+
failOnWarn?: boolean | CIOption;
|
|
1977
|
+
/**
|
|
1978
|
+
* Custom logger.
|
|
1979
|
+
*/
|
|
1980
|
+
customLogger?: Logger;
|
|
1981
|
+
/**
|
|
1982
|
+
* Reuse config from Vite or Vitest (experimental)
|
|
1983
|
+
* @default false
|
|
1984
|
+
*/
|
|
1985
|
+
fromVite?: boolean | "vitest";
|
|
1986
|
+
/**
|
|
1987
|
+
* @default false
|
|
1988
|
+
*/
|
|
1989
|
+
watch?: boolean | Arrayable<string>;
|
|
1990
|
+
/**
|
|
1991
|
+
* Files or patterns to not watch while in watch mode.
|
|
1992
|
+
*/
|
|
1993
|
+
ignoreWatch?: Arrayable<string | RegExp>;
|
|
1994
|
+
/**
|
|
1995
|
+
* **[experimental]** Enable devtools.
|
|
1996
|
+
*
|
|
1997
|
+
*DevTools is still under development, and this is for early testers only.
|
|
1998
|
+
*
|
|
1999
|
+
* This may slow down the build process significantly.
|
|
2000
|
+
*
|
|
2001
|
+
* @default false
|
|
2002
|
+
*/
|
|
2003
|
+
devtools?: WithEnabled<DevtoolsOptions>;
|
|
2004
|
+
/**
|
|
2005
|
+
* You can specify command to be executed after a successful build, specially useful for Watch mode
|
|
2006
|
+
*/
|
|
2007
|
+
onSuccess?: string | ((config: ResolvedConfig, signal: AbortSignal) => void | Promise<void>);
|
|
2008
|
+
/**
|
|
2009
|
+
* Enables generation of TypeScript declaration files (`.d.ts`).
|
|
2010
|
+
*
|
|
2011
|
+
* By default, this option is auto-detected based on your project's `package.json`:
|
|
2012
|
+
* - If the `types` field is present, or if the main `exports` contains a `types` entry, declaration file generation is enabled by default.
|
|
2013
|
+
* - Otherwise, declaration file generation is disabled by default.
|
|
2014
|
+
*/
|
|
2015
|
+
dts?: WithEnabled<Options>;
|
|
2016
|
+
/**
|
|
2017
|
+
* Enable unused dependencies check with `unplugin-unused`
|
|
2018
|
+
* Requires `unplugin-unused` to be installed.
|
|
2019
|
+
* @default false
|
|
2020
|
+
*/
|
|
2021
|
+
unused?: WithEnabled<Options$1>;
|
|
2022
|
+
/**
|
|
2023
|
+
* Run publint after bundling.
|
|
2024
|
+
* Requires `publint` to be installed.
|
|
2025
|
+
* @default false
|
|
2026
|
+
*/
|
|
2027
|
+
publint?: WithEnabled<PublintOptions>;
|
|
2028
|
+
/**
|
|
2029
|
+
* Run `arethetypeswrong` after bundling.
|
|
2030
|
+
* Requires `@arethetypeswrong/core` to be installed.
|
|
2031
|
+
*
|
|
2032
|
+
* @default false
|
|
2033
|
+
* @see https://github.com/arethetypeswrong/arethetypeswrong.github.io
|
|
2034
|
+
*/
|
|
2035
|
+
attw?: WithEnabled<AttwOptions>;
|
|
2036
|
+
/**
|
|
2037
|
+
* Enable size reporting after bundling.
|
|
2038
|
+
* @default true
|
|
2039
|
+
*/
|
|
2040
|
+
report?: WithEnabled<ReportOptions>;
|
|
2041
|
+
/**
|
|
2042
|
+
* `import.meta.glob` support.
|
|
2043
|
+
* @see https://vite.dev/guide/features.html#glob-import
|
|
2044
|
+
* @default true
|
|
2045
|
+
*/
|
|
2046
|
+
globImport?: boolean;
|
|
2047
|
+
/**
|
|
2048
|
+
* Generate package exports for `package.json`.
|
|
2049
|
+
*
|
|
2050
|
+
* This will set the `main`, `module`, `types`, `exports` fields in `package.json`
|
|
2051
|
+
* to point to the generated files.
|
|
2052
|
+
*/
|
|
2053
|
+
exports?: WithEnabled<ExportsOptions>;
|
|
2054
|
+
/**
|
|
2055
|
+
* **[experimental]** CSS options.
|
|
2056
|
+
*/
|
|
2057
|
+
css?: CssOptions;
|
|
2058
|
+
/**
|
|
2059
|
+
* @deprecated Alias for `copy`, will be removed in the future.
|
|
2060
|
+
*/
|
|
2061
|
+
publicDir?: CopyOptions | CopyOptionsFn;
|
|
2062
|
+
/**
|
|
2063
|
+
* Copy files to another directory.
|
|
2064
|
+
* @example
|
|
2065
|
+
* ```ts
|
|
2066
|
+
* [
|
|
2067
|
+
* 'src/assets',
|
|
2068
|
+
* 'src/env.d.ts',
|
|
2069
|
+
* 'src/styles/**\/*.css',
|
|
2070
|
+
* { from: 'src/assets', to: 'dist/assets' },
|
|
2071
|
+
* { from: 'src/styles/**\/*.css', to: 'dist', flatten: true },
|
|
2072
|
+
* ]
|
|
2073
|
+
* ```
|
|
2074
|
+
*/
|
|
2075
|
+
copy?: CopyOptions | CopyOptionsFn;
|
|
2076
|
+
hooks?: Partial<TsdownHooks> | ((hooks: Hookable<TsdownHooks>) => Awaitable<void>);
|
|
2077
|
+
/**
|
|
2078
|
+
* **[experimental]** Enable workspace mode.
|
|
2079
|
+
* This allows you to build multiple packages in a monorepo.
|
|
2080
|
+
*/
|
|
2081
|
+
workspace?: Workspace | Arrayable<string> | true;
|
|
2082
|
+
}
|
|
2083
|
+
interface InlineConfig extends UserConfig {
|
|
2084
|
+
/**
|
|
2085
|
+
* Config file path
|
|
2086
|
+
*/
|
|
2087
|
+
config?: boolean | string;
|
|
2088
|
+
/**
|
|
2089
|
+
* Config loader to use. It can only be set via CLI or API.
|
|
2090
|
+
* @default 'auto'
|
|
2091
|
+
*/
|
|
2092
|
+
configLoader?: "auto" | "native" | "unrun";
|
|
2093
|
+
/**
|
|
2094
|
+
* Filter configs by cwd or name.
|
|
2095
|
+
*/
|
|
2096
|
+
filter?: RegExp | Arrayable<string>;
|
|
2097
|
+
}
|
|
2098
|
+
type UserConfigFn = (inlineConfig: InlineConfig, context: {
|
|
2099
|
+
ci: boolean;
|
|
2100
|
+
}) => Awaitable<Arrayable<UserConfig>>;
|
|
2101
|
+
type UserConfigExport = Awaitable<Arrayable<UserConfig> | UserConfigFn>;
|
|
2102
|
+
type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "fromVite" | "publicDir" | "bundle" | "removeNodeProtocol" | "logLevel" | "failOnWarn" | "customLogger" | "envFile" | "envPrefix">, "globalName" | "inputOptions" | "outputOptions" | "minify" | "define" | "alias" | "external" | "onSuccess" | "outExtensions" | "hooks" | "copy" | "loader" | "name" | "banner" | "footer" | "checks">, {
|
|
2103
|
+
/** Resolved entry map (after glob expansion) */entry: Record<string, string>;
|
|
2104
|
+
nameLabel: string | undefined;
|
|
2105
|
+
format: NormalizedFormat;
|
|
2106
|
+
target?: string[];
|
|
2107
|
+
clean: string[];
|
|
2108
|
+
pkg?: PackageJsonWithPath;
|
|
2109
|
+
nodeProtocol: "strip" | boolean;
|
|
2110
|
+
logger: Logger;
|
|
2111
|
+
ignoreWatch: Array<string | RegExp>;
|
|
2112
|
+
noExternal?: NoExternalFn;
|
|
2113
|
+
inlineOnly?: Array<string | RegExp> | false;
|
|
2114
|
+
css: Required<CssOptions>;
|
|
2115
|
+
dts: false | Options;
|
|
2116
|
+
report: false | ReportOptions;
|
|
2117
|
+
tsconfig: false | string;
|
|
2118
|
+
exports: false | ExportsOptions;
|
|
2119
|
+
devtools: false | DevtoolsOptions;
|
|
2120
|
+
publint: false | PublintOptions;
|
|
2121
|
+
attw: false | AttwOptions;
|
|
2122
|
+
unused: false | Options$1;
|
|
2123
|
+
}>; //#endregion
|
|
2124
|
+
//#endregion
|
|
2125
|
+
//#region ../../node_modules/.pnpm/tsdown@0.20.2_@arethetypeswrong+core@0.18.2_@typescript+native-preview@7.0.0-dev.202601_11c6934cad7d4cedf7999249d5905a1c/node_modules/tsdown/dist/options-DRXBLnH3.d.mts
|
|
2126
|
+
//#region src/config/options.d.ts
|
|
2127
|
+
/**
|
|
2128
|
+
* Resolve user config into resolved configs
|
|
2129
|
+
*
|
|
2130
|
+
* **Internal API, not for public use**
|
|
2131
|
+
* @private
|
|
2132
|
+
*/
|
|
2133
|
+
declare function resolveUserConfig(userConfig: UserConfig, inlineConfig: InlineConfig): Promise<ResolvedConfig[]>;
|
|
2134
|
+
declare function mergeConfig(defaults: UserConfig, overrides: UserConfig): UserConfig;
|
|
2135
|
+
declare function mergeConfig(defaults: InlineConfig, overrides: InlineConfig): InlineConfig; //#endregion
|
|
2136
|
+
//#endregion
|
|
2137
|
+
//#region ../../node_modules/.pnpm/tsdown@0.20.2_@arethetypeswrong+core@0.18.2_@typescript+native-preview@7.0.0-dev.202601_11c6934cad7d4cedf7999249d5905a1c/node_modules/tsdown/dist/config.d.mts
|
|
2138
|
+
//#region src/config.d.ts
|
|
2139
|
+
/**
|
|
2140
|
+
* Defines the configuration for tsdown.
|
|
2141
|
+
*/
|
|
2142
|
+
declare function defineConfig(options: UserConfig): UserConfig;
|
|
2143
|
+
declare function defineConfig(options: UserConfig[]): UserConfig[];
|
|
2144
|
+
declare function defineConfig(options: UserConfigFn): UserConfigFn;
|
|
2145
|
+
declare function defineConfig(options: UserConfigExport): UserConfigExport; //#endregion
|
|
2146
|
+
//#endregion
|
|
2147
|
+
//#region ../../node_modules/.pnpm/tsdown@0.20.2_@arethetypeswrong+core@0.18.2_@typescript+native-preview@7.0.0-dev.202601_11c6934cad7d4cedf7999249d5905a1c/node_modules/tsdown/dist/index.d.mts
|
|
2148
|
+
//#region src/build.d.ts
|
|
2149
|
+
/**
|
|
2150
|
+
* Build with tsdown.
|
|
2151
|
+
*/
|
|
2152
|
+
declare function build$1(inlineConfig?: InlineConfig): Promise<TsdownBundle[]>;
|
|
2153
|
+
/**
|
|
2154
|
+
* Build with `ResolvedConfigs`.
|
|
2155
|
+
*
|
|
2156
|
+
* **Internal API, not for public use**
|
|
2157
|
+
* @private
|
|
2158
|
+
*/
|
|
2159
|
+
declare function buildWithConfigs(configs: ResolvedConfig[], configFiles: string[], _restart: () => void): Promise<TsdownBundle[]>; //#endregion
|
|
2160
|
+
//#region src/features/debug.d.ts
|
|
2161
|
+
declare function enableDebug(debug?: boolean | Arrayable<string>): void; //#endregion
|
|
2162
|
+
//#endregion
|
|
2163
|
+
export { AttwOptions, BuildContext, CIOption, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, CssOptions, DevtoolsOptions, Options as DtsOptions, ExportsOptions, Format, InlineConfig, type Logger, NoExternalFn, NormalizedFormat, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageJsonWithPath, PackageType, PublintOptions, ReportOptions, ResolvedConfig, Rolldown, RolldownChunk, RolldownContext, Sourcemap, TreeshakingOptions, TsdownBundle, TsdownHooks, TsdownInputOption, Options$1 as UnusedOptions, type UserConfig, type UserConfigExport, type UserConfigFn, WithEnabled, Workspace, build$1 as build, buildWithConfigs, defineConfig, enableDebug, globalLogger, mergeConfig, resolveUserConfig };
|