powerlines 0.39.2 → 0.39.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-BuD5N0As.d.mts +2194 -0
- package/dist/api-BuD5N0As.d.mts.map +1 -0
- package/dist/api-C-mqhnKC.cjs +3875 -0
- package/dist/api-ChhnkGSI.d.cts +1698 -0
- package/dist/api-ChhnkGSI.d.cts.map +1 -0
- package/dist/api-T-H73E4T.mjs +3734 -0
- package/dist/api-T-H73E4T.mjs.map +1 -0
- package/dist/astro.cjs +11 -2
- package/dist/astro.d.cts +3 -1
- package/dist/astro.d.cts.map +1 -0
- package/dist/astro.d.mts +28 -0
- package/dist/astro.d.mts.map +1 -0
- package/dist/astro.mjs +35 -0
- package/dist/astro.mjs.map +1 -0
- package/dist/chunk-CbDLau6x.cjs +34 -0
- package/dist/config-CpdNhgYp.cjs +104 -0
- package/dist/config-D_NW727h.mjs +86 -0
- package/dist/config-D_NW727h.mjs.map +1 -0
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +40 -2
- package/dist/config.d.cts.map +1 -0
- package/dist/config.d.mts +39 -0
- package/dist/config.d.mts.map +1 -0
- package/dist/config.mjs +3 -0
- package/dist/context/index.cjs +12 -0
- package/dist/context/index.d.cts +589 -0
- package/dist/context/index.d.cts.map +1 -0
- package/dist/context/index.d.mts +590 -0
- package/dist/context/index.d.mts.map +1 -0
- package/dist/context/index.mjs +9 -0
- package/dist/esbuild-B6AjJQNM.mjs +44 -0
- package/dist/esbuild-B6AjJQNM.mjs.map +1 -0
- package/dist/esbuild-D3ARuxkm.cjs +56 -0
- package/dist/esbuild.cjs +13 -45
- package/dist/esbuild.d.cts +12 -2
- package/dist/esbuild.d.cts.map +1 -0
- package/dist/esbuild.d.mts +36 -0
- package/dist/esbuild.d.mts.map +1 -0
- package/dist/esbuild.mjs +11 -0
- package/dist/farm.cjs +9 -3
- package/dist/farm.d.cts +2 -1
- package/dist/farm.d.cts.map +1 -0
- package/dist/farm.d.mts +27 -0
- package/dist/farm.d.mts.map +1 -0
- package/dist/farm.mjs +33 -0
- package/dist/farm.mjs.map +1 -0
- package/dist/fs-s7b1bimL.d.cts +502 -0
- package/dist/fs-s7b1bimL.d.cts.map +1 -0
- package/dist/{api.d.cts → index-CWsicQay.d.mts} +136 -6
- package/dist/index-CWsicQay.d.mts.map +1 -0
- package/dist/index-DvuJXuAN.d.mts +1 -0
- package/dist/index-sEwKb5bx.d.cts +261 -0
- package/dist/index-sEwKb5bx.d.cts.map +1 -0
- package/dist/index.cjs +24 -25
- package/dist/index.d.cts +4 -23
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +34 -0
- package/dist/index.mjs.map +1 -0
- package/dist/next.cjs +9 -2
- package/dist/next.d.cts.map +1 -0
- package/dist/next.d.mts +26 -0
- package/dist/next.d.mts.map +1 -0
- package/dist/next.mjs +44 -0
- package/dist/next.mjs.map +1 -0
- package/dist/nuxt.cjs +16 -8
- package/dist/nuxt.d.cts +2 -1
- package/dist/nuxt.d.cts.map +1 -0
- package/dist/nuxt.d.mts +32 -0
- package/dist/nuxt.d.mts.map +1 -0
- package/dist/nuxt.mjs +53 -0
- package/dist/nuxt.mjs.map +1 -0
- package/dist/paths-B5rIDwuS.mjs +81 -0
- package/dist/paths-B5rIDwuS.mjs.map +1 -0
- package/dist/paths-DF6YACSl.cjs +98 -0
- package/dist/plugin-D0syOKee.d.mts +19 -0
- package/dist/plugin-D0syOKee.d.mts.map +1 -0
- package/dist/plugin-IDITIwvk.d.cts +19 -0
- package/dist/plugin-IDITIwvk.d.cts.map +1 -0
- package/dist/plugin-utils-C1UIpEix.mjs +448 -0
- package/dist/plugin-utils-C1UIpEix.mjs.map +1 -0
- package/dist/plugin-utils-DmI_79cQ.cjs +628 -0
- package/dist/plugin-utils.cjs +26 -34
- package/dist/plugin-utils.d.cts +269 -10
- package/dist/plugin-utils.d.cts.map +1 -0
- package/dist/plugin-utils.d.mts +270 -0
- package/dist/plugin-utils.d.mts.map +1 -0
- package/dist/plugin-utils.mjs +4 -0
- package/dist/resolve-options-DHVACMs1.cjs +236 -0
- package/dist/resolve-options-DJPbCzeD.cjs +78 -0
- package/dist/resolve-options-DYsg3TNE.mjs +219 -0
- package/dist/resolve-options-DYsg3TNE.mjs.map +1 -0
- package/dist/resolve-options-bpHCCeeZ.mjs +72 -0
- package/dist/resolve-options-bpHCCeeZ.mjs.map +1 -0
- package/dist/rolldown-CAbMEsec.mjs +36 -0
- package/dist/rolldown-CAbMEsec.mjs.map +1 -0
- package/dist/rolldown-FyD_r_kh.cjs +48 -0
- package/dist/rolldown.cjs +13 -37
- package/dist/rolldown.d.cts +12 -2
- package/dist/rolldown.d.cts.map +1 -0
- package/dist/rolldown.d.mts +35 -0
- package/dist/rolldown.d.mts.map +1 -0
- package/dist/rolldown.mjs +11 -0
- package/dist/rollup.cjs +10 -4
- package/dist/rollup.d.cts +12 -2
- package/dist/rollup.d.cts.map +1 -0
- package/dist/rollup.d.mts +36 -0
- package/dist/rollup.d.mts.map +1 -0
- package/dist/rollup.mjs +33 -0
- package/dist/rollup.mjs.map +1 -0
- package/dist/rspack.cjs +10 -4
- package/dist/rspack.d.cts +12 -2
- package/dist/rspack.d.cts.map +1 -0
- package/dist/rspack.d.mts +36 -0
- package/dist/rspack.d.mts.map +1 -0
- package/dist/rspack.mjs +33 -0
- package/dist/rspack.mjs.map +1 -0
- package/dist/storage/index.cjs +8 -0
- package/dist/storage/index.d.cts +400 -0
- package/dist/storage/index.d.cts.map +1 -0
- package/dist/storage/index.d.mts +401 -0
- package/dist/storage/index.d.mts.map +1 -0
- package/dist/storage/index.mjs +3 -0
- package/dist/tsconfig-B9iC-Cry.mjs +253 -0
- package/dist/tsconfig-B9iC-Cry.mjs.map +1 -0
- package/dist/tsconfig-C8M8X6U0.cjs +308 -0
- package/dist/tsdown.cjs +42 -6
- package/dist/tsdown.d.cts.map +1 -0
- package/dist/tsdown.d.mts +32 -0
- package/dist/tsdown.d.mts.map +1 -0
- package/dist/tsdown.mjs +115 -0
- package/dist/tsdown.mjs.map +1 -0
- package/dist/tsup.cjs +12 -4
- package/dist/tsup.d.cts.map +1 -0
- package/dist/tsup.d.mts +32 -0
- package/dist/tsup.d.mts.map +1 -0
- package/dist/tsup.mjs +68 -0
- package/dist/tsup.mjs.map +1 -0
- package/dist/types-pkiDVaba.d.mts +1 -0
- package/dist/typescript/index.cjs +11 -0
- package/dist/typescript/index.d.cts +107 -0
- package/dist/typescript/index.d.cts.map +1 -0
- package/dist/typescript/index.d.mts +107 -0
- package/dist/typescript/index.d.mts.map +1 -0
- package/dist/typescript/index.mjs +3 -0
- package/dist/unloader.cjs +9 -3
- package/dist/unloader.d.cts +2 -1
- package/dist/unloader.d.cts.map +1 -0
- package/dist/unloader.d.mts +24 -0
- package/dist/unloader.d.mts.map +1 -0
- package/dist/unloader.mjs +30 -0
- package/dist/unloader.mjs.map +1 -0
- package/dist/unplugin.cjs +13 -105
- package/dist/unplugin.d.cts +52 -8
- package/dist/unplugin.d.cts.map +1 -0
- package/dist/unplugin.d.mts +65 -0
- package/dist/unplugin.d.mts.map +1 -0
- package/dist/unplugin.mjs +9 -0
- package/dist/utils-BAz6iKW9.cjs +467 -0
- package/dist/utils-D7jVNUPZ.mjs +321 -0
- package/dist/utils-D7jVNUPZ.mjs.map +1 -0
- package/dist/utils.cjs +28 -36
- package/dist/utils.d.cts +155 -10
- package/dist/utils.d.cts.map +1 -0
- package/dist/utils.d.mts +155 -0
- package/dist/utils.d.mts.map +1 -0
- package/dist/utils.mjs +4 -0
- package/dist/virtual-6Kh9y_CV.cjs +512 -0
- package/dist/virtual-CmVZ0XJ3.mjs +477 -0
- package/dist/virtual-CmVZ0XJ3.mjs.map +1 -0
- package/dist/vite-BhX15zSy.cjs +143 -0
- package/dist/vite-CTT9RoCm.mjs +130 -0
- package/dist/vite-CTT9RoCm.mjs.map +1 -0
- package/dist/vite.cjs +14 -69
- package/dist/vite.d.cts +3 -1
- package/dist/vite.d.cts.map +1 -0
- package/dist/vite.d.mts +28 -0
- package/dist/vite.d.mts.map +1 -0
- package/dist/vite.mjs +12 -0
- package/dist/webpack-C6U5ooz_.cjs +38 -0
- package/dist/webpack-CLuu79I6.mjs +26 -0
- package/dist/webpack-CLuu79I6.mjs.map +1 -0
- package/dist/webpack.cjs +12 -27
- package/dist/webpack.d.cts +12 -2
- package/dist/webpack.d.cts.map +1 -0
- package/dist/webpack.d.mts +35 -0
- package/dist/webpack.d.mts.map +1 -0
- package/dist/webpack.mjs +10 -0
- package/package.json +14 -15
- package/dist/api.cjs +0 -576
- package/dist/types.cjs +0 -6
|
@@ -0,0 +1,2194 @@
|
|
|
1
|
+
import { ResolveOptions } from "@stryke/fs/resolve";
|
|
2
|
+
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
3
|
+
import MagicString, { SourceMap } from "magic-string";
|
|
4
|
+
import ts from "typescript";
|
|
5
|
+
import { ConfigLayer, ResolvedConfig } from "c12";
|
|
6
|
+
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
7
|
+
import { FetchRequestOptions } from "@stryke/http/fetch";
|
|
8
|
+
import { CompatibilityDateSpec, CompatibilityDates } from "compatx";
|
|
9
|
+
import { ParseResult, ParserOptions } from "oxc-parser";
|
|
10
|
+
import { RequestInfo, Response } from "undici";
|
|
11
|
+
import { Jiti } from "jiti";
|
|
12
|
+
import { ExternalIdResult, HookFilter, TransformResult, UnpluginBuildContext, UnpluginContext, UnpluginContextMeta, UnpluginMessage, UnpluginOptions } from "unplugin";
|
|
13
|
+
import { Format } from "@storm-software/build-tools/types";
|
|
14
|
+
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
15
|
+
import { AnyFunction, DeepPartial, MaybePromise, NonUndefined } from "@stryke/types/base";
|
|
16
|
+
import { TypeDefinition } from "@stryke/types/configuration";
|
|
17
|
+
import { AssetGlob } from "@stryke/types/file";
|
|
18
|
+
import { PreviewOptions, ResolvedConfig as ResolvedConfig$1, ResolvedPreviewOptions } from "vite";
|
|
19
|
+
import { PackageJson } from "@stryke/types/package-json";
|
|
20
|
+
import { Worker } from "jest-worker";
|
|
21
|
+
import { Range } from "semver";
|
|
22
|
+
import { Unimport } from "unimport";
|
|
23
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
24
|
+
import { LoadResult } from "rollup";
|
|
25
|
+
import { CompilerOptions, TsConfigJson } from "@stryke/types/tsconfig";
|
|
26
|
+
|
|
27
|
+
//#region ../core/src/types/fs.d.ts
|
|
28
|
+
type VirtualFileExtension = "js" | "ts" | "jsx" | "tsx";
|
|
29
|
+
declare const __VFS_PATCH__ = "__VFS_PATCH__";
|
|
30
|
+
declare const __VFS_REVERT__ = "__VFS_REVERT__";
|
|
31
|
+
type StoragePreset = "fs" | "virtual";
|
|
32
|
+
declare const STORAGE_PRESETS: StoragePreset[];
|
|
33
|
+
/**
|
|
34
|
+
* Interface defining the methods and properties for a storage adapter.
|
|
35
|
+
*/
|
|
36
|
+
interface StorageAdapter {
|
|
37
|
+
/**
|
|
38
|
+
* A name identifying the storage adapter type.
|
|
39
|
+
*/
|
|
40
|
+
name: string;
|
|
41
|
+
/**
|
|
42
|
+
* The storage preset for the adapter.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* This can be used as an alternate way to identify the type of storage being used.
|
|
46
|
+
*/
|
|
47
|
+
preset?: StoragePreset | null;
|
|
48
|
+
/**
|
|
49
|
+
* Checks if a key exists in the storage.
|
|
50
|
+
*
|
|
51
|
+
* @param key - The key to check for existence.
|
|
52
|
+
* @returns A promise that resolves to `true` if the key exists, otherwise `false`.
|
|
53
|
+
*/
|
|
54
|
+
exists: (key: string) => Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Synchronously checks if a key exists in the storage.
|
|
57
|
+
*
|
|
58
|
+
* @param key - The key to check for existence.
|
|
59
|
+
* @returns Returns `true` if the key exists, otherwise `false`.
|
|
60
|
+
*/
|
|
61
|
+
existsSync: (key: string) => boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Read a value associated with a key from the storage.
|
|
64
|
+
*
|
|
65
|
+
* @param key - The key to read the value for.
|
|
66
|
+
* @returns A promise that resolves to the value if found, otherwise `null`.
|
|
67
|
+
*/
|
|
68
|
+
get: (key: string) => Promise<string | null>;
|
|
69
|
+
/**
|
|
70
|
+
* Synchronously reads the value associated with a key from the storage.
|
|
71
|
+
*
|
|
72
|
+
* @param key - The key to read the value for.
|
|
73
|
+
* @returns The value if found, otherwise `null`.
|
|
74
|
+
*/
|
|
75
|
+
getSync: (key: string) => string | null;
|
|
76
|
+
/**
|
|
77
|
+
* Writes a value to the storage for the given key.
|
|
78
|
+
*
|
|
79
|
+
* @param key - The key to associate the value with.
|
|
80
|
+
* @param value - The value to store.
|
|
81
|
+
*/
|
|
82
|
+
set: (key: string, value: string) => Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Synchronously writes a value to the storage for the given key.
|
|
85
|
+
*
|
|
86
|
+
* @param key - The key to associate the value with.
|
|
87
|
+
* @param value - The value to store.
|
|
88
|
+
*/
|
|
89
|
+
setSync: (key: string, value: string) => void;
|
|
90
|
+
/**
|
|
91
|
+
* Removes a value from the storage.
|
|
92
|
+
*
|
|
93
|
+
* @param key - The key whose value should be removed.
|
|
94
|
+
*/
|
|
95
|
+
remove: (key: string) => Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Synchronously removes a value from the storage.
|
|
98
|
+
*
|
|
99
|
+
* @param key - The key whose value should be removed.
|
|
100
|
+
*/
|
|
101
|
+
removeSync: (key: string) => void;
|
|
102
|
+
/**
|
|
103
|
+
* Creates a directory at the specified path.
|
|
104
|
+
*
|
|
105
|
+
* @param dirPath - The path of the directory to create.
|
|
106
|
+
*/
|
|
107
|
+
mkdir: (dirPath: string) => Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Synchronously creates a directory at the specified path.
|
|
110
|
+
*
|
|
111
|
+
* @param dirPath - The path of the directory to create.
|
|
112
|
+
*/
|
|
113
|
+
mkdirSync: (dirPath: string) => void;
|
|
114
|
+
/**
|
|
115
|
+
* Remove all entries from the storage that match the provided base path.
|
|
116
|
+
*
|
|
117
|
+
* @param base - The base path or prefix to clear entries from.
|
|
118
|
+
*/
|
|
119
|
+
clear: (base?: string) => Promise<void>;
|
|
120
|
+
/**
|
|
121
|
+
* Synchronously remove all entries from the storage that match the provided base path.
|
|
122
|
+
*
|
|
123
|
+
* @param base - The base path or prefix to clear entries from.
|
|
124
|
+
*/
|
|
125
|
+
clearSync: (base?: string) => void;
|
|
126
|
+
/**
|
|
127
|
+
* Lists all keys under the provided base path.
|
|
128
|
+
*
|
|
129
|
+
* @param base - The base path or prefix to list keys from.
|
|
130
|
+
* @returns A promise resolving to the list of keys.
|
|
131
|
+
*/
|
|
132
|
+
list: (base?: string) => Promise<string[]>;
|
|
133
|
+
/**
|
|
134
|
+
* Synchronously lists all keys under the provided base path.
|
|
135
|
+
*
|
|
136
|
+
* @param base - The base path or prefix to list keys from.
|
|
137
|
+
* @returns The list of keys.
|
|
138
|
+
*/
|
|
139
|
+
listSync: (base?: string) => string[];
|
|
140
|
+
/**
|
|
141
|
+
* Checks if the given key is a directory.
|
|
142
|
+
*
|
|
143
|
+
* @param key - The key to check.
|
|
144
|
+
* @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.
|
|
145
|
+
*/
|
|
146
|
+
isDirectory: (key: string) => Promise<boolean>;
|
|
147
|
+
/**
|
|
148
|
+
* Synchronously checks if the given key is a directory.
|
|
149
|
+
*
|
|
150
|
+
* @param key - The key to check.
|
|
151
|
+
* @returns `true` if the key is a directory, otherwise `false`.
|
|
152
|
+
*/
|
|
153
|
+
isDirectorySync: (key: string) => boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Checks if the given key is a file.
|
|
156
|
+
*
|
|
157
|
+
* @param key - The key to check.
|
|
158
|
+
* @returns A promise that resolves to `true` if the key is a file, otherwise `false`.
|
|
159
|
+
*/
|
|
160
|
+
isFile: (key: string) => Promise<boolean>;
|
|
161
|
+
/**
|
|
162
|
+
* Synchronously checks if the given key is a file.
|
|
163
|
+
*
|
|
164
|
+
* @param key - The key to check.
|
|
165
|
+
* @returns `true` if the key is a file, otherwise `false`.
|
|
166
|
+
*/
|
|
167
|
+
isFileSync: (key: string) => boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Releases any resources held by the storage adapter.
|
|
170
|
+
*/
|
|
171
|
+
dispose: () => MaybePromise<void>;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* A mapping of file paths to storage adapter names and their corresponding {@link StorageAdapter} instances.
|
|
175
|
+
*/
|
|
176
|
+
type StoragePort = Record<string, StorageAdapter>;
|
|
177
|
+
interface VirtualFileMetadata {
|
|
178
|
+
/**
|
|
179
|
+
* The identifier for the file data.
|
|
180
|
+
*/
|
|
181
|
+
id: string;
|
|
182
|
+
/**
|
|
183
|
+
* The timestamp of the virtual file.
|
|
184
|
+
*/
|
|
185
|
+
timestamp: number;
|
|
186
|
+
/**
|
|
187
|
+
* The type of the file.
|
|
188
|
+
*
|
|
189
|
+
* @remarks
|
|
190
|
+
* This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
|
|
191
|
+
* - `builtin`: Indicates that the file is a built-in module provided by the system.
|
|
192
|
+
* - `entry`: Indicates that the file is an entry point for execution.
|
|
193
|
+
* - `normal`: Indicates that the file is a standard file without any special role.
|
|
194
|
+
*/
|
|
195
|
+
type: string;
|
|
196
|
+
/**
|
|
197
|
+
* Additional metadata associated with the file.
|
|
198
|
+
*/
|
|
199
|
+
properties: Record<string, string | undefined>;
|
|
200
|
+
}
|
|
201
|
+
interface VirtualFileData {
|
|
202
|
+
/**
|
|
203
|
+
* The identifier for the file data.
|
|
204
|
+
*/
|
|
205
|
+
id?: string;
|
|
206
|
+
/**
|
|
207
|
+
* The contents of the virtual file.
|
|
208
|
+
*/
|
|
209
|
+
code: string;
|
|
210
|
+
/**
|
|
211
|
+
* The type of the file.
|
|
212
|
+
*
|
|
213
|
+
* @remarks
|
|
214
|
+
* This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
|
|
215
|
+
* - `builtin`: Indicates that the file is a built-in module provided by the system.
|
|
216
|
+
* - `entry`: Indicates that the file is an entry point for execution.
|
|
217
|
+
* - `normal`: Indicates that the file is a standard file without any special role.
|
|
218
|
+
*/
|
|
219
|
+
type?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Additional metadata associated with the file.
|
|
222
|
+
*/
|
|
223
|
+
properties?: Record<string, string | undefined>;
|
|
224
|
+
}
|
|
225
|
+
interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
|
|
226
|
+
/**
|
|
227
|
+
* An additional name for the file.
|
|
228
|
+
*/
|
|
229
|
+
path: string;
|
|
230
|
+
/**
|
|
231
|
+
* The timestamp of the virtual file.
|
|
232
|
+
*/
|
|
233
|
+
timestamp: number;
|
|
234
|
+
}
|
|
235
|
+
interface WriteOptions {
|
|
236
|
+
/**
|
|
237
|
+
* Should the file skip formatting before being written?
|
|
238
|
+
*
|
|
239
|
+
* @defaultValue false
|
|
240
|
+
*/
|
|
241
|
+
skipFormat?: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* The storage preset or adapter name for the output file.
|
|
244
|
+
*
|
|
245
|
+
* @remarks
|
|
246
|
+
* If not specified, the output mode will be determined by the provided `output.mode` value.
|
|
247
|
+
*/
|
|
248
|
+
storage?: StoragePreset | string;
|
|
249
|
+
/**
|
|
250
|
+
* Additional metadata for the file.
|
|
251
|
+
*/
|
|
252
|
+
meta?: Partial<VirtualFileMetadata>;
|
|
253
|
+
}
|
|
254
|
+
type WriteData = string | NodeJS.ArrayBufferView | VirtualFileData;
|
|
255
|
+
interface ResolveOptions$1 extends ResolveOptions {
|
|
256
|
+
/**
|
|
257
|
+
* If true, the module is being resolved as an entry point.
|
|
258
|
+
*/
|
|
259
|
+
isEntry?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* If true, the resolver will skip alias resolution when resolving modules.
|
|
262
|
+
*/
|
|
263
|
+
skipAlias?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* If true, the resolver will skip using the cache when resolving modules.
|
|
266
|
+
*/
|
|
267
|
+
skipCache?: boolean;
|
|
268
|
+
/**
|
|
269
|
+
* An array of external modules or patterns to exclude from resolution.
|
|
270
|
+
*/
|
|
271
|
+
external?: (string | RegExp)[];
|
|
272
|
+
/**
|
|
273
|
+
* An array of modules or patterns to include in the resolution, even if they are marked as external.
|
|
274
|
+
*/
|
|
275
|
+
noExternal?: (string | RegExp)[];
|
|
276
|
+
/**
|
|
277
|
+
* An array of patterns to match when resolving modules.
|
|
278
|
+
*/
|
|
279
|
+
skipNodeModulesBundle?: boolean;
|
|
280
|
+
}
|
|
281
|
+
interface VirtualFileSystemInterface {
|
|
282
|
+
/**
|
|
283
|
+
* The underlying file metadata.
|
|
284
|
+
*/
|
|
285
|
+
metadata: Readonly<Record<string, VirtualFileMetadata>>;
|
|
286
|
+
/**
|
|
287
|
+
* A map of file paths to their module ids.
|
|
288
|
+
*/
|
|
289
|
+
ids: Readonly<Record<string, string>>;
|
|
290
|
+
/**
|
|
291
|
+
* A map of module ids to their file paths.
|
|
292
|
+
*/
|
|
293
|
+
paths: Readonly<Record<string, string>>;
|
|
294
|
+
/**
|
|
295
|
+
* Checks if a file exists in the virtual file system (VFS).
|
|
296
|
+
*
|
|
297
|
+
* @param path - The path or id of the file.
|
|
298
|
+
* @returns `true` if the file exists, otherwise `false`.
|
|
299
|
+
*/
|
|
300
|
+
exists: (path: string) => Promise<boolean>;
|
|
301
|
+
/**
|
|
302
|
+
* Synchronously Checks if a file exists in the virtual file system (VFS).
|
|
303
|
+
*
|
|
304
|
+
* @param path - The path or id of the file.
|
|
305
|
+
* @returns `true` if the file exists, otherwise `false`.
|
|
306
|
+
*/
|
|
307
|
+
existsSync: (path: string) => boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Checks if a file is virtual in the virtual file system (VFS).
|
|
310
|
+
*
|
|
311
|
+
* @param path - The path or id of the file.
|
|
312
|
+
* @returns `true` if the file is virtual, otherwise `false`.
|
|
313
|
+
*/
|
|
314
|
+
isVirtual: (path: string) => boolean;
|
|
315
|
+
/**
|
|
316
|
+
* Checks if the given key is a directory.
|
|
317
|
+
*
|
|
318
|
+
* @param key - The key to check.
|
|
319
|
+
* @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.
|
|
320
|
+
*/
|
|
321
|
+
isDirectory: (key: string) => Promise<boolean>;
|
|
322
|
+
/**
|
|
323
|
+
* Synchronously checks if the given key is a directory.
|
|
324
|
+
*
|
|
325
|
+
* @param key - The key to check.
|
|
326
|
+
* @returns `true` if the key is a directory, otherwise `false`.
|
|
327
|
+
*/
|
|
328
|
+
isDirectorySync: (key: string) => boolean;
|
|
329
|
+
/**
|
|
330
|
+
* Checks if the given key is a file.
|
|
331
|
+
*
|
|
332
|
+
* @param key - The key to check.
|
|
333
|
+
* @returns A promise that resolves to `true` if the key is a file, otherwise `false`.
|
|
334
|
+
*/
|
|
335
|
+
isFile: (key: string) => Promise<boolean>;
|
|
336
|
+
/**
|
|
337
|
+
* Synchronously checks if the given key is a file.
|
|
338
|
+
*
|
|
339
|
+
* @param key - The key to check.
|
|
340
|
+
* @returns `true` if the key is a file, otherwise `false`.
|
|
341
|
+
*/
|
|
342
|
+
isFileSync: (key: string) => boolean;
|
|
343
|
+
/**
|
|
344
|
+
* Gets the metadata of a file in the virtual file system (VFS).
|
|
345
|
+
*
|
|
346
|
+
* @param path - The path or id of the file.
|
|
347
|
+
* @returns The metadata of the file if it exists, otherwise undefined.
|
|
348
|
+
*/
|
|
349
|
+
getMetadata: (path: string) => VirtualFileMetadata | undefined;
|
|
350
|
+
/**
|
|
351
|
+
* Lists files in a given path.
|
|
352
|
+
*
|
|
353
|
+
* @param path - The path to list files from.
|
|
354
|
+
* @returns An array of file names in the specified path.
|
|
355
|
+
*/
|
|
356
|
+
listSync: (path: string) => string[];
|
|
357
|
+
/**
|
|
358
|
+
* Lists files in a given path.
|
|
359
|
+
*
|
|
360
|
+
* @param path - The path to list files from.
|
|
361
|
+
* @returns An array of file names in the specified path.
|
|
362
|
+
*/
|
|
363
|
+
list: (path: string) => Promise<string[]>;
|
|
364
|
+
/**
|
|
365
|
+
* Removes a file or symbolic link in the virtual file system (VFS).
|
|
366
|
+
*
|
|
367
|
+
* @param path - The path to the file to remove.
|
|
368
|
+
* @returns A promise that resolves when the file is removed.
|
|
369
|
+
*/
|
|
370
|
+
removeSync: (path: string) => void;
|
|
371
|
+
/**
|
|
372
|
+
* Asynchronously removes a file or symbolic link in the virtual file system (VFS).
|
|
373
|
+
*
|
|
374
|
+
* @param path - The path to the file to remove.
|
|
375
|
+
* @returns A promise that resolves when the file is removed.
|
|
376
|
+
*/
|
|
377
|
+
remove: (path: string) => Promise<void>;
|
|
378
|
+
/**
|
|
379
|
+
* Reads a file from the virtual file system (VFS).
|
|
380
|
+
*
|
|
381
|
+
* @param path - The path or id of the file.
|
|
382
|
+
* @returns The contents of the file if it exists, otherwise undefined.
|
|
383
|
+
*/
|
|
384
|
+
read: (path: string) => Promise<string | undefined>;
|
|
385
|
+
/**
|
|
386
|
+
* Reads a file from the virtual file system (VFS).
|
|
387
|
+
*
|
|
388
|
+
* @param path - The path or id of the file.
|
|
389
|
+
*/
|
|
390
|
+
readSync: (path: string) => string | undefined;
|
|
391
|
+
/**
|
|
392
|
+
* Writes a file to the virtual file system (VFS).
|
|
393
|
+
*
|
|
394
|
+
* @param path - The path to the file.
|
|
395
|
+
* @param data - The contents of the file.
|
|
396
|
+
* @param options - Options for writing the file.
|
|
397
|
+
* @returns A promise that resolves when the file is written.
|
|
398
|
+
*/
|
|
399
|
+
write: (path: string, data: string, options?: WriteOptions) => Promise<void>;
|
|
400
|
+
/**
|
|
401
|
+
* Writes a file to the virtual file system (VFS).
|
|
402
|
+
*
|
|
403
|
+
* @param path - The path to the file.
|
|
404
|
+
* @param data - The contents of the file.
|
|
405
|
+
* @param options - Options for writing the file.
|
|
406
|
+
*/
|
|
407
|
+
writeSync: (path: string, data: string, options?: WriteOptions) => void;
|
|
408
|
+
/**
|
|
409
|
+
* Creates a directory at the specified path.
|
|
410
|
+
*
|
|
411
|
+
* @param dirPath - The path of the directory to create.
|
|
412
|
+
*/
|
|
413
|
+
mkdir: (dirPath: string) => Promise<void>;
|
|
414
|
+
/**
|
|
415
|
+
* Synchronously creates a directory at the specified path.
|
|
416
|
+
*
|
|
417
|
+
* @param dirPath - The path of the directory to create.
|
|
418
|
+
*/
|
|
419
|
+
mkdirSync: (dirPath: string) => void;
|
|
420
|
+
/**
|
|
421
|
+
* Moves a file from one path to another in the virtual file system (VFS).
|
|
422
|
+
*
|
|
423
|
+
* @param srcPath - The source path to move
|
|
424
|
+
* @param destPath - The destination path to move to
|
|
425
|
+
*/
|
|
426
|
+
move: (srcPath: string, destPath: string) => Promise<void>;
|
|
427
|
+
/**
|
|
428
|
+
* Synchronously moves a file from one path to another in the virtual file system (VFS).
|
|
429
|
+
*
|
|
430
|
+
* @param srcPath - The source path to move
|
|
431
|
+
* @param destPath - The destination path to move to
|
|
432
|
+
*/
|
|
433
|
+
moveSync: (srcPath: string, destPath: string) => void;
|
|
434
|
+
/**
|
|
435
|
+
* Copies a file from one path to another in the virtual file system (VFS).
|
|
436
|
+
*
|
|
437
|
+
* @param srcPath - The source path to copy
|
|
438
|
+
* @param destPath - The destination path to copy to
|
|
439
|
+
*/
|
|
440
|
+
copy: (srcPath: string | URL | Omit<AssetGlob, "output">, destPath: string | URL) => Promise<void>;
|
|
441
|
+
/**
|
|
442
|
+
* Synchronously copies a file from one path to another in the virtual file system (VFS).
|
|
443
|
+
*
|
|
444
|
+
* @param srcPath - The source path to copy
|
|
445
|
+
* @param destPath - The destination path to copy to
|
|
446
|
+
*/
|
|
447
|
+
copySync: (srcPath: string | URL | Omit<AssetGlob, "output">, destPath: string | URL) => void;
|
|
448
|
+
/**
|
|
449
|
+
* Glob files in the virtual file system (VFS) based on the provided pattern(s).
|
|
450
|
+
*
|
|
451
|
+
* @param pattern - A pattern (or multiple patterns) to use to determine the file paths to return
|
|
452
|
+
* @returns An array of file paths matching the provided pattern(s)
|
|
453
|
+
*/
|
|
454
|
+
glob: (patterns: string | Omit<AssetGlob, "output"> | (string | Omit<AssetGlob, "output">)[]) => Promise<string[]>;
|
|
455
|
+
/**
|
|
456
|
+
* Synchronously glob files in the virtual file system (VFS) based on the provided pattern(s).
|
|
457
|
+
*
|
|
458
|
+
* @param pattern - A pattern (or multiple patterns) to use to determine the file paths to return
|
|
459
|
+
* @returns An array of file paths matching the provided pattern(s)
|
|
460
|
+
*/
|
|
461
|
+
globSync: (patterns: string | Omit<AssetGlob, "output"> | (string | Omit<AssetGlob, "output">)[]) => string[];
|
|
462
|
+
/**
|
|
463
|
+
* A helper function to resolve modules using the Jiti resolver
|
|
464
|
+
*
|
|
465
|
+
* @remarks
|
|
466
|
+
* This function can be used to resolve modules relative to the project root directory.
|
|
467
|
+
*
|
|
468
|
+
* @example
|
|
469
|
+
* ```ts
|
|
470
|
+
* const resolvedPath = await context.resolve("some-module", "/path/to/importer");
|
|
471
|
+
* ```
|
|
472
|
+
*
|
|
473
|
+
* @param id - The module to resolve.
|
|
474
|
+
* @param importer - An optional path to the importer module.
|
|
475
|
+
* @param options - Additional resolution options.
|
|
476
|
+
* @returns A promise that resolves to the resolved module path.
|
|
477
|
+
*/
|
|
478
|
+
resolve: (id: string, importer?: string, options?: ResolveOptions$1) => Promise<string | undefined>;
|
|
479
|
+
/**
|
|
480
|
+
* A synchronous helper function to resolve modules using the Jiti resolver
|
|
481
|
+
*
|
|
482
|
+
* @remarks
|
|
483
|
+
* This function can be used to resolve modules relative to the project root directory.
|
|
484
|
+
*
|
|
485
|
+
* @example
|
|
486
|
+
* ```ts
|
|
487
|
+
* const resolvedPath = context.resolveSync("some-module", "/path/to/importer");
|
|
488
|
+
* ```
|
|
489
|
+
*
|
|
490
|
+
* @param id - The module to resolve.
|
|
491
|
+
* @param importer - An optional path to the importer module.
|
|
492
|
+
* @param options - Additional resolution options.
|
|
493
|
+
* @returns The resolved module path.
|
|
494
|
+
*/
|
|
495
|
+
resolveSync: (id: string, importer?: string, options?: ResolveOptions$1) => string | undefined;
|
|
496
|
+
/**
|
|
497
|
+
* Resolves a given module ID using the configured aliases.
|
|
498
|
+
*
|
|
499
|
+
* @remarks
|
|
500
|
+
* This function can be used to map module IDs to different paths based on the alias configuration.
|
|
501
|
+
*
|
|
502
|
+
* @param id - The module ID to resolve.
|
|
503
|
+
* @returns The resolved module ID - after applying any configured aliases (this will be the same as the input ID if no aliases match).
|
|
504
|
+
*/
|
|
505
|
+
resolveAlias: (id: string) => string;
|
|
506
|
+
/**
|
|
507
|
+
* Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
|
|
508
|
+
*/
|
|
509
|
+
dispose: () => Promise<void>;
|
|
510
|
+
}
|
|
511
|
+
declare type __ΩVirtualFileExtension = any[];
|
|
512
|
+
declare type __ΩStoragePreset = any[];
|
|
513
|
+
declare type __ΩStorageAdapter = any[];
|
|
514
|
+
declare type __ΩStoragePort = any[];
|
|
515
|
+
declare type __ΩVirtualFileMetadata = any[];
|
|
516
|
+
declare type __ΩVirtualFileData = any[];
|
|
517
|
+
declare type __ΩVirtualFile = any[];
|
|
518
|
+
declare type __ΩWriteOptions = any[];
|
|
519
|
+
declare type __ΩWriteData = any[];
|
|
520
|
+
declare type __ΩResolveOptions = any[];
|
|
521
|
+
declare type __ΩVirtualFileSystemInterface = any[];
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region ../core/src/types/commands.d.ts
|
|
524
|
+
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
525
|
+
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
526
|
+
type Commands<TContext extends Context = Context> = Record<CommandType, (this: TContext) => MaybePromise<void>>;
|
|
527
|
+
declare type __ΩCommandType = any[];
|
|
528
|
+
declare type __ΩCommands = any[];
|
|
529
|
+
//#endregion
|
|
530
|
+
//#region ../core/src/types/unplugin.d.ts
|
|
531
|
+
type UnpluginBuilderVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown" | "bun";
|
|
532
|
+
declare const UNPLUGIN_BUILDER_VARIANTS: UnpluginBuilderVariant[];
|
|
533
|
+
type BuilderVariant = UnpluginBuilderVariant | "tsup" | "tsdown" | "unbuild";
|
|
534
|
+
declare const BUILDER_VARIANTS: BuilderVariant[];
|
|
535
|
+
type InferUnpluginVariant<TBuildVariant extends BuilderVariant> = TBuildVariant extends "tsup" ? "esbuild" : TBuildVariant extends "tsdown" ? "rolldown" : TBuildVariant extends "unbuild" ? "rollup" : TBuildVariant;
|
|
536
|
+
interface UnpluginOptions$1<TContext extends Context = Context> extends UnpluginOptions {
|
|
537
|
+
/**
|
|
538
|
+
* An API object that can be used for inter-plugin communication.
|
|
539
|
+
*
|
|
540
|
+
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
541
|
+
*/
|
|
542
|
+
api: API<TContext["config"]>;
|
|
543
|
+
}
|
|
544
|
+
type InferUnpluginOptions<TContext extends Context = Context, TBuilderVariant$1 extends BuilderVariant = BuilderVariant, TUnpluginVariant extends InferUnpluginVariant<TBuilderVariant$1> = InferUnpluginVariant<TBuilderVariant$1>> = { [TKey in keyof Required<UnpluginOptions$1<TContext>>[TUnpluginVariant]]?: Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] extends infer THandler | {
|
|
545
|
+
handler: infer THandler;
|
|
546
|
+
} ? THandler extends ((this: infer TOriginalContext, ...args: infer TArgs) => infer TReturn) ? PluginHook<(this: TOriginalContext & TContext, ...args: TArgs) => MaybePromise<TReturn>, keyof HookFilter> : Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] : Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] };
|
|
547
|
+
type UnpluginUserConfig = UserConfig$1 & {
|
|
548
|
+
/**
|
|
549
|
+
* The meta information for the unplugin context
|
|
550
|
+
*/
|
|
551
|
+
unplugin: UnpluginContextMeta;
|
|
552
|
+
};
|
|
553
|
+
type UnpluginFactory<TContext extends Context = Context> = (options: Partial<TContext["config"]["userConfig"]>, meta: UnpluginContextMeta) => UnpluginOptions$1<TContext>;
|
|
554
|
+
declare type __ΩUnpluginBuilderVariant = any[];
|
|
555
|
+
declare type __ΩBuilderVariant = any[];
|
|
556
|
+
declare type __ΩInferUnpluginVariant = any[];
|
|
557
|
+
declare type __ΩUnpluginOptions = any[];
|
|
558
|
+
declare type __ΩInferUnpluginOptions = any[];
|
|
559
|
+
declare type __ΩUnpluginUserConfig = any[];
|
|
560
|
+
declare type __ΩUnpluginFactory = any[];
|
|
561
|
+
//#endregion
|
|
562
|
+
//#region ../core/src/types/plugin.d.ts
|
|
563
|
+
interface PluginHookObject<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> {
|
|
564
|
+
/**
|
|
565
|
+
* The order in which the plugin should be applied.
|
|
566
|
+
*/
|
|
567
|
+
order?: "pre" | "post" | null | undefined;
|
|
568
|
+
/**
|
|
569
|
+
* A filter to determine when the hook should be called.
|
|
570
|
+
*/
|
|
571
|
+
filter?: Pick<HookFilter, TFilter>;
|
|
572
|
+
/**
|
|
573
|
+
* The hook function to be called.
|
|
574
|
+
*/
|
|
575
|
+
handler: THookFunction;
|
|
576
|
+
}
|
|
577
|
+
type PluginHook<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> = THookFunction | PluginHookObject<THookFunction, TFilter>;
|
|
578
|
+
/**
|
|
579
|
+
* A result returned by the plugin from the `types` hook that describes the declaration types output file.
|
|
580
|
+
*/
|
|
581
|
+
interface TypesResult {
|
|
582
|
+
directives?: string[];
|
|
583
|
+
code: string;
|
|
584
|
+
}
|
|
585
|
+
type PluginHookFunctions<TContext extends PluginContext> = { [TCommandType in CommandType]: (this: TContext) => MaybePromise<void> } & {
|
|
586
|
+
/**
|
|
587
|
+
* A function that returns configuration options to be merged with the build context's options.
|
|
588
|
+
*
|
|
589
|
+
* @remarks
|
|
590
|
+
* Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
|
|
591
|
+
*
|
|
592
|
+
* @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect.
|
|
593
|
+
*
|
|
594
|
+
* @see https://vitejs.dev/guide/api-plugin#config
|
|
595
|
+
*
|
|
596
|
+
* @param this - The build context.
|
|
597
|
+
* @param config - The partial configuration object to be modified.
|
|
598
|
+
* @returns A promise that resolves to a partial configuration object.
|
|
599
|
+
*/
|
|
600
|
+
config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>;
|
|
601
|
+
/**
|
|
602
|
+
* Modify environment configs before it's resolved. The hook can either mutate the passed-in environment config directly, or return a partial config object that will be deeply merged into existing config.
|
|
603
|
+
*
|
|
604
|
+
* @remarks
|
|
605
|
+
* This hook is called for each environment with a partially resolved environment config that already accounts for the default environment config values set at the root level. If plugins need to modify the config of a given environment, they should do it in this hook instead of the config hook. Leaving the config hook only for modifying the root default environment config.
|
|
606
|
+
*
|
|
607
|
+
* @see https://vitejs.dev/guide/api-plugin#configenvironment
|
|
608
|
+
*
|
|
609
|
+
* @param this - The build context.
|
|
610
|
+
* @param name - The name of the environment being configured.
|
|
611
|
+
* @param environment - The Vite-like environment object containing information about the current build environment.
|
|
612
|
+
* @returns A promise that resolves when the hook is complete.
|
|
613
|
+
*/
|
|
614
|
+
configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>;
|
|
615
|
+
/**
|
|
616
|
+
* A hook that is called when the plugin is resolved.
|
|
617
|
+
*
|
|
618
|
+
* @see https://vitejs.dev/guide/api-plugin#configresolved
|
|
619
|
+
*
|
|
620
|
+
* @param this - The build context.
|
|
621
|
+
* @returns A promise that resolves when the hook is complete.
|
|
622
|
+
*/
|
|
623
|
+
configResolved: (this: TContext) => MaybePromise<void>;
|
|
624
|
+
/**
|
|
625
|
+
* A hook that is called to overwrite the generated declaration types file (.d.ts). The generated type definitions should describe the built-in modules/logic added during the `prepare` task.
|
|
626
|
+
*
|
|
627
|
+
* @param this - The build context.
|
|
628
|
+
* @param code - The source code to generate types for.
|
|
629
|
+
* @returns A promise that resolves when the hook is complete.
|
|
630
|
+
*/
|
|
631
|
+
types: (this: TContext, code: string) => MaybePromise<TypesResult | string | undefined | null>;
|
|
632
|
+
/**
|
|
633
|
+
* A hook that is called at the start of the build process.
|
|
634
|
+
*
|
|
635
|
+
* @param this - The build context and unplugin build context.
|
|
636
|
+
* @returns A promise that resolves when the hook is complete.
|
|
637
|
+
*/
|
|
638
|
+
buildStart: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
|
|
639
|
+
/**
|
|
640
|
+
* A hook that is called at the end of the build process.
|
|
641
|
+
*
|
|
642
|
+
* @param this - The build context and unplugin build context.
|
|
643
|
+
* @returns A promise that resolves when the hook is complete.
|
|
644
|
+
*/
|
|
645
|
+
buildEnd: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
|
|
646
|
+
/**
|
|
647
|
+
* A hook that is called to transform the source code.
|
|
648
|
+
*
|
|
649
|
+
* @param this - The build context, unplugin build context, and unplugin context.
|
|
650
|
+
* @param code - The source code to transform.
|
|
651
|
+
* @param id - The identifier of the source code.
|
|
652
|
+
* @returns A promise that resolves when the hook is complete.
|
|
653
|
+
*/
|
|
654
|
+
transform: (this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult>;
|
|
655
|
+
/**
|
|
656
|
+
* A hook that is called to load the source code.
|
|
657
|
+
*
|
|
658
|
+
* @param this - The build context, unplugin build context, and unplugin context.
|
|
659
|
+
* @param id - The identifier of the source code.
|
|
660
|
+
* @returns A promise that resolves when the hook is complete.
|
|
661
|
+
*/
|
|
662
|
+
load: (this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<LoadResult>;
|
|
663
|
+
/**
|
|
664
|
+
* A hook that is called to resolve the identifier of the source code.
|
|
665
|
+
*
|
|
666
|
+
* @param this - The build context, unplugin build context, and unplugin context.
|
|
667
|
+
* @param id - The identifier of the source code.
|
|
668
|
+
* @param importer - The importer of the source code.
|
|
669
|
+
* @param options - The options for resolving the identifier.
|
|
670
|
+
* @returns A promise that resolves when the hook is complete.
|
|
671
|
+
*/
|
|
672
|
+
resolveId: (this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
|
|
673
|
+
isEntry: boolean;
|
|
674
|
+
}) => MaybePromise<string | ExternalIdResult | null | undefined>;
|
|
675
|
+
/**
|
|
676
|
+
* A hook that is called to write the bundle to disk.
|
|
677
|
+
*
|
|
678
|
+
* @param this - The build context.
|
|
679
|
+
* @returns A promise that resolves when the hook is complete.
|
|
680
|
+
*/
|
|
681
|
+
writeBundle: (this: TContext) => MaybePromise<void>;
|
|
682
|
+
};
|
|
683
|
+
type PluginHooks<TContext extends PluginContext> = { [TPluginHook in keyof PluginHookFunctions<TContext>]?: PluginHook<PluginHookFunctions<TContext>[TPluginHook]> } & {
|
|
684
|
+
transform: PluginHook<PluginHookFunctions<TContext>["transform"], "code" | "id">;
|
|
685
|
+
load: PluginHook<PluginHookFunctions<TContext>["load"], "id">;
|
|
686
|
+
resolveId: PluginHook<PluginHookFunctions<TContext>["resolveId"], "id">;
|
|
687
|
+
};
|
|
688
|
+
type DeepPartial$1<T> = { [K in keyof T]?: DeepPartial$1<T[K]> };
|
|
689
|
+
type Plugin<TContext extends PluginContext<ResolvedConfig$2> = PluginContext<ResolvedConfig$2>> = Partial<PluginHooks<TContext>> & {
|
|
690
|
+
/**
|
|
691
|
+
* The name of the plugin, for use in deduplication, error messages and logs.
|
|
692
|
+
*/
|
|
693
|
+
name: string;
|
|
694
|
+
/**
|
|
695
|
+
* An API object that can be used for inter-plugin communication.
|
|
696
|
+
*
|
|
697
|
+
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
698
|
+
*/
|
|
699
|
+
api?: Record<string, any>;
|
|
700
|
+
/**
|
|
701
|
+
* Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.
|
|
702
|
+
*
|
|
703
|
+
* @remarks
|
|
704
|
+
* The Plugin invocation order is as follows:
|
|
705
|
+
* - `enforce: 'pre'` plugins
|
|
706
|
+
* - `order: 'pre'` plugin hooks
|
|
707
|
+
* - any other plugins (normal)
|
|
708
|
+
* - `order: 'post'` plugin hooks
|
|
709
|
+
* - `enforce: 'post'` plugins
|
|
710
|
+
*
|
|
711
|
+
* @see https://vitejs.dev/guide/api-plugin.html#plugin-ordering
|
|
712
|
+
* @see https://rollupjs.org/plugin-development/#build-hooks
|
|
713
|
+
* @see https://webpack.js.org/concepts/loaders/#enforce---pre-and-post
|
|
714
|
+
* @see https://esbuild.github.io/plugins/#concepts
|
|
715
|
+
*/
|
|
716
|
+
enforce?: "pre" | "post";
|
|
717
|
+
/**
|
|
718
|
+
* A function to determine if two plugins are the same and can be de-duplicated.
|
|
719
|
+
*
|
|
720
|
+
* @remarks
|
|
721
|
+
* If this is not provided, plugins are de-duplicated by comparing their names.
|
|
722
|
+
*
|
|
723
|
+
* @param other - The other plugin to compare against.
|
|
724
|
+
* @returns `true` if the two plugins are the same, `false` otherwise.
|
|
725
|
+
*/
|
|
726
|
+
dedupe?: false | ((other: Plugin<any>) => boolean);
|
|
727
|
+
/**
|
|
728
|
+
* A list of pre-requisite plugins that must be loaded before this plugin can be used.
|
|
729
|
+
*/
|
|
730
|
+
/**
|
|
731
|
+
* Define environments where this plugin should be active. By default, the plugin is active in all environments.
|
|
732
|
+
*
|
|
733
|
+
* @param environment - The environment to check.
|
|
734
|
+
* @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
|
|
735
|
+
*/
|
|
736
|
+
applyToEnvironment?: (environment: EnvironmentResolvedConfig) => boolean | PluginConfig<TContext>;
|
|
737
|
+
/**
|
|
738
|
+
* A function that returns configuration options to be merged with the build context's options.
|
|
739
|
+
*
|
|
740
|
+
* @remarks
|
|
741
|
+
* Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
|
|
742
|
+
*
|
|
743
|
+
* @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect. If you want to add plugins, consider doing so in the {@link Plugin.dependsOn} property instead.
|
|
744
|
+
*
|
|
745
|
+
* @see https://vitejs.dev/guide/api-plugin#config
|
|
746
|
+
*
|
|
747
|
+
* @param this - The build context.
|
|
748
|
+
* @param config - The partial configuration object to be modified.
|
|
749
|
+
* @returns A promise that resolves to a partial configuration object.
|
|
750
|
+
*/
|
|
751
|
+
config?: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>> | (DeepPartial$1<TContext["config"]> & Record<string, any>);
|
|
752
|
+
} & { [TBuilderVariant in BuilderVariant]?: InferUnpluginOptions<TContext, TBuilderVariant> };
|
|
753
|
+
declare const PLUGIN_NON_HOOK_FIELDS: readonly ["name", "api", "enforce", "dedupe", "applyToEnvironment"];
|
|
754
|
+
type PluginNonHookFields = ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS> | UnpluginBuilderVariant;
|
|
755
|
+
declare const PLUGIN_HOOKS_FIELDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize", "config", "configEnvironment", "configResolved", "types", "buildStart", "buildEnd", "transform", "load", "resolveId", "writeBundle"];
|
|
756
|
+
type PluginHookFields<TContext extends PluginContext = PluginContext> = keyof PluginHookFunctions<TContext>;
|
|
757
|
+
declare const KNOWN_PLUGIN_FIELDS: readonly ["name", "api", "enforce", "dedupe", "applyToEnvironment", "new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize", "config", "configEnvironment", "configResolved", "types", "buildStart", "buildEnd", "transform", "load", "resolveId", "writeBundle", ...BuilderVariant[]];
|
|
758
|
+
type PluginFields = ArrayValues<typeof KNOWN_PLUGIN_FIELDS>;
|
|
759
|
+
declare type __ΩPluginHookObject = any[];
|
|
760
|
+
declare type __ΩPluginHook = any[];
|
|
761
|
+
declare type __ΩTypesResult = any[];
|
|
762
|
+
declare type __ΩPluginHookFunctions = any[];
|
|
763
|
+
declare type __ΩPluginHooks = any[];
|
|
764
|
+
declare type __ΩPlugin = any[];
|
|
765
|
+
declare type __ΩPluginNonHookFields = any[];
|
|
766
|
+
declare type __ΩPluginHookFields = any[];
|
|
767
|
+
declare type __ΩPluginFields = any[];
|
|
768
|
+
//#endregion
|
|
769
|
+
//#region ../core/src/types/hooks.d.ts
|
|
770
|
+
type HookListOrders = "preOrdered" | "preEnforced" | "normal" | "postEnforced" | "postOrdered";
|
|
771
|
+
declare const HOOKS_LIST_ORDERS: readonly ["preOrdered", "preEnforced", "normal", "postEnforced", "postOrdered"];
|
|
772
|
+
type UnpluginHookFunctions<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant$1 extends UnpluginBuilderVariant = UnpluginBuilderVariant, TField$1 extends keyof Required<UnpluginOptions>[TUnpluginBuilderVariant$1] = keyof Required<UnpluginOptions>[TUnpluginBuilderVariant$1]> = Required<UnpluginOptions>[TUnpluginBuilderVariant$1][TField$1] extends infer THandler | {
|
|
773
|
+
handler: infer THandler;
|
|
774
|
+
} ? THandler extends ((this: infer THandlerOriginalContext, ...args: infer THandlerArgs) => infer THandlerReturn) ? (this: THandlerOriginalContext & WithUnpluginBuildContext<TContext>, ...args: THandlerArgs) => THandlerReturn : THandler extends {
|
|
775
|
+
handler: infer THandlerFunction;
|
|
776
|
+
} ? THandlerFunction extends ((this: infer THandlerFunctionOriginalContext, ...args: infer THandlerFunctionArgs) => infer THandlerFunctionReturn) ? (this: THandlerFunctionOriginalContext & WithUnpluginBuildContext<TContext>, ...args: THandlerFunctionArgs) => THandlerFunctionReturn : never : never : never;
|
|
777
|
+
interface PluginHooksListItem<TContext extends PluginContext = PluginContext, TFields extends PluginHookFields<TContext> = PluginHookFields<TContext>> {
|
|
778
|
+
plugin: Plugin<TContext>;
|
|
779
|
+
handler: PluginHookFunctions<TContext>[TFields];
|
|
780
|
+
}
|
|
781
|
+
type PluginHooksList<TContext extends PluginContext = PluginContext, TFields extends PluginHookFields<TContext> = PluginHookFields<TContext>> = { [TKey in HookListOrders]?: PluginHooksListItem<TContext, TFields>[] | undefined };
|
|
782
|
+
interface UnpluginHooksListItem<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant$1 extends UnpluginBuilderVariant = UnpluginBuilderVariant, TField$1 extends keyof Required<UnpluginOptions>[TUnpluginBuilderVariant$1] = keyof Required<UnpluginOptions>[TUnpluginBuilderVariant$1]> {
|
|
783
|
+
plugin: Plugin<TContext>;
|
|
784
|
+
handler: UnpluginHookFunctions<TContext, TUnpluginBuilderVariant$1, TField$1>;
|
|
785
|
+
}
|
|
786
|
+
type UnpluginHookList<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant$1 extends UnpluginBuilderVariant = UnpluginBuilderVariant, TField$1 extends keyof UnpluginOptions[TUnpluginBuilderVariant$1] = keyof UnpluginOptions[TUnpluginBuilderVariant$1]> = { [TKey in HookListOrders]?: UnpluginHooksListItem<TContext, TUnpluginBuilderVariant$1, TField$1>[] | undefined };
|
|
787
|
+
type UnpluginHookVariantField<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant$1 extends UnpluginBuilderVariant = UnpluginBuilderVariant> = { [TKey in keyof UnpluginOptions[TUnpluginBuilderVariant$1]]?: UnpluginHookList<TContext, TUnpluginBuilderVariant$1, TKey> };
|
|
788
|
+
type UnpluginHookVariant<TContext extends PluginContext = PluginContext> = { [TKey in UnpluginBuilderVariant]?: UnpluginHookVariantField<TContext, TKey> };
|
|
789
|
+
type HookFields<TContext extends PluginContext = PluginContext> = PluginHookFields<TContext> | UnpluginBuilderVariant;
|
|
790
|
+
type HooksList<TContext extends PluginContext = PluginContext> = { [TField in HookFields<TContext>]?: TField extends PluginHookFields<TContext> ? PluginHooksList<TContext, TField> : TField extends UnpluginBuilderVariant ? UnpluginHookVariant<TContext>[TField] : never };
|
|
791
|
+
type InferHooksListItem<TContext extends PluginContext, TKey$1 extends string> = TKey$1 extends `${infer TUnpluginBuilderVariant}:${infer TUnpluginField}` ? TUnpluginBuilderVariant extends UnpluginBuilderVariant ? TUnpluginField extends keyof Required<UnpluginOptions>[TUnpluginBuilderVariant] ? UnpluginHooksListItem<TContext, TUnpluginBuilderVariant, TUnpluginField> : never : never : TKey$1 extends keyof PluginHookFunctions<TContext> ? PluginHooksListItem<TContext, TKey$1> : never;
|
|
792
|
+
type InferHookFunction<TContext extends PluginContext, TKey$1 extends string> = TKey$1 extends `${infer TUnpluginBuilderVariant}:${infer TUnpluginField}` ? TUnpluginBuilderVariant extends UnpluginBuilderVariant ? TUnpluginField extends keyof Required<UnpluginOptions>[TUnpluginBuilderVariant] ? UnpluginHookFunctions<TContext, TUnpluginBuilderVariant, TUnpluginField> : never : never : TKey$1 extends keyof PluginHookFunctions<TContext> ? PluginHookFunctions<TContext>[TKey$1] : never;
|
|
793
|
+
type InferHookReturnType<TContext extends PluginContext, TKey$1 extends string> = ReturnType<InferHookFunction<TContext, TKey$1>>;
|
|
794
|
+
type InferHookParameters<TContext extends PluginContext, TKey$1 extends string> = Parameters<InferHookFunction<TContext, TKey$1>>;
|
|
795
|
+
type InferHookThisType<TContext extends PluginContext, TKey$1 extends string> = ThisParameterType<InferHookFunction<TContext, TKey$1>>;
|
|
796
|
+
type CallHookOptions = SelectHooksOptions & (({
|
|
797
|
+
/**
|
|
798
|
+
* Whether to call the hooks sequentially or in parallel.
|
|
799
|
+
*
|
|
800
|
+
* @defaultValue true
|
|
801
|
+
*/
|
|
802
|
+
sequential?: true;
|
|
803
|
+
} & ({
|
|
804
|
+
/**
|
|
805
|
+
* How to handle multiple return values from hooks.
|
|
806
|
+
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
807
|
+
* - "first": Return the first non-undefined value.
|
|
808
|
+
*
|
|
809
|
+
* @remarks
|
|
810
|
+
* Merging only works if the return values are objects.
|
|
811
|
+
*
|
|
812
|
+
* @defaultValue "merge"
|
|
813
|
+
*/
|
|
814
|
+
result: "first";
|
|
815
|
+
} | ({
|
|
816
|
+
/**
|
|
817
|
+
* An indicator specifying if the results of the previous hook should be provided as the **first** parameter of the next hook function, or a function to process the result of the previous hook function and pass the returned value as the next hook's **first** parameter
|
|
818
|
+
*/
|
|
819
|
+
asNextParam?: false | ((previousResult: any) => MaybePromise<any>);
|
|
820
|
+
} & ({
|
|
821
|
+
/**
|
|
822
|
+
* How to handle multiple return values from hooks.
|
|
823
|
+
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
824
|
+
* - "first": Return the first non-undefined value.
|
|
825
|
+
*
|
|
826
|
+
* @remarks
|
|
827
|
+
* Merging only works if the return values are objects.
|
|
828
|
+
*
|
|
829
|
+
* @defaultValue "merge"
|
|
830
|
+
*/
|
|
831
|
+
result?: "merge";
|
|
832
|
+
/**
|
|
833
|
+
* A custom function to merge multiple return values from hooks.
|
|
834
|
+
*
|
|
835
|
+
* @remarks
|
|
836
|
+
* If not provided, the {@link mergeResults} function will be used by default, which merges string results by concatenation and object results by deep merging.
|
|
837
|
+
*
|
|
838
|
+
* @param currentResult - The current hook result to merge with the previous results.
|
|
839
|
+
* @param previousResults - The previous hook results to merge with the current result.
|
|
840
|
+
* @returns The merged result.
|
|
841
|
+
*/
|
|
842
|
+
merge?: <T>(currentResult: T, previousResults: T[]) => T[];
|
|
843
|
+
} | {
|
|
844
|
+
/**
|
|
845
|
+
* How to handle multiple return values from hooks.
|
|
846
|
+
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
847
|
+
* - "first": Return the first non-undefined value.
|
|
848
|
+
*
|
|
849
|
+
* @remarks
|
|
850
|
+
* Merging only works if the return values are objects.
|
|
851
|
+
*
|
|
852
|
+
* @defaultValue "merge"
|
|
853
|
+
*/
|
|
854
|
+
result?: "last";
|
|
855
|
+
})))) | {
|
|
856
|
+
/**
|
|
857
|
+
* Whether to call the hooks sequentially or in parallel.
|
|
858
|
+
*/
|
|
859
|
+
sequential: false;
|
|
860
|
+
});
|
|
861
|
+
declare type __ΩHookListOrders = any[];
|
|
862
|
+
declare type __ΩUnpluginHookFunctions = any[];
|
|
863
|
+
declare type __ΩPluginHooksListItem = any[];
|
|
864
|
+
declare type __ΩPluginHooksList = any[];
|
|
865
|
+
declare type __ΩUnpluginHooksListItem = any[];
|
|
866
|
+
declare type __ΩUnpluginHookList = any[];
|
|
867
|
+
declare type __ΩUnpluginHookVariantField = any[];
|
|
868
|
+
declare type __ΩUnpluginHookVariant = any[];
|
|
869
|
+
declare type __ΩHookFields = any[];
|
|
870
|
+
declare type __ΩHooksList = any[];
|
|
871
|
+
declare type __ΩInferHooksListItem = any[];
|
|
872
|
+
declare type __ΩInferHookFunction = any[];
|
|
873
|
+
declare type __ΩInferHookReturnType = any[];
|
|
874
|
+
declare type __ΩInferHookParameters = any[];
|
|
875
|
+
declare type __ΩInferHookThisType = any[];
|
|
876
|
+
declare type __ΩCallHookOptions = any[];
|
|
877
|
+
//#endregion
|
|
878
|
+
//#region ../core/src/types/tsconfig.d.ts
|
|
879
|
+
type ReflectionMode = "default" | "explicit" | "never";
|
|
880
|
+
type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
|
|
881
|
+
/**
|
|
882
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
883
|
+
*
|
|
884
|
+
* @remarks
|
|
885
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
886
|
+
* - `minimal` - Only the essential type information is captured.
|
|
887
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
888
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
889
|
+
*/
|
|
890
|
+
type ReflectionLevel = "minimal" | "normal" | "verbose";
|
|
891
|
+
interface DeepkitOptions {
|
|
892
|
+
/**
|
|
893
|
+
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
894
|
+
* or a list of globs/file paths relative to this tsconfig.json.
|
|
895
|
+
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
896
|
+
*/
|
|
897
|
+
reflection?: RawReflectionMode;
|
|
898
|
+
/**
|
|
899
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
900
|
+
*
|
|
901
|
+
* @remarks
|
|
902
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
903
|
+
* - `minimal` - Only the essential type information is captured.
|
|
904
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
905
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
906
|
+
*/
|
|
907
|
+
reflectionLevel?: ReflectionLevel;
|
|
908
|
+
}
|
|
909
|
+
type TSCompilerOptions = CompilerOptions & DeepkitOptions;
|
|
910
|
+
/**
|
|
911
|
+
* The TypeScript compiler configuration.
|
|
912
|
+
*
|
|
913
|
+
* @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
|
|
914
|
+
*/
|
|
915
|
+
interface TSConfig extends Omit<TsConfigJson, "reflection"> {
|
|
916
|
+
/**
|
|
917
|
+
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
918
|
+
* or a list of globs/file paths relative to this tsconfig.json.
|
|
919
|
+
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
920
|
+
*/
|
|
921
|
+
reflection?: RawReflectionMode;
|
|
922
|
+
/**
|
|
923
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
924
|
+
*
|
|
925
|
+
* @remarks
|
|
926
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
927
|
+
* - `minimal` - Only the essential type information is captured.
|
|
928
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
929
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
930
|
+
*/
|
|
931
|
+
reflectionLevel?: ReflectionLevel;
|
|
932
|
+
/**
|
|
933
|
+
* Instructs the TypeScript compiler how to compile `.ts` files.
|
|
934
|
+
*/
|
|
935
|
+
compilerOptions?: TSCompilerOptions;
|
|
936
|
+
}
|
|
937
|
+
type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
938
|
+
originalTsconfigJson: TsConfigJson;
|
|
939
|
+
tsconfigJson: TSConfig;
|
|
940
|
+
tsconfigFilePath: string;
|
|
941
|
+
};
|
|
942
|
+
declare type __ΩReflectionMode = any[];
|
|
943
|
+
declare type __ΩRawReflectionMode = any[];
|
|
944
|
+
declare type __ΩReflectionLevel = any[];
|
|
945
|
+
declare type __ΩDeepkitOptions = any[];
|
|
946
|
+
declare type __ΩTSCompilerOptions = any[];
|
|
947
|
+
declare type __ΩTSConfig = any[];
|
|
948
|
+
declare type __ΩParsedTypeScriptConfig = any[];
|
|
949
|
+
//#endregion
|
|
950
|
+
//#region ../core/src/types/context.d.ts
|
|
951
|
+
type WorkerProcess<TExposedMethods extends ReadonlyArray<string>> = { [K in TExposedMethods[number]]: (data: any) => Promise<any> } & {
|
|
952
|
+
close: () => void;
|
|
953
|
+
end: () => ReturnType<Worker["end"]>;
|
|
954
|
+
};
|
|
955
|
+
interface MetaInfo {
|
|
956
|
+
/**
|
|
957
|
+
* The checksum generated from the resolved options
|
|
958
|
+
*/
|
|
959
|
+
checksum: string;
|
|
960
|
+
/**
|
|
961
|
+
* The build id
|
|
962
|
+
*/
|
|
963
|
+
buildId: string;
|
|
964
|
+
/**
|
|
965
|
+
* The release id
|
|
966
|
+
*/
|
|
967
|
+
releaseId: string;
|
|
968
|
+
/**
|
|
969
|
+
* The build timestamp
|
|
970
|
+
*/
|
|
971
|
+
timestamp: number;
|
|
972
|
+
/**
|
|
973
|
+
* A hash that represents the path to the project root directory
|
|
974
|
+
*/
|
|
975
|
+
rootHash: string;
|
|
976
|
+
/**
|
|
977
|
+
* A hash that represents the path to the configuration root directory
|
|
978
|
+
*/
|
|
979
|
+
configHash: string;
|
|
980
|
+
}
|
|
981
|
+
interface Resolver extends Jiti {
|
|
982
|
+
plugin: Jiti;
|
|
983
|
+
}
|
|
984
|
+
interface TransformResult$1 {
|
|
985
|
+
code: string;
|
|
986
|
+
map: SourceMap | null;
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* The format for providing source code to the compiler
|
|
990
|
+
*/
|
|
991
|
+
interface SourceFile {
|
|
992
|
+
/**
|
|
993
|
+
* The name of the file to be compiled
|
|
994
|
+
*/
|
|
995
|
+
id: string;
|
|
996
|
+
/**
|
|
997
|
+
* The source code to be compiled
|
|
998
|
+
*/
|
|
999
|
+
code: MagicString;
|
|
1000
|
+
/**
|
|
1001
|
+
* The environment variables used in the source code
|
|
1002
|
+
*/
|
|
1003
|
+
env: string[];
|
|
1004
|
+
/**
|
|
1005
|
+
* The result of the transformation
|
|
1006
|
+
*/
|
|
1007
|
+
result?: TransformResult$1;
|
|
1008
|
+
}
|
|
1009
|
+
type UnimportContext = Omit<Unimport, "injectImports"> & {
|
|
1010
|
+
dumpImports: () => Promise<void>;
|
|
1011
|
+
injectImports: (source: SourceFile) => Promise<SourceFile>;
|
|
1012
|
+
refreshRuntimeImports: () => Promise<void>;
|
|
1013
|
+
};
|
|
1014
|
+
interface SelectHooksOptions {
|
|
1015
|
+
order?: "pre" | "post" | "normal";
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* Options for initializing or updating the context with new configuration values
|
|
1019
|
+
*/
|
|
1020
|
+
interface InitContextOptions {
|
|
1021
|
+
/**
|
|
1022
|
+
* If false, the plugin will be loaded after all other plugins.
|
|
1023
|
+
*
|
|
1024
|
+
* @defaultValue true
|
|
1025
|
+
*/
|
|
1026
|
+
isHighPriority: boolean;
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* Options for fetch requests made via the context's {@link Context.fetch} method
|
|
1030
|
+
*/
|
|
1031
|
+
interface FetchOptions extends FetchRequestOptions {
|
|
1032
|
+
/**
|
|
1033
|
+
* An indicator specifying that the request should bypass any caching
|
|
1034
|
+
*/
|
|
1035
|
+
skipCache?: boolean;
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* Options for parsing code using [Oxc-Parser](https://github.com/oxc/oxc)
|
|
1039
|
+
*/
|
|
1040
|
+
interface ParseOptions extends ParserOptions {
|
|
1041
|
+
/**
|
|
1042
|
+
* When true this allows return statements to be outside functions to e.g. support parsing CommonJS code.
|
|
1043
|
+
*/
|
|
1044
|
+
allowReturnOutsideFunction?: boolean;
|
|
1045
|
+
}
|
|
1046
|
+
interface EmitOptions extends WriteOptions {
|
|
1047
|
+
/**
|
|
1048
|
+
* The file extension to use when emitting the file
|
|
1049
|
+
*/
|
|
1050
|
+
extension?: string;
|
|
1051
|
+
/**
|
|
1052
|
+
* If true, will emit the file using {@link UnpluginBuildContext.emitFile | the bundler's emit function}.
|
|
1053
|
+
*/
|
|
1054
|
+
emitWithBundler?: boolean;
|
|
1055
|
+
needsCodeReference?: Parameters<UnpluginBuildContext["emitFile"]>[0]["needsCodeReference"];
|
|
1056
|
+
originalFileName?: Parameters<UnpluginBuildContext["emitFile"]>[0]["originalFileName"];
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Options for emitting entry virtual files
|
|
1060
|
+
*/
|
|
1061
|
+
type EmitEntryOptions = EmitOptions & Omit<ResolvedEntryTypeDefinition, "file">;
|
|
1062
|
+
/**
|
|
1063
|
+
* The unresolved Powerlines context.
|
|
1064
|
+
*
|
|
1065
|
+
* @remarks
|
|
1066
|
+
* This context is used before the user configuration has been fully resolved after the `config`.
|
|
1067
|
+
*/
|
|
1068
|
+
interface UnresolvedContext<TResolvedConfig extends ResolvedConfig$2 = ResolvedConfig$2> {
|
|
1069
|
+
/**
|
|
1070
|
+
* The Storm workspace configuration
|
|
1071
|
+
*/
|
|
1072
|
+
workspaceConfig: WorkspaceConfig;
|
|
1073
|
+
/**
|
|
1074
|
+
* An object containing the options provided to Powerlines
|
|
1075
|
+
*/
|
|
1076
|
+
config: Omit<TResolvedConfig["userConfig"], "output"> & Required<Pick<TResolvedConfig["userConfig"], "output">> & {
|
|
1077
|
+
output: TResolvedConfig["output"];
|
|
1078
|
+
};
|
|
1079
|
+
/**
|
|
1080
|
+
* A logging function for the Powerlines engine
|
|
1081
|
+
*/
|
|
1082
|
+
log: LogFn;
|
|
1083
|
+
/**
|
|
1084
|
+
* A logging function for fatal messages
|
|
1085
|
+
*/
|
|
1086
|
+
fatal: (message: string | UnpluginMessage) => void;
|
|
1087
|
+
/**
|
|
1088
|
+
* A logging function for error messages
|
|
1089
|
+
*/
|
|
1090
|
+
error: (message: string | UnpluginMessage) => void;
|
|
1091
|
+
/**
|
|
1092
|
+
* A logging function for warning messages
|
|
1093
|
+
*/
|
|
1094
|
+
warn: (message: string | UnpluginMessage) => void;
|
|
1095
|
+
/**
|
|
1096
|
+
* A logging function for informational messages
|
|
1097
|
+
*/
|
|
1098
|
+
info: (message: string | UnpluginMessage) => void;
|
|
1099
|
+
/**
|
|
1100
|
+
* A logging function for debug messages
|
|
1101
|
+
*/
|
|
1102
|
+
debug: (message: string | UnpluginMessage) => void;
|
|
1103
|
+
/**
|
|
1104
|
+
* A logging function for trace messages
|
|
1105
|
+
*/
|
|
1106
|
+
trace: (message: string | UnpluginMessage) => void;
|
|
1107
|
+
/**
|
|
1108
|
+
* The metadata information
|
|
1109
|
+
*/
|
|
1110
|
+
meta: MetaInfo;
|
|
1111
|
+
/**
|
|
1112
|
+
* The metadata information currently written to disk
|
|
1113
|
+
*/
|
|
1114
|
+
persistedMeta?: MetaInfo;
|
|
1115
|
+
/**
|
|
1116
|
+
* The Powerlines artifacts directory
|
|
1117
|
+
*/
|
|
1118
|
+
artifactsPath: string;
|
|
1119
|
+
/**
|
|
1120
|
+
* The path to the Powerlines builtin runtime modules directory
|
|
1121
|
+
*/
|
|
1122
|
+
builtinsPath: string;
|
|
1123
|
+
/**
|
|
1124
|
+
* The path to the Powerlines entry modules directory
|
|
1125
|
+
*/
|
|
1126
|
+
entryPath: string;
|
|
1127
|
+
/**
|
|
1128
|
+
* The path to the Powerlines TypeScript declaration files directory
|
|
1129
|
+
*/
|
|
1130
|
+
dtsPath: string;
|
|
1131
|
+
/**
|
|
1132
|
+
* The path to a directory where the reflection data buffers (used by the build processes) are stored
|
|
1133
|
+
*/
|
|
1134
|
+
dataPath: string;
|
|
1135
|
+
/**
|
|
1136
|
+
* The path to a directory where the project cache (used by the build processes) is stored
|
|
1137
|
+
*/
|
|
1138
|
+
cachePath: string;
|
|
1139
|
+
/**
|
|
1140
|
+
* The Powerlines environment paths
|
|
1141
|
+
*/
|
|
1142
|
+
envPaths: EnvPaths;
|
|
1143
|
+
/**
|
|
1144
|
+
* The file system path to the Powerlines package installation
|
|
1145
|
+
*/
|
|
1146
|
+
powerlinesPath: string;
|
|
1147
|
+
/**
|
|
1148
|
+
* The relative path to the Powerlines workspace root directory
|
|
1149
|
+
*/
|
|
1150
|
+
relativeToWorkspaceRoot: string;
|
|
1151
|
+
/**
|
|
1152
|
+
* The project's `package.json` file content
|
|
1153
|
+
*/
|
|
1154
|
+
packageJson: PackageJson & Record<string, any>;
|
|
1155
|
+
/**
|
|
1156
|
+
* The project's `project.json` file content
|
|
1157
|
+
*/
|
|
1158
|
+
projectJson?: Record<string, any>;
|
|
1159
|
+
/**
|
|
1160
|
+
* The dependency installations required by the project
|
|
1161
|
+
*/
|
|
1162
|
+
dependencies: Record<string, string | Range>;
|
|
1163
|
+
/**
|
|
1164
|
+
* The development dependency installations required by the project
|
|
1165
|
+
*/
|
|
1166
|
+
devDependencies: Record<string, string | Range>;
|
|
1167
|
+
/**
|
|
1168
|
+
* The parsed TypeScript configuration from the `tsconfig.json` file
|
|
1169
|
+
*/
|
|
1170
|
+
tsconfig: ParsedTypeScriptConfig;
|
|
1171
|
+
/**
|
|
1172
|
+
* The entry points of the source code
|
|
1173
|
+
*/
|
|
1174
|
+
entry: ResolvedEntryTypeDefinition[];
|
|
1175
|
+
/**
|
|
1176
|
+
* The virtual file system manager used during the build process to reference generated runtime files
|
|
1177
|
+
*/
|
|
1178
|
+
fs: VirtualFileSystemInterface;
|
|
1179
|
+
/**
|
|
1180
|
+
* The Jiti module resolver
|
|
1181
|
+
*/
|
|
1182
|
+
resolver: Resolver;
|
|
1183
|
+
/**
|
|
1184
|
+
* The builtin module id that exist in the Powerlines virtual file system
|
|
1185
|
+
*/
|
|
1186
|
+
builtins: string[];
|
|
1187
|
+
/**
|
|
1188
|
+
* The alias mappings for the project used during module resolution
|
|
1189
|
+
*
|
|
1190
|
+
* @remarks
|
|
1191
|
+
* This includes both the built-in module aliases as well as any custom aliases defined in the build configuration.
|
|
1192
|
+
*/
|
|
1193
|
+
alias: Record<string, string>;
|
|
1194
|
+
/**
|
|
1195
|
+
* A function to perform HTTP fetch requests
|
|
1196
|
+
*
|
|
1197
|
+
* @remarks
|
|
1198
|
+
* This function uses a caching layer to avoid duplicate requests during the Powerlines process.
|
|
1199
|
+
*
|
|
1200
|
+
* @example
|
|
1201
|
+
* ```ts
|
|
1202
|
+
* const response = await context.fetch("https://api.example.com/data");
|
|
1203
|
+
* const data = await response.json();
|
|
1204
|
+
* ```
|
|
1205
|
+
*
|
|
1206
|
+
* @see https://github.com/nodejs/undici
|
|
1207
|
+
*
|
|
1208
|
+
* @param input - The URL to fetch.
|
|
1209
|
+
* @param options - The fetch request options.
|
|
1210
|
+
* @returns A promise that resolves to a response returned by the fetch.
|
|
1211
|
+
*/
|
|
1212
|
+
fetch: (input: RequestInfo, options?: FetchOptions) => Promise<Response>;
|
|
1213
|
+
/**
|
|
1214
|
+
* Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
1215
|
+
*
|
|
1216
|
+
* @remarks
|
|
1217
|
+
* This function can be used to parse TypeScript code into an AST for further analysis or transformation.
|
|
1218
|
+
*
|
|
1219
|
+
* @example
|
|
1220
|
+
* ```ts
|
|
1221
|
+
* const ast = context.parse("const x: number = 42;");
|
|
1222
|
+
* ```
|
|
1223
|
+
*
|
|
1224
|
+
* @see https://rollupjs.org/plugin-development/#this-parse
|
|
1225
|
+
* @see https://github.com/oxc/oxc
|
|
1226
|
+
*
|
|
1227
|
+
* @param code - The source code to parse.
|
|
1228
|
+
* @param options - The options to pass to the parser.
|
|
1229
|
+
* @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
1230
|
+
*/
|
|
1231
|
+
parse: (code: string, options?: ParseOptions) => Promise<ParseResult>;
|
|
1232
|
+
/**
|
|
1233
|
+
* A helper function to resolve modules using the Jiti resolver
|
|
1234
|
+
*
|
|
1235
|
+
* @remarks
|
|
1236
|
+
* This function can be used to resolve modules relative to the project root directory.
|
|
1237
|
+
*
|
|
1238
|
+
* @example
|
|
1239
|
+
* ```ts
|
|
1240
|
+
* const resolvedPath = await context.resolve("some-module", "/path/to/importer");
|
|
1241
|
+
* ```
|
|
1242
|
+
*
|
|
1243
|
+
* @param id - The module to resolve.
|
|
1244
|
+
* @param importer - An optional path to the importer module.
|
|
1245
|
+
* @param options - Additional resolution options.
|
|
1246
|
+
* @returns A promise that resolves to the resolved module path.
|
|
1247
|
+
*/
|
|
1248
|
+
resolve: (id: string, importer?: string, options?: ResolveOptions$1) => Promise<ExternalIdResult | undefined>;
|
|
1249
|
+
/**
|
|
1250
|
+
* A helper function to load modules using the Jiti resolver
|
|
1251
|
+
*
|
|
1252
|
+
* @remarks
|
|
1253
|
+
* This function can be used to load modules relative to the project root directory.
|
|
1254
|
+
*
|
|
1255
|
+
* @example
|
|
1256
|
+
* ```ts
|
|
1257
|
+
* const module = await context.load("some-module", "/path/to/importer");
|
|
1258
|
+
* ```
|
|
1259
|
+
*
|
|
1260
|
+
* @param id - The module to load.
|
|
1261
|
+
* @returns A promise that resolves to the loaded module.
|
|
1262
|
+
*/
|
|
1263
|
+
load: (id: string) => Promise<TransformResult$1 | undefined>;
|
|
1264
|
+
/**
|
|
1265
|
+
* The Powerlines builtin virtual files
|
|
1266
|
+
*/
|
|
1267
|
+
getBuiltins: () => Promise<VirtualFile[]>;
|
|
1268
|
+
/**
|
|
1269
|
+
* Resolves a file and writes it to the VFS if it does not already exist
|
|
1270
|
+
*
|
|
1271
|
+
* @param code - The source code of the file
|
|
1272
|
+
* @param path - The path to write the file to
|
|
1273
|
+
* @param options - Additional options for writing the file
|
|
1274
|
+
*/
|
|
1275
|
+
emit: (code: string, path: string, options?: EmitOptions) => Promise<void>;
|
|
1276
|
+
/**
|
|
1277
|
+
* Synchronously resolves a file and writes it to the VFS if it does not already exist
|
|
1278
|
+
*
|
|
1279
|
+
* @param code - The source code of the file
|
|
1280
|
+
* @param path - The path to write the file to
|
|
1281
|
+
* @param options - Additional options for writing the file
|
|
1282
|
+
*/
|
|
1283
|
+
emitSync: (code: string, path: string, options?: EmitOptions) => void;
|
|
1284
|
+
/**
|
|
1285
|
+
* Resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
1286
|
+
*
|
|
1287
|
+
* @param code - The source code of the builtin file
|
|
1288
|
+
* @param id - The unique identifier of the builtin file
|
|
1289
|
+
* @param options - Additional options for writing the builtin file
|
|
1290
|
+
*/
|
|
1291
|
+
emitBuiltin: (code: string, id: string, options?: EmitOptions) => Promise<void>;
|
|
1292
|
+
/**
|
|
1293
|
+
* Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
1294
|
+
*
|
|
1295
|
+
* @param code - The source code of the builtin file
|
|
1296
|
+
* @param id - The unique identifier of the builtin file
|
|
1297
|
+
* @param options - Additional options for writing the builtin file
|
|
1298
|
+
*/
|
|
1299
|
+
emitBuiltinSync: (code: string, id: string, options?: EmitOptions) => void;
|
|
1300
|
+
/**
|
|
1301
|
+
* Resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
1302
|
+
*
|
|
1303
|
+
* @param code - The source code of the entry file
|
|
1304
|
+
* @param path - An optional path to write the entry file to
|
|
1305
|
+
* @param options - Additional options for writing the entry file
|
|
1306
|
+
*/
|
|
1307
|
+
emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
|
|
1308
|
+
/**
|
|
1309
|
+
* Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
1310
|
+
*
|
|
1311
|
+
* @param code - The source code of the entry file
|
|
1312
|
+
* @param path - An optional path to write the entry file to
|
|
1313
|
+
* @param options - Additional options for writing the entry file
|
|
1314
|
+
*/
|
|
1315
|
+
emitEntrySync: (code: string, path: string, options?: EmitEntryOptions) => void;
|
|
1316
|
+
/**
|
|
1317
|
+
* A function to update the context fields using a new user configuration options
|
|
1318
|
+
*/
|
|
1319
|
+
withUserConfig: (userConfig: UserConfig$1, options?: InitContextOptions) => Promise<void>;
|
|
1320
|
+
/**
|
|
1321
|
+
* A function to update the context fields using inline configuration options
|
|
1322
|
+
*/
|
|
1323
|
+
withInlineConfig: (inlineConfig: InlineConfig, options?: InitContextOptions) => Promise<void>;
|
|
1324
|
+
/**
|
|
1325
|
+
* Create a new logger instance
|
|
1326
|
+
*
|
|
1327
|
+
* @param name - The name to use for the logger instance
|
|
1328
|
+
* @returns A logger function
|
|
1329
|
+
*/
|
|
1330
|
+
createLog: (name: string | null) => LogFn;
|
|
1331
|
+
/**
|
|
1332
|
+
* Extend the current logger instance with a new name
|
|
1333
|
+
*
|
|
1334
|
+
* @param name - The name to use for the extended logger instance
|
|
1335
|
+
* @returns A logger function
|
|
1336
|
+
*/
|
|
1337
|
+
extendLog: (name: string) => LogFn;
|
|
1338
|
+
/**
|
|
1339
|
+
* Generates a checksum representing the current context state
|
|
1340
|
+
*
|
|
1341
|
+
* @returns A promise that resolves to a string representing the checksum
|
|
1342
|
+
*/
|
|
1343
|
+
generateChecksum: () => Promise<string>;
|
|
1344
|
+
}
|
|
1345
|
+
type Context<TResolvedConfig extends ResolvedConfig$2 = ResolvedConfig$2> = Omit<UnresolvedContext<TResolvedConfig>, "config"> & {
|
|
1346
|
+
/**
|
|
1347
|
+
* The fully resolved Powerlines configuration
|
|
1348
|
+
*/
|
|
1349
|
+
config: TResolvedConfig;
|
|
1350
|
+
};
|
|
1351
|
+
interface APIContext<TResolvedConfig extends ResolvedConfig$2 = ResolvedConfig$2> extends Context<TResolvedConfig> {
|
|
1352
|
+
/**
|
|
1353
|
+
* The expected plugins options for the Powerlines project.
|
|
1354
|
+
*
|
|
1355
|
+
* @remarks
|
|
1356
|
+
* This is a record of plugin identifiers to their respective options. This field is populated by the Powerlines engine during both plugin initialization and the `init` command.
|
|
1357
|
+
*/
|
|
1358
|
+
plugins: Plugin<PluginContext<TResolvedConfig>>[];
|
|
1359
|
+
/**
|
|
1360
|
+
* A function to add a plugin to the context and update the configuration options
|
|
1361
|
+
*/
|
|
1362
|
+
addPlugin: (plugin: Plugin<PluginContext<TResolvedConfig>>) => Promise<void>;
|
|
1363
|
+
/**
|
|
1364
|
+
* A table for storing the current context for each configured environment
|
|
1365
|
+
*/
|
|
1366
|
+
environments: Record<string, EnvironmentContext<TResolvedConfig>>;
|
|
1367
|
+
/**
|
|
1368
|
+
* Retrieves the context for a specific environment by name
|
|
1369
|
+
*
|
|
1370
|
+
* @throws Will throw an error if the environment does not exist
|
|
1371
|
+
*
|
|
1372
|
+
* @param name - The name of the environment to retrieve. If not provided, the default environment is returned.
|
|
1373
|
+
* @returns A promise that resolves to the environment context.
|
|
1374
|
+
*
|
|
1375
|
+
* @example
|
|
1376
|
+
* ```ts
|
|
1377
|
+
* const devEnv = await apiContext.getEnvironment("development");
|
|
1378
|
+
* const defaultEnv = await apiContext.getEnvironment();
|
|
1379
|
+
* ```
|
|
1380
|
+
*/
|
|
1381
|
+
getEnvironment: (name?: string) => Promise<EnvironmentContext<TResolvedConfig>>;
|
|
1382
|
+
/**
|
|
1383
|
+
* Safely retrieves the context for a specific environment by name
|
|
1384
|
+
*
|
|
1385
|
+
* @param name - The name of the environment to retrieve. If not provided, the default environment is returned.
|
|
1386
|
+
* @returns A promise that resolves to the environment context, or undefined if the environment does not exist.
|
|
1387
|
+
*
|
|
1388
|
+
* @example
|
|
1389
|
+
* ```ts
|
|
1390
|
+
* const devEnv = await apiContext.getEnvironmentSafe("development");
|
|
1391
|
+
* const defaultEnv = await apiContext.getEnvironmentSafe();
|
|
1392
|
+
* ```
|
|
1393
|
+
*
|
|
1394
|
+
* @remarks
|
|
1395
|
+
* This method is similar to `getEnvironment`, but it returns `undefined` instead of throwing an error if the specified environment does not exist.
|
|
1396
|
+
* This can be useful in scenarios where the existence of an environment is optional or uncertain.
|
|
1397
|
+
*
|
|
1398
|
+
* ```ts
|
|
1399
|
+
* const testEnv = await apiContext.getEnvironmentSafe("test");
|
|
1400
|
+
* if (testEnv) {
|
|
1401
|
+
* // Environment exists, safe to use it
|
|
1402
|
+
* } else {
|
|
1403
|
+
* // Environment does not exist, handle accordingly
|
|
1404
|
+
* }
|
|
1405
|
+
* ```
|
|
1406
|
+
*
|
|
1407
|
+
* Using this method helps avoid unhandled exceptions in cases where an environment might not be defined.
|
|
1408
|
+
*/
|
|
1409
|
+
getEnvironmentSafe: (name?: string) => Promise<EnvironmentContext<TResolvedConfig> | undefined>;
|
|
1410
|
+
/**
|
|
1411
|
+
* A function to copy the context and update the fields for a specific environment
|
|
1412
|
+
*
|
|
1413
|
+
* @param environment - The environment configuration to use.
|
|
1414
|
+
* @returns A new context instance with the updated environment.
|
|
1415
|
+
*/
|
|
1416
|
+
in: (environment: EnvironmentResolvedConfig) => Promise<EnvironmentContext<TResolvedConfig>>;
|
|
1417
|
+
/**
|
|
1418
|
+
* A function to merge all configured environments into a single context
|
|
1419
|
+
*
|
|
1420
|
+
* @returns A promise that resolves to the merged environment context.
|
|
1421
|
+
*/
|
|
1422
|
+
toEnvironment: () => Promise<EnvironmentContext<TResolvedConfig>>;
|
|
1423
|
+
}
|
|
1424
|
+
interface EnvironmentContextPlugin<TResolvedConfig extends ResolvedConfig$2 = ResolvedConfig$2> {
|
|
1425
|
+
plugin: Plugin<PluginContext<TResolvedConfig>>;
|
|
1426
|
+
context: PluginContext<TResolvedConfig>;
|
|
1427
|
+
}
|
|
1428
|
+
type SelectHookResultItem<TContext extends PluginContext, TKey$1 extends string> = InferHooksListItem<TContext, TKey$1> & {
|
|
1429
|
+
context: TContext;
|
|
1430
|
+
};
|
|
1431
|
+
type SelectHookResult<TContext extends PluginContext, TKey$1 extends string> = SelectHookResultItem<TContext, TKey$1>[];
|
|
1432
|
+
interface EnvironmentContext<TResolvedConfig extends ResolvedConfig$2 = ResolvedConfig$2> extends Context<TResolvedConfig> {
|
|
1433
|
+
/**
|
|
1434
|
+
* The expected plugins options for the Powerlines project.
|
|
1435
|
+
*
|
|
1436
|
+
* @remarks
|
|
1437
|
+
* This is a record of plugin identifiers to their respective options. This field is populated by the Powerlines engine during both plugin initialization and the `init` command.
|
|
1438
|
+
*/
|
|
1439
|
+
plugins: EnvironmentContextPlugin<TResolvedConfig>[];
|
|
1440
|
+
/**
|
|
1441
|
+
* A function to add a plugin to the context and update the configuration options
|
|
1442
|
+
*/
|
|
1443
|
+
addPlugin: (plugin: Plugin<PluginContext<TResolvedConfig>>) => Promise<void>;
|
|
1444
|
+
/**
|
|
1445
|
+
* The environment specific resolved configuration
|
|
1446
|
+
*/
|
|
1447
|
+
environment: EnvironmentResolvedConfig;
|
|
1448
|
+
/**
|
|
1449
|
+
* A table holding references to hook functions registered by plugins
|
|
1450
|
+
*/
|
|
1451
|
+
hooks: HooksList<PluginContext<TResolvedConfig>>;
|
|
1452
|
+
/**
|
|
1453
|
+
* Retrieves the hook handlers for a specific hook name
|
|
1454
|
+
*/
|
|
1455
|
+
selectHooks: <TKey$1 extends string>(key: TKey$1, options?: SelectHooksOptions) => SelectHookResult<PluginContext<TResolvedConfig>, TKey$1>;
|
|
1456
|
+
}
|
|
1457
|
+
interface PluginContext<out TResolvedConfig extends ResolvedConfig$2 = ResolvedConfig$2> extends Context<TResolvedConfig>, UnpluginContext {
|
|
1458
|
+
/**
|
|
1459
|
+
* The environment specific resolved configuration
|
|
1460
|
+
*/
|
|
1461
|
+
environment: EnvironmentResolvedConfig;
|
|
1462
|
+
/**
|
|
1463
|
+
* An alternative property name for the {@link log} property
|
|
1464
|
+
*
|
|
1465
|
+
* @remarks
|
|
1466
|
+
* This is provided for compatibility with other logging libraries that expect a `logger` property.
|
|
1467
|
+
*/
|
|
1468
|
+
logger: LogFn;
|
|
1469
|
+
}
|
|
1470
|
+
type BuildPluginContext<TResolvedConfig extends ResolvedConfig$2 = ResolvedConfig$2> = UnpluginBuildContext & PluginContext<TResolvedConfig>;
|
|
1471
|
+
type WithUnpluginBuildContext<TContext extends PluginContext> = UnpluginBuildContext & TContext;
|
|
1472
|
+
declare type __ΩWorkerProcess = any[];
|
|
1473
|
+
declare type __ΩMetaInfo = any[];
|
|
1474
|
+
declare type __ΩResolver = any[];
|
|
1475
|
+
declare type __ΩTransformResult = any[];
|
|
1476
|
+
declare type __ΩSourceFile = any[];
|
|
1477
|
+
declare type __ΩUnimportContext = any[];
|
|
1478
|
+
declare type __ΩSelectHooksOptions = any[];
|
|
1479
|
+
declare type __ΩInitContextOptions = any[];
|
|
1480
|
+
declare type __ΩFetchOptions = any[];
|
|
1481
|
+
declare type __ΩParseOptions = any[];
|
|
1482
|
+
declare type __ΩEmitOptions = any[];
|
|
1483
|
+
declare type __ΩEmitEntryOptions = any[];
|
|
1484
|
+
declare type __ΩUnresolvedContext = any[];
|
|
1485
|
+
declare type __ΩContext = any[];
|
|
1486
|
+
declare type __ΩAPIContext = any[];
|
|
1487
|
+
declare type __ΩEnvironmentContextPlugin = any[];
|
|
1488
|
+
declare type __ΩSelectHookResultItem = any[];
|
|
1489
|
+
declare type __ΩSelectHookResult = any[];
|
|
1490
|
+
declare type __ΩEnvironmentContext = any[];
|
|
1491
|
+
declare type __ΩPluginContext = any[];
|
|
1492
|
+
declare type __ΩBuildPluginContext = any[];
|
|
1493
|
+
declare type __ΩWithUnpluginBuildContext = any[];
|
|
1494
|
+
//#endregion
|
|
1495
|
+
//#region ../core/src/types/config.d.ts
|
|
1496
|
+
type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
|
|
1497
|
+
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
1498
|
+
/**
|
|
1499
|
+
* The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
|
|
1500
|
+
*/
|
|
1501
|
+
type WorkspaceConfig = Partial<StormWorkspaceConfig> & Required<Pick<StormWorkspaceConfig, "workspaceRoot">>;
|
|
1502
|
+
type PluginFactory<in out TContext extends PluginContext = PluginContext, TOptions = any> = (options: TOptions) => MaybePromise<Plugin<TContext> | Plugin<TContext>[]>;
|
|
1503
|
+
/**
|
|
1504
|
+
* A configuration tuple for a Powerlines plugin.
|
|
1505
|
+
*/
|
|
1506
|
+
type PluginConfigTuple<TContext extends PluginContext = PluginContext, TOptions = any> = [string | PluginFactory<TContext, TOptions>, TOptions] | [Plugin<TContext>];
|
|
1507
|
+
/**
|
|
1508
|
+
* A configuration object for a Powerlines plugin.
|
|
1509
|
+
*/
|
|
1510
|
+
type PluginConfigObject<TContext extends PluginContext = PluginContext, TOptions = any> = {
|
|
1511
|
+
plugin: string | PluginFactory<TContext, TOptions>;
|
|
1512
|
+
options: TOptions;
|
|
1513
|
+
} | {
|
|
1514
|
+
plugin: Plugin<TContext>;
|
|
1515
|
+
options?: never;
|
|
1516
|
+
};
|
|
1517
|
+
/**
|
|
1518
|
+
* A configuration tuple for a Powerlines plugin.
|
|
1519
|
+
*/
|
|
1520
|
+
type PluginConfig<TContext extends PluginContext = PluginContext> = string | PluginFactory<TContext, void> | Plugin<TContext> | PluginConfigTuple<TContext> | PluginConfigObject<TContext> | Promise<PluginConfig<TContext>> | PluginConfig<TContext>[];
|
|
1521
|
+
type PartialPlugin<TContext extends PluginContext = PluginContext> = DeepPartial<Plugin<TContext>>;
|
|
1522
|
+
type PartialPluginFactory<in out TContext extends PluginContext = PluginContext, TOptions = any> = (options: TOptions) => MaybePromise<PartialPlugin<TContext> | PartialPlugin<TContext>[]>;
|
|
1523
|
+
type ProjectType = "application" | "library";
|
|
1524
|
+
/**
|
|
1525
|
+
* The configuration options for resolving modules in a Powerlines project.
|
|
1526
|
+
*/
|
|
1527
|
+
interface ResolveConfig {
|
|
1528
|
+
/**
|
|
1529
|
+
* List of fields in `package.json` to try when resolving a package's entry point. Note this takes lower precedence than conditional exports resolved from the exports field: if an entry point is successfully resolved from exports, the main field will be ignored.
|
|
1530
|
+
*
|
|
1531
|
+
* @defaultValue `["browser", "module", "jsnext:main", "jsnext"]`
|
|
1532
|
+
*
|
|
1533
|
+
* @see https://vite.dev/config/shared-options#resolve-mainfields
|
|
1534
|
+
*/
|
|
1535
|
+
mainFields?: string[];
|
|
1536
|
+
/**
|
|
1537
|
+
* Array of strings indicating what conditions should be allowed when resolving [conditional exports](https://nodejs.org/api/packages.html#packages_conditional_exports) from a package.
|
|
1538
|
+
*
|
|
1539
|
+
* @defaultValue `["import", "require", "default"]`
|
|
1540
|
+
*
|
|
1541
|
+
* @see https://vite.dev/config/shared-options#resolve-conditions
|
|
1542
|
+
*/
|
|
1543
|
+
conditions?: string[];
|
|
1544
|
+
/**
|
|
1545
|
+
* List of file extensions to try for imports that omit extensions. Note it is NOT recommended to omit extensions for custom import types (e.g. .vue) since it can interfere with IDE and type support.
|
|
1546
|
+
*
|
|
1547
|
+
* @defaultValue `[".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"]`
|
|
1548
|
+
*
|
|
1549
|
+
* @see https://vite.dev/config/shared-options#resolve-extensions
|
|
1550
|
+
*/
|
|
1551
|
+
extensions?: string[];
|
|
1552
|
+
/**
|
|
1553
|
+
* Array of strings indicating what modules should be deduplicated to a single version in the build.
|
|
1554
|
+
*
|
|
1555
|
+
* @remarks
|
|
1556
|
+
* This option is useful for ensuring that only one version of a module is included in the bundle, which can help reduce bundle size and avoid conflicts. If you have duplicated copies of the same dependency in your app (likely due to hoisting or linked packages in monorepos), use this option to force Powerlines to always resolve listed dependencies to the same copy (from project root).
|
|
1557
|
+
*
|
|
1558
|
+
* @see https://vite.dev/config/shared-options#resolve-dedupe
|
|
1559
|
+
*/
|
|
1560
|
+
dedupe?: string[];
|
|
1561
|
+
/**
|
|
1562
|
+
* The alias mappings to use for module resolution during the build process.
|
|
1563
|
+
*
|
|
1564
|
+
* @remarks
|
|
1565
|
+
* This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
|
|
1566
|
+
*
|
|
1567
|
+
* @example
|
|
1568
|
+
* ```ts
|
|
1569
|
+
* {
|
|
1570
|
+
* alias: {
|
|
1571
|
+
* "@utils": "./src/utils",
|
|
1572
|
+
* "@components": "./src/components"
|
|
1573
|
+
* }
|
|
1574
|
+
* }
|
|
1575
|
+
* ```
|
|
1576
|
+
*
|
|
1577
|
+
* @see https://vite.dev/config/shared-options#resolve-alias
|
|
1578
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/alias
|
|
1579
|
+
*/
|
|
1580
|
+
alias?: Record<string, string> | Array<{
|
|
1581
|
+
find: string | RegExp;
|
|
1582
|
+
replacement: string;
|
|
1583
|
+
}>;
|
|
1584
|
+
/**
|
|
1585
|
+
* Enabling this setting causes Powerlines to determine file identity by the original file path (i.e. the path without following symlinks) instead of the real file path (i.e. the path after following symlinks).
|
|
1586
|
+
*
|
|
1587
|
+
* @defaultValue false
|
|
1588
|
+
*
|
|
1589
|
+
* @see https://esbuild.github.io/api/#preserve-symlinks
|
|
1590
|
+
* @see https://rollupjs.org/configuration-options/#preservesymlinks
|
|
1591
|
+
* @see https://webpack.js.org/configuration/resolve/#resolvesymlinks
|
|
1592
|
+
* @see https://rolldown.rs/reference/InputOptions.resolve#symlinks
|
|
1593
|
+
* @see https://vite.dev/config/shared-options#resolve-preservesymlinks
|
|
1594
|
+
*/
|
|
1595
|
+
preserveSymlinks?: boolean;
|
|
1596
|
+
/**
|
|
1597
|
+
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
1598
|
+
*
|
|
1599
|
+
* @remarks
|
|
1600
|
+
* This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
|
|
1601
|
+
*/
|
|
1602
|
+
external?: (string | RegExp)[];
|
|
1603
|
+
/**
|
|
1604
|
+
* A list of modules that should always be bundled, even if they are external dependencies.
|
|
1605
|
+
*/
|
|
1606
|
+
noExternal?: (string | RegExp)[];
|
|
1607
|
+
/**
|
|
1608
|
+
* Should the Powerlines CLI processes skip bundling the `node_modules` directory?
|
|
1609
|
+
*/
|
|
1610
|
+
skipNodeModulesBundle?: boolean;
|
|
1611
|
+
}
|
|
1612
|
+
interface OutputConfig {
|
|
1613
|
+
/**
|
|
1614
|
+
* The path to output the final compiled files to
|
|
1615
|
+
*
|
|
1616
|
+
* @remarks
|
|
1617
|
+
* If a value is not provided, Powerlines will attempt to:
|
|
1618
|
+
* 1. Use the `outDir` value in the `tsconfig.json` file.
|
|
1619
|
+
* 2. Use the `dist` directory in the project root directory.
|
|
1620
|
+
*
|
|
1621
|
+
* @defaultValue "dist/\{projectRoot\}"
|
|
1622
|
+
*/
|
|
1623
|
+
outputPath?: string;
|
|
1624
|
+
/**
|
|
1625
|
+
* The output directory path for the project build.
|
|
1626
|
+
*
|
|
1627
|
+
* @remarks
|
|
1628
|
+
* This path is used to determine where the built files will be placed after the build process completes. This will be used in scenarios where the monorepo uses TSConfig paths to link packages together.
|
|
1629
|
+
*
|
|
1630
|
+
* @defaultValue "\{projectRoot\}/dist"
|
|
1631
|
+
*/
|
|
1632
|
+
buildPath?: string;
|
|
1633
|
+
/**
|
|
1634
|
+
* The folder where the generated runtime artifacts will be located
|
|
1635
|
+
*
|
|
1636
|
+
* @remarks
|
|
1637
|
+
* This folder will contain all runtime artifacts and builtins generated during the "prepare" phase.
|
|
1638
|
+
*
|
|
1639
|
+
* @defaultValue "\{projectRoot\}/.powerlines"
|
|
1640
|
+
*/
|
|
1641
|
+
artifactsPath?: string;
|
|
1642
|
+
/**
|
|
1643
|
+
* The path of the generated runtime declaration file relative to the workspace root.
|
|
1644
|
+
*
|
|
1645
|
+
* @defaultValue "\{projectRoot\}/powerlines.d.ts"
|
|
1646
|
+
*/
|
|
1647
|
+
dts?: string | false;
|
|
1648
|
+
/**
|
|
1649
|
+
* The module format of the output files
|
|
1650
|
+
*
|
|
1651
|
+
* @remarks
|
|
1652
|
+
* This option can be a single format or an array of formats. If an array is provided, multiple builds will be generated for each format.
|
|
1653
|
+
*
|
|
1654
|
+
* @defaultValue "esm"
|
|
1655
|
+
*/
|
|
1656
|
+
format?: Format | Format[];
|
|
1657
|
+
/**
|
|
1658
|
+
* Generate source maps for the output files
|
|
1659
|
+
*
|
|
1660
|
+
* @remarks
|
|
1661
|
+
* This option can be a boolean or a string specifying the type of source map to generate. If set to `true`, external source maps will be generated. If set to `"inline"`, source maps will be included in the output files as data URIs. If set to `"hidden"`, external source maps will be generated but not referenced in the output files.
|
|
1662
|
+
*/
|
|
1663
|
+
sourceMap?: boolean | "inline" | "hidden";
|
|
1664
|
+
/**
|
|
1665
|
+
* A list of assets to copy to the output directory
|
|
1666
|
+
*
|
|
1667
|
+
* @remarks
|
|
1668
|
+
* The assets can be specified as a string (path to the asset) or as an object with a `glob` property (to match multiple files). The paths are relative to the project root directory.
|
|
1669
|
+
*/
|
|
1670
|
+
assets?: Array<string | AssetGlob>;
|
|
1671
|
+
/**
|
|
1672
|
+
* A string preset or a custom {@link StoragePort} to provide fine-grained control over generated/output file storage.
|
|
1673
|
+
*
|
|
1674
|
+
* @remarks
|
|
1675
|
+
* If a string preset is provided, it must be one of the following values:
|
|
1676
|
+
* - `"virtual"`: Uses the local file system for storage.
|
|
1677
|
+
* - `"fs"`: Uses an in-memory virtual file system for storage.
|
|
1678
|
+
*
|
|
1679
|
+
* If a custom {@link StoragePort} is provided, it will be used for all file storage operations during the build process.
|
|
1680
|
+
*
|
|
1681
|
+
* @defaultValue "virtual"
|
|
1682
|
+
*/
|
|
1683
|
+
storage?: StoragePort | StoragePreset;
|
|
1684
|
+
}
|
|
1685
|
+
interface BaseConfig {
|
|
1686
|
+
/**
|
|
1687
|
+
* Defines entries and location(s) of entry modules for the bundle. Relative paths are resolved based on the `root` option.
|
|
1688
|
+
*/
|
|
1689
|
+
input: string | RegExp | TypeDefinition | (string | RegExp | TypeDefinition)[] | Record<string, string | RegExp | TypeDefinition | (string | RegExp | TypeDefinition)[]>;
|
|
1690
|
+
/**
|
|
1691
|
+
* Configuration for the output files generated by processing the source code
|
|
1692
|
+
*/
|
|
1693
|
+
output?: OutputConfig;
|
|
1694
|
+
/**
|
|
1695
|
+
* Configuration for module resolution during processing of the source code
|
|
1696
|
+
*/
|
|
1697
|
+
resolve?: ResolveConfig;
|
|
1698
|
+
/**
|
|
1699
|
+
* The platform to build the project for
|
|
1700
|
+
*
|
|
1701
|
+
* @defaultValue "neutral"
|
|
1702
|
+
*/
|
|
1703
|
+
platform?: "node" | "browser" | "neutral";
|
|
1704
|
+
/**
|
|
1705
|
+
* Define global constant replacements. Entries will be defined as globals during dev and statically replaced during build.
|
|
1706
|
+
*
|
|
1707
|
+
* @remarks
|
|
1708
|
+
* This option allows you to specify global constants that will be replaced in the code during the build process. It is similar to the `define` option in esbuild and Vite, enabling you to replace specific identifiers with constant expressions at build time.
|
|
1709
|
+
*
|
|
1710
|
+
* @example
|
|
1711
|
+
* ```ts
|
|
1712
|
+
* {
|
|
1713
|
+
* define: {
|
|
1714
|
+
* __VERSION__: '"1.0.0"',
|
|
1715
|
+
* __DEV__: 'process.env.NODE_ENV !== "production"'
|
|
1716
|
+
* }
|
|
1717
|
+
* }
|
|
1718
|
+
* ```
|
|
1719
|
+
*
|
|
1720
|
+
* @see https://esbuild.github.io/api/#define
|
|
1721
|
+
* @see https://vitejs.dev/config/build-options.html#define
|
|
1722
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/replace
|
|
1723
|
+
*/
|
|
1724
|
+
define?: Record<string, any>;
|
|
1725
|
+
/**
|
|
1726
|
+
* Global variables that will have import statements injected where necessary
|
|
1727
|
+
*
|
|
1728
|
+
* @remarks
|
|
1729
|
+
* This option allows you to specify global variables that should be automatically imported from specified modules whenever they are used in the code. This is particularly useful for polyfilling Node.js globals in a browser environment.
|
|
1730
|
+
*
|
|
1731
|
+
* @example
|
|
1732
|
+
* ```ts
|
|
1733
|
+
* {
|
|
1734
|
+
* inject: {
|
|
1735
|
+
* process: 'process/browser',
|
|
1736
|
+
* Buffer: ['buffer', 'Buffer'],
|
|
1737
|
+
* }
|
|
1738
|
+
* }
|
|
1739
|
+
* ```
|
|
1740
|
+
*
|
|
1741
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/inject
|
|
1742
|
+
*/
|
|
1743
|
+
inject?: Record<string, string | string[]>;
|
|
1744
|
+
/**
|
|
1745
|
+
* The path to the tsconfig file to be used by the compiler
|
|
1746
|
+
*
|
|
1747
|
+
* @remarks
|
|
1748
|
+
* If a value is not provided, the plugin will attempt to find the `tsconfig.json` file in the project root directory. The parsed tsconfig compiler options will be merged with the {@link Options.tsconfigRaw} value (if provided).
|
|
1749
|
+
*
|
|
1750
|
+
* @defaultValue "\{projectRoot\}/tsconfig.json"
|
|
1751
|
+
*/
|
|
1752
|
+
tsconfig?: string;
|
|
1753
|
+
/**
|
|
1754
|
+
* The raw {@link TSConfig} object to be used by the compiler. This object will be merged with the `tsconfig.json` file.
|
|
1755
|
+
*
|
|
1756
|
+
* @see https://www.typescriptlang.org/tsconfig
|
|
1757
|
+
*
|
|
1758
|
+
* @remarks
|
|
1759
|
+
* If populated, this option takes higher priority than `tsconfig`
|
|
1760
|
+
*/
|
|
1761
|
+
tsconfigRaw?: TSConfig;
|
|
1762
|
+
}
|
|
1763
|
+
interface EnvironmentConfig extends BaseConfig {
|
|
1764
|
+
/**
|
|
1765
|
+
* Configuration options for the preview server
|
|
1766
|
+
*/
|
|
1767
|
+
preview?: PreviewOptions;
|
|
1768
|
+
/**
|
|
1769
|
+
* A flag indicating whether the build is for a Server-Side Rendering environment.
|
|
1770
|
+
*/
|
|
1771
|
+
ssr?: boolean;
|
|
1772
|
+
/**
|
|
1773
|
+
* Define if this environment is used for Server-Side Rendering
|
|
1774
|
+
*
|
|
1775
|
+
* @defaultValue "server" (if it isn't the client environment)
|
|
1776
|
+
*/
|
|
1777
|
+
consumer?: "client" | "server";
|
|
1778
|
+
}
|
|
1779
|
+
interface UserConfig$1 extends BaseConfig {
|
|
1780
|
+
/**
|
|
1781
|
+
* The root directory of the project
|
|
1782
|
+
*/
|
|
1783
|
+
root: string;
|
|
1784
|
+
/**
|
|
1785
|
+
* The name of the project
|
|
1786
|
+
*/
|
|
1787
|
+
name?: string;
|
|
1788
|
+
/**
|
|
1789
|
+
* The project display title
|
|
1790
|
+
*
|
|
1791
|
+
* @remarks
|
|
1792
|
+
* This option is used in documentation generation and other places where a human-readable title is needed.
|
|
1793
|
+
*/
|
|
1794
|
+
title?: string;
|
|
1795
|
+
/**
|
|
1796
|
+
* A description of the project
|
|
1797
|
+
*
|
|
1798
|
+
* @remarks
|
|
1799
|
+
* If this option is not provided, the build process will try to use the \`description\` value from the `\package.json\` file.
|
|
1800
|
+
*/
|
|
1801
|
+
description?: string;
|
|
1802
|
+
/**
|
|
1803
|
+
* The organization or author of the project
|
|
1804
|
+
*
|
|
1805
|
+
* @remarks
|
|
1806
|
+
* If this option is not provided, the build process will try to use the \`author\` value from the \`package.json\` file. If the \`author\` value cannot be determined, the {@link name | name configuration} will be used.
|
|
1807
|
+
*/
|
|
1808
|
+
organization?: string;
|
|
1809
|
+
/**
|
|
1810
|
+
* The date to use for compatibility checks
|
|
1811
|
+
*
|
|
1812
|
+
* @remarks
|
|
1813
|
+
* This date can be used by plugins and build processes to determine compatibility with certain features or APIs. It is recommended to set this date to the date when the project was last known to be compatible with the desired features or APIs. If no value is provided, the latest compatibility date will be used.
|
|
1814
|
+
*
|
|
1815
|
+
* @see https://developers.cloudflare.com/pages/platform/compatibility-dates/
|
|
1816
|
+
* @see https://docs.netlify.com/configure-builds/get-started/#set-a-compatibility-date
|
|
1817
|
+
* @see https://github.com/unjs/compatx
|
|
1818
|
+
*/
|
|
1819
|
+
compatibilityDate?: CompatibilityDateSpec;
|
|
1820
|
+
/**
|
|
1821
|
+
* The log level to use for the Powerlines processes.
|
|
1822
|
+
*
|
|
1823
|
+
* @defaultValue "info"
|
|
1824
|
+
*/
|
|
1825
|
+
logLevel?: LogLevel | null;
|
|
1826
|
+
/**
|
|
1827
|
+
* A custom logger function to use for logging messages
|
|
1828
|
+
*/
|
|
1829
|
+
customLogger?: LogFn;
|
|
1830
|
+
/**
|
|
1831
|
+
* Explicitly set a mode to run in. This mode will be used at various points throughout the Powerlines processes, such as when compiling the source code.
|
|
1832
|
+
*
|
|
1833
|
+
* @defaultValue "production"
|
|
1834
|
+
*/
|
|
1835
|
+
mode?: "development" | "test" | "production";
|
|
1836
|
+
/**
|
|
1837
|
+
* The type of project being built
|
|
1838
|
+
*
|
|
1839
|
+
* @defaultValue "application"
|
|
1840
|
+
*/
|
|
1841
|
+
projectType?: ProjectType;
|
|
1842
|
+
/**
|
|
1843
|
+
* A path to a custom configuration file to be used instead of the default `storm.json`, `powerlines.config.js`, or `powerlines.config.ts` files.
|
|
1844
|
+
*
|
|
1845
|
+
* @remarks
|
|
1846
|
+
* This option is useful for running Powerlines commands with different configuration files, such as in CI/CD environments or when testing different configurations.
|
|
1847
|
+
*/
|
|
1848
|
+
configFile?: string;
|
|
1849
|
+
/**
|
|
1850
|
+
* Should the Powerlines processes automatically install missing package dependencies?
|
|
1851
|
+
*
|
|
1852
|
+
* @remarks
|
|
1853
|
+
* When set to `true`, Powerlines will attempt to install any missing dependencies using the package manager detected in the project (e.g., npm, yarn, pnpm). This can be useful for ensuring that all required packages are available during the build and preparation phases.
|
|
1854
|
+
*
|
|
1855
|
+
* @defaultValue false
|
|
1856
|
+
*/
|
|
1857
|
+
autoInstall?: boolean;
|
|
1858
|
+
/**
|
|
1859
|
+
* Should the compiler processes skip any improvements that make use of cache?
|
|
1860
|
+
*
|
|
1861
|
+
* @defaultValue false
|
|
1862
|
+
*/
|
|
1863
|
+
skipCache?: boolean;
|
|
1864
|
+
/**
|
|
1865
|
+
* A list of resolvable paths to plugins used during the build process
|
|
1866
|
+
*/
|
|
1867
|
+
plugins?: PluginConfig<any>[];
|
|
1868
|
+
/**
|
|
1869
|
+
* Environment-specific configurations
|
|
1870
|
+
*/
|
|
1871
|
+
environments?: Record<string, EnvironmentConfig>;
|
|
1872
|
+
/**
|
|
1873
|
+
* Should a single `build` process be ran for each environment?
|
|
1874
|
+
*
|
|
1875
|
+
* @remarks
|
|
1876
|
+
* This option determines how environments are managed during the `build` process. The available options are:
|
|
1877
|
+
*
|
|
1878
|
+
* - `false`: A separate build is ran for each environment.
|
|
1879
|
+
* - `true`: A single build is ran for all environments.
|
|
1880
|
+
*
|
|
1881
|
+
* @defaultValue false
|
|
1882
|
+
*/
|
|
1883
|
+
singleBuild?: boolean;
|
|
1884
|
+
/**
|
|
1885
|
+
* A string identifier that allows a child framework or tool to identify itself when using Powerlines.
|
|
1886
|
+
*
|
|
1887
|
+
* @remarks
|
|
1888
|
+
* If no values are provided for {@link OutputConfig.dts | output.dts} or {@link OutputConfig.artifactsPath | output.artifactsFolder}, this value will be used as the default.
|
|
1889
|
+
*
|
|
1890
|
+
* @defaultValue "powerlines"
|
|
1891
|
+
*/
|
|
1892
|
+
framework?: string;
|
|
1893
|
+
}
|
|
1894
|
+
type InitialUserConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Partial<TUserConfig> & {
|
|
1895
|
+
root: string;
|
|
1896
|
+
};
|
|
1897
|
+
type ParsedUserConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = TUserConfig & ResolvedConfig<TUserConfig> & {
|
|
1898
|
+
/**
|
|
1899
|
+
* The path to the user configuration file, if it exists.
|
|
1900
|
+
*
|
|
1901
|
+
* @remarks
|
|
1902
|
+
* This is typically the `powerlines.json`, `powerlines.config.js`, or `powerlines.config.ts` file in the project root.
|
|
1903
|
+
*/
|
|
1904
|
+
configFile?: ConfigLayer<TUserConfig>["configFile"];
|
|
1905
|
+
};
|
|
1906
|
+
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
|
|
1907
|
+
/**
|
|
1908
|
+
* The configuration provided while executing Powerlines commands.
|
|
1909
|
+
*/
|
|
1910
|
+
type InlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Partial<TUserConfig> & {
|
|
1911
|
+
/**
|
|
1912
|
+
* A string identifier for the Powerlines command being executed
|
|
1913
|
+
*/
|
|
1914
|
+
command: PowerlinesCommand;
|
|
1915
|
+
};
|
|
1916
|
+
type NewInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & Required<Pick<InlineConfig<TUserConfig>, "root">> & {
|
|
1917
|
+
/**
|
|
1918
|
+
* A string identifier for the Powerlines command being executed
|
|
1919
|
+
*/
|
|
1920
|
+
command: "new";
|
|
1921
|
+
/**
|
|
1922
|
+
* The package name (from the \`package.json\`) for the project that will be used in the \`new\` command to create a new project based on this configuration
|
|
1923
|
+
*/
|
|
1924
|
+
packageName?: string;
|
|
1925
|
+
};
|
|
1926
|
+
type CleanInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & {
|
|
1927
|
+
/**
|
|
1928
|
+
* A string identifier for the Powerlines command being executed
|
|
1929
|
+
*/
|
|
1930
|
+
command: "clean";
|
|
1931
|
+
};
|
|
1932
|
+
type PrepareInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & {
|
|
1933
|
+
/**
|
|
1934
|
+
* A string identifier for the Powerlines command being executed
|
|
1935
|
+
*/
|
|
1936
|
+
command: "prepare";
|
|
1937
|
+
};
|
|
1938
|
+
type BuildInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & {
|
|
1939
|
+
/**
|
|
1940
|
+
* A string identifier for the Powerlines command being executed
|
|
1941
|
+
*/
|
|
1942
|
+
command: "build";
|
|
1943
|
+
};
|
|
1944
|
+
type LintInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & {
|
|
1945
|
+
/**
|
|
1946
|
+
* A string identifier for the Powerlines command being executed
|
|
1947
|
+
*/
|
|
1948
|
+
command: "lint";
|
|
1949
|
+
};
|
|
1950
|
+
type DocsInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & {
|
|
1951
|
+
/**
|
|
1952
|
+
* A string identifier for the Powerlines command being executed
|
|
1953
|
+
*/
|
|
1954
|
+
command: "docs";
|
|
1955
|
+
};
|
|
1956
|
+
type DeployInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = InlineConfig<TUserConfig> & {
|
|
1957
|
+
/**
|
|
1958
|
+
* A string identifier for the Powerlines command being executed
|
|
1959
|
+
*/
|
|
1960
|
+
command: "deploy";
|
|
1961
|
+
};
|
|
1962
|
+
type ConfigEnv = Pick<ResolvedConfig$1, "command" | "mode" | "environments" | "preview">;
|
|
1963
|
+
/**
|
|
1964
|
+
* The configuration options for a Powerlines project, after being resolved and normalized by the configuration loading process.
|
|
1965
|
+
*
|
|
1966
|
+
* @remarks
|
|
1967
|
+
* This type represents the final shape of the configuration object that will be used throughout the Powerlines processes. It includes all default values, resolved paths, and normalized options. It is expected to be used in `powerlines.config.ts` files and by plugins and build processes to access the configuration options in a consistent format.
|
|
1968
|
+
*/
|
|
1969
|
+
type AnyUserConfig = Partial<Omit<UserConfig$1, "output" | "resolve">> & {
|
|
1970
|
+
/**
|
|
1971
|
+
* The output configuration options to use for the build process
|
|
1972
|
+
*/
|
|
1973
|
+
output?: Partial<OutputConfig>;
|
|
1974
|
+
/**
|
|
1975
|
+
* Configuration for module resolution during processing of the source code
|
|
1976
|
+
*/
|
|
1977
|
+
resolve?: Partial<ResolveConfig>;
|
|
1978
|
+
} & Record<string, any>;
|
|
1979
|
+
interface ResolvedEntryTypeDefinition extends TypeDefinition {
|
|
1980
|
+
/**
|
|
1981
|
+
* The user provided entry point in the source code
|
|
1982
|
+
*/
|
|
1983
|
+
input?: TypeDefinition;
|
|
1984
|
+
/**
|
|
1985
|
+
* An optional name to use in the package export during the build process
|
|
1986
|
+
*/
|
|
1987
|
+
output?: string;
|
|
1988
|
+
}
|
|
1989
|
+
type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "ssr">> & {
|
|
1990
|
+
/**
|
|
1991
|
+
* The name of the environment
|
|
1992
|
+
*/
|
|
1993
|
+
name: string;
|
|
1994
|
+
/**
|
|
1995
|
+
* Configuration options for the preview server
|
|
1996
|
+
*/
|
|
1997
|
+
preview?: ResolvedPreviewOptions;
|
|
1998
|
+
};
|
|
1999
|
+
/**
|
|
2000
|
+
* The configuration options for resolving modules in a Powerlines project.
|
|
2001
|
+
*/
|
|
2002
|
+
type ResolveResolvedConfig = Required<Omit<ResolveConfig, "external" | "noExternal">> & {
|
|
2003
|
+
/**
|
|
2004
|
+
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
2005
|
+
*
|
|
2006
|
+
* @remarks
|
|
2007
|
+
* This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
|
|
2008
|
+
*/
|
|
2009
|
+
external?: string[];
|
|
2010
|
+
/**
|
|
2011
|
+
* A list of modules that should always be bundled, even if they are external dependencies.
|
|
2012
|
+
*/
|
|
2013
|
+
noExternal?: string[];
|
|
2014
|
+
};
|
|
2015
|
+
type ResolvedAssetGlob = AssetGlob & Required<Pick<AssetGlob, "input">>;
|
|
2016
|
+
type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> & {
|
|
2017
|
+
assets: ResolvedAssetGlob[];
|
|
2018
|
+
}> & Pick<OutputConfig, "storage">;
|
|
2019
|
+
/**
|
|
2020
|
+
* The resolved options for the Powerlines project configuration.
|
|
2021
|
+
*/
|
|
2022
|
+
type ResolvedConfig$2<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUserConfig, "root" | "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "tsconfig" | "platform" | "projectType" | "input" | "output" | "resolve" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "root" | "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "input" | "tsconfig" | "platform" | "projectType" | "framework">> & {
|
|
2023
|
+
/**
|
|
2024
|
+
* The output configuration options to use for the build process
|
|
2025
|
+
*/
|
|
2026
|
+
output: OutputResolvedConfig;
|
|
2027
|
+
/**
|
|
2028
|
+
* Configuration for module resolution during processing of the source code
|
|
2029
|
+
*/
|
|
2030
|
+
resolve: ResolveResolvedConfig;
|
|
2031
|
+
/**
|
|
2032
|
+
* The date to use for compatibility checks
|
|
2033
|
+
*
|
|
2034
|
+
* @remarks
|
|
2035
|
+
* This date can be used by plugins and build processes to determine compatibility with certain features or APIs. It is recommended to set this date to the date when the project was last known to be compatible with the desired features or APIs.
|
|
2036
|
+
*
|
|
2037
|
+
* @see https://developers.cloudflare.com/pages/platform/compatibility-dates/
|
|
2038
|
+
* @see https://docs.netlify.com/configure-builds/get-started/#set-a-compatibility-date
|
|
2039
|
+
* @see https://github.com/unjs/compatx
|
|
2040
|
+
*/
|
|
2041
|
+
compatibilityDate: CompatibilityDates;
|
|
2042
|
+
/**
|
|
2043
|
+
* The configuration options that were provided inline to the Powerlines CLI.
|
|
2044
|
+
*/
|
|
2045
|
+
inlineConfig: InlineConfig<TUserConfig>;
|
|
2046
|
+
/**
|
|
2047
|
+
* The original configuration options that were provided by the user to the Powerlines process.
|
|
2048
|
+
*/
|
|
2049
|
+
userConfig: TUserConfig;
|
|
2050
|
+
/**
|
|
2051
|
+
* A string identifier for the Powerlines command being executed.
|
|
2052
|
+
*/
|
|
2053
|
+
command: NonUndefined<InlineConfig<TUserConfig>["command"]>;
|
|
2054
|
+
/**
|
|
2055
|
+
* The log level to use for the Powerlines processes.
|
|
2056
|
+
*
|
|
2057
|
+
* @defaultValue "info"
|
|
2058
|
+
*/
|
|
2059
|
+
logLevel: LogLevel | null;
|
|
2060
|
+
};
|
|
2061
|
+
declare type __ΩLogLevel = any[];
|
|
2062
|
+
declare type __ΩLogFn = any[];
|
|
2063
|
+
declare type __ΩWorkspaceConfig = any[];
|
|
2064
|
+
declare type __ΩPluginFactory = any[];
|
|
2065
|
+
declare type __ΩPluginConfigTuple = any[];
|
|
2066
|
+
declare type __ΩPluginConfigObject = any[];
|
|
2067
|
+
declare type __ΩPluginConfig = any[];
|
|
2068
|
+
declare type __ΩPartialPlugin = any[];
|
|
2069
|
+
declare type __ΩPartialPluginFactory = any[];
|
|
2070
|
+
declare type __ΩProjectType = any[];
|
|
2071
|
+
declare type __ΩResolveConfig = any[];
|
|
2072
|
+
declare type __ΩOutputConfig = any[];
|
|
2073
|
+
declare type __ΩBaseConfig = any[];
|
|
2074
|
+
declare type __ΩEnvironmentConfig = any[];
|
|
2075
|
+
declare type __ΩUserConfig = any[];
|
|
2076
|
+
declare type __ΩInitialUserConfig = any[];
|
|
2077
|
+
declare type __ΩParsedUserConfig = any[];
|
|
2078
|
+
declare type __ΩPowerlinesCommand = any[];
|
|
2079
|
+
declare type __ΩInlineConfig = any[];
|
|
2080
|
+
declare type __ΩNewInlineConfig = any[];
|
|
2081
|
+
declare type __ΩCleanInlineConfig = any[];
|
|
2082
|
+
declare type __ΩPrepareInlineConfig = any[];
|
|
2083
|
+
declare type __ΩBuildInlineConfig = any[];
|
|
2084
|
+
declare type __ΩLintInlineConfig = any[];
|
|
2085
|
+
declare type __ΩDocsInlineConfig = any[];
|
|
2086
|
+
declare type __ΩDeployInlineConfig = any[];
|
|
2087
|
+
declare type __ΩConfigEnv = any[];
|
|
2088
|
+
declare type __ΩAnyUserConfig = any[];
|
|
2089
|
+
declare type __ΩResolvedEntryTypeDefinition = any[];
|
|
2090
|
+
declare type __ΩEnvironmentResolvedConfig = any[];
|
|
2091
|
+
declare type __ΩResolveResolvedConfig = any[];
|
|
2092
|
+
declare type __ΩResolvedAssetGlob = any[];
|
|
2093
|
+
declare type __ΩOutputResolvedConfig = any[];
|
|
2094
|
+
declare type __ΩResolvedConfig = any[];
|
|
2095
|
+
//#endregion
|
|
2096
|
+
//#region ../core/src/types/api.d.ts
|
|
2097
|
+
/**
|
|
2098
|
+
* Powerlines API Interface
|
|
2099
|
+
*/
|
|
2100
|
+
interface API<TResolvedConfig extends ResolvedConfig$2 = ResolvedConfig$2> {
|
|
2101
|
+
/**
|
|
2102
|
+
* The Powerlines shared API context
|
|
2103
|
+
*/
|
|
2104
|
+
context: APIContext<TResolvedConfig>;
|
|
2105
|
+
/**
|
|
2106
|
+
* Prepare the Powerlines API
|
|
2107
|
+
*
|
|
2108
|
+
* @remarks
|
|
2109
|
+
* This method will prepare the Powerlines API for use, initializing any necessary resources.
|
|
2110
|
+
*
|
|
2111
|
+
* @param inlineConfig - The inline configuration for the prepare command
|
|
2112
|
+
*/
|
|
2113
|
+
prepare: (inlineConfig: PrepareInlineConfig | NewInlineConfig | CleanInlineConfig | BuildInlineConfig | LintInlineConfig | DocsInlineConfig | DeployInlineConfig) => Promise<void>;
|
|
2114
|
+
/**
|
|
2115
|
+
* Create a new Powerlines project
|
|
2116
|
+
*
|
|
2117
|
+
* @remarks
|
|
2118
|
+
* This method will create a new Powerlines project in the current directory.
|
|
2119
|
+
*
|
|
2120
|
+
* @param inlineConfig - The inline configuration for the new command
|
|
2121
|
+
* @returns A promise that resolves when the project has been created
|
|
2122
|
+
*/
|
|
2123
|
+
new: (inlineConfig: NewInlineConfig) => Promise<void>;
|
|
2124
|
+
/**
|
|
2125
|
+
* Clean any previously prepared artifacts
|
|
2126
|
+
*
|
|
2127
|
+
* @remarks
|
|
2128
|
+
* This method will remove the previous Powerlines artifacts from the project.
|
|
2129
|
+
*
|
|
2130
|
+
* @param inlineConfig - The inline configuration for the clean command
|
|
2131
|
+
* @returns A promise that resolves when the clean command has completed
|
|
2132
|
+
*/
|
|
2133
|
+
clean: (inlineConfig: CleanInlineConfig | PrepareInlineConfig) => Promise<void>;
|
|
2134
|
+
/**
|
|
2135
|
+
* Lint the project source code
|
|
2136
|
+
*
|
|
2137
|
+
* @param inlineConfig - The inline configuration for the lint command
|
|
2138
|
+
* @returns A promise that resolves when the lint command has completed
|
|
2139
|
+
*/
|
|
2140
|
+
lint: (inlineConfig: LintInlineConfig) => Promise<void>;
|
|
2141
|
+
/**
|
|
2142
|
+
* Build the project
|
|
2143
|
+
*
|
|
2144
|
+
* @remarks
|
|
2145
|
+
* This method will build the Powerlines project, generating the necessary artifacts.
|
|
2146
|
+
*
|
|
2147
|
+
* @param inlineConfig - The inline configuration for the build command
|
|
2148
|
+
* @returns A promise that resolves when the build command has completed
|
|
2149
|
+
*/
|
|
2150
|
+
build: (inlineConfig: BuildInlineConfig) => Promise<void>;
|
|
2151
|
+
/**
|
|
2152
|
+
* Prepare the documentation for the project
|
|
2153
|
+
*
|
|
2154
|
+
* @param inlineConfig - The inline configuration for the docs command
|
|
2155
|
+
* @returns A promise that resolves when the documentation generation has completed
|
|
2156
|
+
*/
|
|
2157
|
+
docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
|
|
2158
|
+
/**
|
|
2159
|
+
* Deploy the project source code
|
|
2160
|
+
*
|
|
2161
|
+
* @remarks
|
|
2162
|
+
* This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
|
|
2163
|
+
*
|
|
2164
|
+
* @param inlineConfig - The inline configuration for the deploy command
|
|
2165
|
+
*/
|
|
2166
|
+
deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
|
|
2167
|
+
/**
|
|
2168
|
+
* Finalization process
|
|
2169
|
+
*
|
|
2170
|
+
* @remarks
|
|
2171
|
+
* This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
|
|
2172
|
+
*
|
|
2173
|
+
* @returns A promise that resolves when the finalization process has completed
|
|
2174
|
+
*/
|
|
2175
|
+
finalize: () => Promise<void>;
|
|
2176
|
+
/**
|
|
2177
|
+
* Invokes the configured plugin hooks
|
|
2178
|
+
*
|
|
2179
|
+
* @remarks
|
|
2180
|
+
* By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
|
|
2181
|
+
*
|
|
2182
|
+
* @param hook - The hook to call
|
|
2183
|
+
* @param options - The options to provide to the hook
|
|
2184
|
+
* @param args - The arguments to pass to the hook
|
|
2185
|
+
* @returns The result of the hook call
|
|
2186
|
+
*/
|
|
2187
|
+
callHook: <TKey$1 extends string>(hook: TKey$1, options: CallHookOptions & {
|
|
2188
|
+
environment?: string | EnvironmentContext<TResolvedConfig>;
|
|
2189
|
+
}, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey$1>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey$1> | undefined>;
|
|
2190
|
+
}
|
|
2191
|
+
declare type __ΩAPI = any[];
|
|
2192
|
+
//#endregion
|
|
2193
|
+
export { __ΩOutputResolvedConfig as $, __ΩUnpluginHooksListItem as $n, WriteOptions as $r, __ΩSelectHookResultItem as $t, ResolveConfig as A, InferHooksListItem as An, __ΩBuilderVariant as Ar, SelectHookResult as At, __ΩCleanInlineConfig as B, __ΩHookListOrders as Bn, __ΩCommandType as Br, __ΩBuildPluginContext as Bt, PluginConfig as C, HookFields as Cn, InferUnpluginOptions as Cr, EnvironmentContextPlugin as Ct, PowerlinesCommand as D, InferHookParameters as Dn, UnpluginFactory as Dr, ParseOptions as Dt, PluginFactory as E, InferHookFunction as En, UnpluginBuilderVariant as Er, MetaInfo as Et, UserConfig$1 as F, UnpluginHookVariant as Fn, __ΩUnpluginOptions as Fr, UnimportContext as Ft, __ΩEnvironmentResolvedConfig as G, __ΩInferHookThisType as Gn, StoragePort as Gr, __ΩEnvironmentContextPlugin as Gt, __ΩDeployInlineConfig as H, __ΩInferHookFunction as Hn, ResolveOptions$1 as Hr, __ΩEmitEntryOptions as Ht, WorkspaceConfig as I, UnpluginHookVariantField as In, __ΩUnpluginUserConfig as Ir, UnresolvedContext as It, __ΩLintInlineConfig as J, __ΩPluginHooksListItem as Jn, VirtualFileData as Jr, __ΩMetaInfo as Jt, __ΩInitialUserConfig as K, __ΩInferHooksListItem as Kn, StoragePreset as Kr, __ΩFetchOptions as Kt, __ΩAnyUserConfig as L, UnpluginHooksListItem as Ln, CommandType as Lr, WithUnpluginBuildContext as Lt, ResolvedAssetGlob as M, PluginHooksListItem as Mn, __ΩInferUnpluginVariant as Mr, SelectHooksOptions as Mt, ResolvedConfig$2 as N, UnpluginHookFunctions as Nn, __ΩUnpluginBuilderVariant as Nr, SourceFile as Nt, PrepareInlineConfig as O, InferHookReturnType as On, UnpluginOptions$1 as Or, PluginContext as Ot, ResolvedEntryTypeDefinition as P, UnpluginHookList as Pn, __ΩUnpluginFactory as Pr, TransformResult$1 as Pt, __ΩOutputConfig as Q, __ΩUnpluginHookVariantField as Qn, WriteData as Qr, __ΩSelectHookResult as Qt, __ΩBaseConfig as R, __ΩCallHookOptions as Rn, Commands as Rr, WorkerProcess as Rt, PartialPluginFactory as S, HOOKS_LIST_ORDERS as Sn, BuilderVariant as Sr, EnvironmentContext as St, PluginConfigTuple as T, HooksList as Tn, UNPLUGIN_BUILDER_VARIANTS as Tr, InitContextOptions as Tt, __ΩDocsInlineConfig as U, __ΩInferHookParameters as Un, STORAGE_PRESETS as Ur, __ΩEmitOptions as Ut, __ΩConfigEnv as V, __ΩHooksList as Vn, __ΩCommands as Vr, __ΩContext as Vt, __ΩEnvironmentConfig as W, __ΩInferHookReturnType as Wn, StorageAdapter as Wr, __ΩEnvironmentContext as Wt, __ΩLogLevel as X, __ΩUnpluginHookList as Xn, VirtualFileMetadata as Xr, __ΩPluginContext as Xt, __ΩLogFn as Y, __ΩUnpluginHookFunctions as Yn, VirtualFileExtension as Yr, __ΩParseOptions as Yt, __ΩNewInlineConfig as Z, __ΩUnpluginHookVariant as Zn, VirtualFileSystemInterface as Zr, __ΩResolver as Zt, NewInlineConfig as _, __ΩReflectionLevel as _n, __ΩPluginHookObject as _r, APIContext as _t, BuildInlineConfig as a, __ΩStoragePreset as ai, __ΩWithUnpluginBuildContext as an, PluginHook as ar, __ΩPluginConfigTuple as at, ParsedUserConfig as b, __ΩTSConfig as bn, __ΩTypesResult as br, EmitEntryOptions as bt, DeployInlineConfig as c, __ΩVirtualFileExtension as ci, ParsedTypeScriptConfig as cn, PluginHookObject as cr, __ΩPrepareInlineConfig as ct, EnvironmentResolvedConfig as d, __ΩWriteData as di, ReflectionMode as dn, TypesResult as dr, __ΩResolveResolvedConfig as dt, __VFS_PATCH__ as ei, __ΩSelectHooksOptions as en, KNOWN_PLUGIN_FIELDS as er, __ΩParsedUserConfig as et, InitialUserConfig as f, __ΩWriteOptions as fi, TSCompilerOptions as fn, __ΩPlugin as fr, __ΩResolvedAssetGlob as ft, LogLevel as g, __ΩRawReflectionMode as gn, __ΩPluginHookFunctions as gr, __ΩWorkspaceConfig as gt, LogFn as h, __ΩParsedTypeScriptConfig as hn, __ΩPluginHookFields as hr, __ΩUserConfig as ht, BaseConfig as i, __ΩStoragePort as ii, __ΩUnresolvedContext as in, PluginFields as ir, __ΩPluginConfigObject as it, ResolveResolvedConfig as j, PluginHooksList as jn, __ΩInferUnpluginOptions as jr, SelectHookResultItem as jt, ProjectType as k, InferHookThisType as kn, UnpluginUserConfig as kr, Resolver as kt, DocsInlineConfig as l, __ΩVirtualFileMetadata as li, RawReflectionMode as ln, PluginHooks as lr, __ΩProjectType as lt, LintInlineConfig as m, __ΩDeepkitOptions as mn, __ΩPluginHook as mr, __ΩResolvedEntryTypeDefinition as mt, __ΩAPI as n, __ΩResolveOptions as ni, __ΩTransformResult as nn, PLUGIN_NON_HOOK_FIELDS as nr, __ΩPartialPluginFactory as nt, CleanInlineConfig as o, __ΩVirtualFile as oi, __ΩWorkerProcess as on, PluginHookFields as or, __ΩPluginFactory as ot, InlineConfig as p, TSConfig as pn, __ΩPluginFields as pr, __ΩResolvedConfig as pt, __ΩInlineConfig as q, __ΩPluginHooksList as qn, VirtualFile as qr, __ΩInitContextOptions as qt, AnyUserConfig as r, __ΩStorageAdapter as ri, __ΩUnimportContext as rn, Plugin as rr, __ΩPluginConfig as rt, ConfigEnv as s, __ΩVirtualFileData as si, DeepkitOptions as sn, PluginHookFunctions as sr, __ΩPowerlinesCommand as st, API as t, __VFS_REVERT__ as ti, __ΩSourceFile as tn, PLUGIN_HOOKS_FIELDS as tr, __ΩPartialPlugin as tt, EnvironmentConfig as u, __ΩVirtualFileSystemInterface as ui, ReflectionLevel as un, PluginNonHookFields as ur, __ΩResolveConfig as ut, OutputConfig as v, __ΩReflectionMode as vn, __ΩPluginHooks as vr, BuildPluginContext as vt, PluginConfigObject as w, HookListOrders as wn, InferUnpluginVariant as wr, FetchOptions as wt, PartialPlugin as x, CallHookOptions as xn, BUILDER_VARIANTS as xr, EmitOptions as xt, OutputResolvedConfig as y, __ΩTSCompilerOptions as yn, __ΩPluginNonHookFields as yr, Context as yt, __ΩBuildInlineConfig as z, __ΩHookFields as zn, SUPPORTED_COMMANDS as zr, __ΩAPIContext as zt };
|
|
2194
|
+
//# sourceMappingURL=api-BuD5N0As.d.mts.map
|