@powerlines/plugin-vite 0.14.58 → 0.14.60

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.
Files changed (130) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +1 -0
  2. package/dist/helpers/index.cjs +1 -1
  3. package/dist/helpers/index.d.cts +1 -3
  4. package/dist/helpers/index.d.mts +1 -3
  5. package/dist/helpers/index.mjs +1 -1
  6. package/dist/helpers/unplugin.cjs +1 -1
  7. package/dist/helpers/unplugin.d.cts +6 -2
  8. package/dist/helpers/unplugin.d.mts +6 -2
  9. package/dist/helpers/unplugin.mjs +1 -1
  10. package/dist/index.cjs +1 -14
  11. package/dist/index.d.cts +3 -4
  12. package/dist/index.d.mts +5 -5
  13. package/dist/index.mjs +1 -14
  14. package/dist/powerlines/schemas/fs.cjs +1 -0
  15. package/dist/powerlines/schemas/fs.mjs +1 -0
  16. package/dist/powerlines/src/api.cjs +11 -0
  17. package/dist/powerlines/src/api.mjs +1 -0
  18. package/dist/powerlines/src/internal/babel/module-resolver-plugin.cjs +1 -0
  19. package/dist/powerlines/src/internal/babel/module-resolver-plugin.mjs +1 -0
  20. package/dist/powerlines/src/internal/helpers/environment.cjs +1 -0
  21. package/dist/powerlines/src/internal/helpers/environment.mjs +1 -0
  22. package/dist/powerlines/src/internal/helpers/generate-types.cjs +8 -0
  23. package/dist/powerlines/src/internal/helpers/generate-types.mjs +8 -0
  24. package/dist/powerlines/src/internal/helpers/hooks.cjs +1 -0
  25. package/dist/powerlines/src/internal/helpers/hooks.mjs +1 -0
  26. package/dist/powerlines/src/internal/helpers/install-dependencies.cjs +3 -0
  27. package/dist/powerlines/src/internal/helpers/install-dependencies.mjs +3 -0
  28. package/dist/powerlines/src/internal/helpers/install.cjs +1 -0
  29. package/dist/powerlines/src/internal/helpers/install.mjs +1 -0
  30. package/dist/powerlines/src/internal/helpers/resolve-tsconfig.cjs +8 -0
  31. package/dist/powerlines/src/internal/helpers/resolve-tsconfig.mjs +8 -0
  32. package/dist/powerlines/src/internal/helpers/resolver.cjs +1 -0
  33. package/dist/powerlines/src/internal/helpers/resolver.mjs +1 -0
  34. package/dist/powerlines/src/lib/build/esbuild.cjs +14 -0
  35. package/dist/powerlines/src/lib/build/esbuild.mjs +14 -0
  36. package/dist/powerlines/src/lib/build/vite.cjs +1 -0
  37. package/dist/powerlines/src/lib/build/vite.mjs +1 -0
  38. package/dist/powerlines/src/lib/config-file.cjs +1 -0
  39. package/dist/powerlines/src/lib/config-file.mjs +1 -0
  40. package/dist/powerlines/src/lib/contexts/api-context.cjs +1 -0
  41. package/dist/powerlines/src/lib/contexts/api-context.mjs +1 -0
  42. package/dist/powerlines/src/lib/contexts/context.cjs +1 -0
  43. package/dist/powerlines/src/lib/contexts/context.mjs +1 -0
  44. package/dist/powerlines/src/lib/contexts/environment-context.cjs +1 -0
  45. package/dist/powerlines/src/lib/contexts/environment-context.mjs +1 -0
  46. package/dist/powerlines/src/lib/contexts/plugin-context.cjs +1 -0
  47. package/dist/powerlines/src/lib/contexts/plugin-context.mjs +1 -0
  48. package/dist/powerlines/src/lib/entry.cjs +1 -0
  49. package/dist/powerlines/src/lib/entry.mjs +1 -0
  50. package/dist/powerlines/src/lib/fs/helpers.cjs +1 -0
  51. package/dist/powerlines/src/lib/fs/helpers.mjs +1 -0
  52. package/dist/powerlines/src/lib/fs/storage/base.cjs +1 -0
  53. package/dist/powerlines/src/lib/fs/storage/base.mjs +1 -0
  54. package/dist/powerlines/src/lib/fs/storage/file-system.cjs +1 -0
  55. package/dist/powerlines/src/lib/fs/storage/file-system.mjs +1 -0
  56. package/dist/powerlines/src/lib/fs/storage/virtual.cjs +1 -0
  57. package/dist/powerlines/src/lib/fs/storage/virtual.mjs +1 -0
  58. package/dist/powerlines/src/lib/fs/vfs.cjs +1 -0
  59. package/dist/powerlines/src/lib/fs/vfs.mjs +1 -0
  60. package/dist/powerlines/src/lib/logger.cjs +1 -0
  61. package/dist/powerlines/src/lib/logger.mjs +1 -0
  62. package/dist/powerlines/src/lib/typescript/ts-morph.cjs +1 -0
  63. package/dist/powerlines/src/lib/typescript/ts-morph.mjs +1 -0
  64. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +4 -0
  65. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +4 -0
  66. package/dist/powerlines/src/lib/unplugin/factory.cjs +1 -0
  67. package/dist/powerlines/src/lib/unplugin/factory.mjs +1 -0
  68. package/dist/powerlines/src/lib/unplugin/helpers.cjs +1 -0
  69. package/dist/powerlines/src/lib/unplugin/helpers.mjs +1 -0
  70. package/dist/powerlines/src/lib/unplugin/index.cjs +1 -0
  71. package/dist/powerlines/src/lib/unplugin/index.mjs +1 -0
  72. package/dist/powerlines/src/lib/unplugin/plugin.cjs +6 -0
  73. package/dist/powerlines/src/lib/unplugin/plugin.mjs +6 -0
  74. package/dist/powerlines/src/lib/utilities/file-header.cjs +10 -0
  75. package/dist/powerlines/src/lib/utilities/file-header.mjs +10 -0
  76. package/dist/powerlines/src/lib/utilities/meta.cjs +1 -0
  77. package/dist/powerlines/src/lib/utilities/meta.mjs +1 -0
  78. package/dist/powerlines/src/lib/utilities/source-file.cjs +1 -0
  79. package/dist/powerlines/src/lib/utilities/source-file.mjs +1 -0
  80. package/dist/powerlines/src/plugin-utils/helpers.cjs +1 -0
  81. package/dist/powerlines/src/plugin-utils/helpers.mjs +1 -0
  82. package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
  83. package/dist/powerlines/src/plugin-utils/paths.mjs +1 -0
  84. package/dist/powerlines/src/types/babel.d.mts +4 -0
  85. package/dist/powerlines/src/types/build.d.cts +143 -0
  86. package/dist/powerlines/src/types/build.d.mts +143 -0
  87. package/dist/powerlines/src/types/commands.cjs +1 -0
  88. package/dist/powerlines/src/types/commands.d.cts +8 -0
  89. package/dist/powerlines/src/types/commands.d.mts +9 -0
  90. package/dist/powerlines/src/types/commands.mjs +1 -0
  91. package/dist/powerlines/src/types/config.d.cts +346 -0
  92. package/dist/powerlines/src/types/config.d.mts +348 -0
  93. package/dist/powerlines/src/types/context.d.cts +347 -0
  94. package/dist/powerlines/src/types/context.d.mts +349 -0
  95. package/dist/powerlines/src/types/fs.d.cts +458 -0
  96. package/dist/powerlines/src/types/fs.d.mts +458 -0
  97. package/dist/powerlines/src/types/hooks.d.mts +2 -0
  98. package/dist/powerlines/src/types/plugin.cjs +1 -0
  99. package/dist/powerlines/src/types/plugin.d.cts +232 -0
  100. package/dist/powerlines/src/types/plugin.d.mts +232 -0
  101. package/dist/powerlines/src/types/plugin.mjs +1 -0
  102. package/dist/powerlines/src/types/resolved.d.cts +82 -0
  103. package/dist/powerlines/src/types/resolved.d.mts +82 -0
  104. package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
  105. package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
  106. package/dist/types/index.cjs +0 -1
  107. package/dist/types/index.d.cts +1 -2
  108. package/dist/types/index.d.mts +1 -2
  109. package/dist/types/index.mjs +1 -1
  110. package/dist/types/plugin.cjs +0 -1
  111. package/dist/types/plugin.d.cts +19 -1
  112. package/dist/types/plugin.d.mts +19 -1
  113. package/dist/types/plugin.mjs +1 -1
  114. package/package.json +10 -10
  115. package/dist/helpers-CRPRhztf.mjs +0 -1
  116. package/dist/helpers-LF26RHol.cjs +0 -0
  117. package/dist/index-9iG2qHLe.d.mts +0 -1
  118. package/dist/index-D4ELpJXS.d.cts +0 -1
  119. package/dist/index-D6CnpA_r.d.cts +0 -1
  120. package/dist/index-DL0uimUT.d.mts +0 -1
  121. package/dist/plugin-BjiGfRHE.mjs +0 -1
  122. package/dist/plugin-Bu9f0Vo1.d.mts +0 -1658
  123. package/dist/plugin-CeaU7BaT.d.cts +0 -1655
  124. package/dist/plugin-pBKbb5K9.cjs +0 -0
  125. package/dist/types-n6NgD0QK.mjs +0 -1
  126. package/dist/types-o3zWarRp.cjs +0 -0
  127. package/dist/unplugin-CQUvJGvc.d.mts +0 -7
  128. package/dist/unplugin-DD1hF9r3.mjs +0 -6
  129. package/dist/unplugin-DVT_2a_R.cjs +0 -44
  130. package/dist/unplugin-DtFSdCAn.d.cts +0 -7
@@ -1,1655 +0,0 @@
1
- import { PreviewOptions, ResolvedPreviewOptions, UserConfig } from "vite";
2
- import { EnvPaths } from "@stryke/env/get-env-paths";
3
- import { FetchRequestOptions } from "@stryke/http/fetch";
4
- import { FunctionLike, MaybePromise, NonUndefined } from "@stryke/types/base";
5
- import { PackageJson } from "@stryke/types/package-json";
6
- import { Jiti } from "jiti";
7
- import { SourceMap } from "magic-string";
8
- import { ParseResult, ParserOptions } from "oxc-parser";
9
- import { Range } from "semver";
10
- import { Project } from "ts-morph";
11
- import { RequestInfo, Response } from "undici";
12
- import { ExternalIdResult, HookFilter, TransformResult, UnpluginBuildContext, UnpluginContext, UnpluginMessage, UnpluginOptions } from "unplugin";
13
- import { Format } from "@storm-software/build-tools/types";
14
- import { LogLevelLabel } from "@storm-software/config-tools/types";
15
- import { StormWorkspaceConfig } from "@storm-software/config/types";
16
- import { TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
17
- import { AssetGlob } from "@stryke/types/file";
18
- import { ResolveOptions } from "@stryke/fs/resolve";
19
- import { ArrayValues } from "@stryke/types/array";
20
- import { CompilerOptions, TsConfigJson } from "@stryke/types/tsconfig";
21
- import ts from "typescript";
22
-
23
- //#region ../powerlines/src/types/build.d.ts
24
- type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
25
- interface BuildConfig {
26
- /**
27
- * The platform to build the project for
28
- *
29
- * @defaultValue "neutral"
30
- */
31
- platform?: "node" | "browser" | "neutral";
32
- /**
33
- * Array of strings indicating the polyfills to include for the build.
34
- *
35
- * @remarks
36
- * This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
37
- *
38
- * @example
39
- * ```ts
40
- * {
41
- * polyfill: ['{projectRoot}/custom-polyfill.ts']
42
- * }
43
- * ```
44
- */
45
- polyfill?: string[];
46
- /**
47
- * Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
48
- *
49
- * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
50
- */
51
- mainFields?: string[];
52
- /**
53
- * Array of strings indicating what conditions should be used for module resolution.
54
- */
55
- conditions?: string[];
56
- /**
57
- * Array of strings indicating what file extensions should be used for module resolution.
58
- *
59
- * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
60
- */
61
- extensions?: string[];
62
- /**
63
- * Array of strings indicating what modules should be deduplicated to a single version in the build.
64
- *
65
- * @remarks
66
- * 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.
67
- */
68
- dedupe?: string[];
69
- /**
70
- * Array of strings or regular expressions that indicate what modules are builtin for the environment.
71
- */
72
- builtins?: (string | RegExp)[];
73
- /**
74
- * Define global variable replacements.
75
- *
76
- * @remarks
77
- * 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.
78
- *
79
- * @example
80
- * ```ts
81
- * {
82
- * define: {
83
- * __VERSION__: '"1.0.0"',
84
- * __DEV__: 'process.env.NODE_ENV !== "production"'
85
- * }
86
- * }
87
- * ```
88
- *
89
- * @see https://esbuild.github.io/api/#define
90
- * @see https://vitejs.dev/config/build-options.html#define
91
- * @see https://github.com/rollup/plugins/tree/master/packages/replace
92
- */
93
- define?: Record<string, any>;
94
- /**
95
- * Global variables that will have import statements injected where necessary
96
- *
97
- * @remarks
98
- * 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.
99
- *
100
- * @example
101
- * ```ts
102
- * {
103
- * inject: {
104
- * process: 'process/browser',
105
- * Buffer: ['buffer', 'Buffer'],
106
- * }
107
- * }
108
- * ```
109
- *
110
- * @see https://github.com/rollup/plugins/tree/master/packages/inject
111
- */
112
- inject?: Record<string, string | string[]>;
113
- /**
114
- * The alias mappings to use for module resolution during the build process.
115
- *
116
- * @remarks
117
- * This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
118
- *
119
- * @example
120
- * ```ts
121
- * {
122
- * alias: {
123
- * "@utils": "./src/utils",
124
- * "@components": "./src/components"
125
- * }
126
- * }
127
- * ```
128
- *
129
- * @see https://github.com/rollup/plugins/tree/master/packages/alias
130
- */
131
- alias?: Record<string, string> | Array<{
132
- find: string | RegExp;
133
- replacement: string;
134
- }>;
135
- /**
136
- * A list of modules that should not be bundled, even if they are external dependencies.
137
- *
138
- * @remarks
139
- * 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.
140
- */
141
- external?: (string | RegExp)[];
142
- /**
143
- * A list of modules that should always be bundled, even if they are external dependencies.
144
- */
145
- noExternal?: (string | RegExp)[];
146
- /**
147
- * Should the Powerlines CLI processes skip bundling the `node_modules` directory?
148
- */
149
- skipNodeModulesBundle?: boolean;
150
- /**
151
- * An optional set of override options to apply to the selected build variant.
152
- *
153
- * @remarks
154
- * This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
155
- */
156
- override?: Record<string, any>;
157
- }
158
- type BuildResolvedConfig = Omit<BuildConfig, "override">;
159
- type ViteBuildConfig = Omit<UserConfig, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig;
160
- type ViteResolvedBuildConfig = UserConfig & BuildResolvedConfig;
161
- //#endregion
162
- //#region ../powerlines/src/types/fs.d.ts
163
- type StoragePreset = "fs" | "virtual";
164
- /**
165
- * Interface defining the methods and properties for a storage adapter.
166
- */
167
- interface StorageAdapter {
168
- /**
169
- * A name identifying the storage adapter type.
170
- */
171
- name: string;
172
- /**
173
- * Checks if a key exists in the storage.
174
- *
175
- * @param key - The key to check for existence.
176
- * @returns A promise that resolves to `true` if the key exists, otherwise `false`.
177
- */
178
- exists: (key: string) => Promise<boolean>;
179
- /**
180
- * Synchronously checks if a key exists in the storage.
181
- *
182
- * @param key - The key to check for existence.
183
- * @returns Returns `true` if the key exists, otherwise `false`.
184
- */
185
- existsSync: (key: string) => boolean;
186
- /**
187
- * Read a value associated with a key from the storage.
188
- *
189
- * @param key - The key to read the value for.
190
- * @returns A promise that resolves to the value if found, otherwise `null`.
191
- */
192
- get: (key: string) => Promise<string | null>;
193
- /**
194
- * Synchronously reads the value associated with a key from the storage.
195
- *
196
- * @param key - The key to read the value for.
197
- * @returns The value if found, otherwise `null`.
198
- */
199
- getSync: (key: string) => string | null;
200
- /**
201
- * Writes a value to the storage for the given key.
202
- *
203
- * @param key - The key to associate the value with.
204
- * @param value - The value to store.
205
- */
206
- set: (key: string, value: string) => Promise<void>;
207
- /**
208
- * Synchronously writes a value to the storage for the given key.
209
- *
210
- * @param key - The key to associate the value with.
211
- * @param value - The value to store.
212
- */
213
- setSync: (key: string, value: string) => void;
214
- /**
215
- * Removes a value from the storage.
216
- *
217
- * @param key - The key whose value should be removed.
218
- */
219
- remove: (key: string) => Promise<void>;
220
- /**
221
- * Synchronously removes a value from the storage.
222
- *
223
- * @param key - The key whose value should be removed.
224
- */
225
- removeSync: (key: string) => void;
226
- /**
227
- * Creates a directory at the specified path.
228
- *
229
- * @param dirPath - The path of the directory to create.
230
- */
231
- mkdir: (dirPath: string) => Promise<void>;
232
- /**
233
- * Synchronously creates a directory at the specified path.
234
- *
235
- * @param dirPath - The path of the directory to create.
236
- */
237
- mkdirSync: (dirPath: string) => void;
238
- /**
239
- * Remove all entries from the storage that match the provided base path.
240
- *
241
- * @param base - The base path or prefix to clear entries from.
242
- */
243
- clear: (base?: string) => Promise<void>;
244
- /**
245
- * Synchronously remove all entries from the storage that match the provided base path.
246
- *
247
- * @param base - The base path or prefix to clear entries from.
248
- */
249
- clearSync: (base?: string) => void;
250
- /**
251
- * Lists all keys under the provided base path.
252
- *
253
- * @param base - The base path or prefix to list keys from.
254
- * @returns A promise resolving to the list of keys.
255
- */
256
- list: (base?: string) => Promise<string[]>;
257
- /**
258
- * Synchronously lists all keys under the provided base path.
259
- *
260
- * @param base - The base path or prefix to list keys from.
261
- * @returns The list of keys.
262
- */
263
- listSync: (base?: string) => string[];
264
- /**
265
- * Checks if the given key is a directory.
266
- *
267
- * @param key - The key to check.
268
- * @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.
269
- */
270
- isDirectory: (key: string) => Promise<boolean>;
271
- /**
272
- * Synchronously checks if the given key is a directory.
273
- *
274
- * @param key - The key to check.
275
- * @returns `true` if the key is a directory, otherwise `false`.
276
- */
277
- isDirectorySync: (key: string) => boolean;
278
- /**
279
- * Checks if the given key is a file.
280
- *
281
- * @param key - The key to check.
282
- * @returns A promise that resolves to `true` if the key is a file, otherwise `false`.
283
- */
284
- isFile: (key: string) => Promise<boolean>;
285
- /**
286
- * Synchronously checks if the given key is a file.
287
- *
288
- * @param key - The key to check.
289
- * @returns `true` if the key is a file, otherwise `false`.
290
- */
291
- isFileSync: (key: string) => boolean;
292
- /**
293
- * Releases any resources held by the storage adapter.
294
- */
295
- dispose: () => MaybePromise<void>;
296
- }
297
- /**
298
- * A mapping of file paths to storage adapter names and their corresponding {@link StorageAdapter} instances.
299
- */
300
- type StoragePort = Record<string, StorageAdapter>;
301
- interface VirtualFileMetadata {
302
- /**
303
- * The identifier for the file data.
304
- */
305
- id: string;
306
- /**
307
- * The timestamp of the virtual file.
308
- */
309
- timestamp: number;
310
- /**
311
- * The type of the file.
312
- *
313
- * @remarks
314
- * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
315
- * - `builtin`: Indicates that the file is a built-in module provided by the system.
316
- * - `entry`: Indicates that the file is an entry point for execution.
317
- * - `normal`: Indicates that the file is a standard file without any special role.
318
- */
319
- type: string;
320
- /**
321
- * Additional metadata associated with the file.
322
- */
323
- properties: Record<string, string>;
324
- }
325
- interface VirtualFileData {
326
- /**
327
- * The identifier for the file data.
328
- */
329
- id?: string;
330
- /**
331
- * The contents of the virtual file.
332
- */
333
- code: string;
334
- /**
335
- * The type of the file.
336
- *
337
- * @remarks
338
- * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
339
- * - `builtin`: Indicates that the file is a built-in module provided by the system.
340
- * - `entry`: Indicates that the file is an entry point for execution.
341
- * - `normal`: Indicates that the file is a standard file without any special role.
342
- */
343
- type?: string;
344
- /**
345
- * Additional metadata associated with the file.
346
- */
347
- properties?: Record<string, string>;
348
- }
349
- interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
350
- /**
351
- * An additional name for the file.
352
- */
353
- path: string;
354
- /**
355
- * The timestamp of the virtual file.
356
- */
357
- timestamp: number;
358
- }
359
- interface WriteOptions {
360
- /**
361
- * Should the file skip formatting before being written?
362
- *
363
- * @defaultValue false
364
- */
365
- skipFormat?: boolean;
366
- /**
367
- * Additional metadata for the file.
368
- */
369
- meta?: VirtualFileMetadata;
370
- }
371
- interface ResolveOptions$1 extends ResolveOptions {
372
- /**
373
- * If true, the module is being resolved as an entry point.
374
- */
375
- isEntry?: boolean;
376
- /**
377
- * If true, the resolver will skip using the cache when resolving modules.
378
- */
379
- skipCache?: boolean;
380
- /**
381
- * An array of external modules or patterns to exclude from resolution.
382
- */
383
- external?: (string | RegExp)[];
384
- /**
385
- * An array of modules or patterns to include in the resolution, even if they are marked as external.
386
- */
387
- noExternal?: (string | RegExp)[];
388
- /**
389
- * An array of patterns to match when resolving modules.
390
- */
391
- skipNodeModulesBundle?: boolean;
392
- }
393
- interface VirtualFileSystemInterface {
394
- /**
395
- * The underlying file metadata.
396
- */
397
- metadata: Readonly<Record<string, VirtualFileMetadata>>;
398
- /**
399
- * A map of file paths to their module ids.
400
- */
401
- ids: Readonly<Record<string, string>>;
402
- /**
403
- * A map of module ids to their file paths.
404
- */
405
- paths: Readonly<Record<string, string>>;
406
- /**
407
- * Checks if a file exists in the virtual file system (VFS).
408
- *
409
- * @param path - The path or id of the file.
410
- * @returns `true` if the file exists, otherwise `false`.
411
- */
412
- exists: (path: string) => Promise<boolean>;
413
- /**
414
- * Synchronously Checks if a file exists in the virtual file system (VFS).
415
- *
416
- * @param path - The path or id of the file.
417
- * @returns `true` if the file exists, otherwise `false`.
418
- */
419
- existsSync: (path: string) => boolean;
420
- /**
421
- * Checks if a file is virtual in the virtual file system (VFS).
422
- *
423
- * @param path - The path or id of the file.
424
- * @returns `true` if the file is virtual, otherwise `false`.
425
- */
426
- isVirtual: (path: string) => boolean;
427
- /**
428
- * Checks if the given key is a directory.
429
- *
430
- * @param key - The key to check.
431
- * @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.
432
- */
433
- isDirectory: (key: string) => Promise<boolean>;
434
- /**
435
- * Synchronously checks if the given key is a directory.
436
- *
437
- * @param key - The key to check.
438
- * @returns `true` if the key is a directory, otherwise `false`.
439
- */
440
- isDirectorySync: (key: string) => boolean;
441
- /**
442
- * Checks if the given key is a file.
443
- *
444
- * @param key - The key to check.
445
- * @returns A promise that resolves to `true` if the key is a file, otherwise `false`.
446
- */
447
- isFile: (key: string) => Promise<boolean>;
448
- /**
449
- * Synchronously checks if the given key is a file.
450
- *
451
- * @param key - The key to check.
452
- * @returns `true` if the key is a file, otherwise `false`.
453
- */
454
- isFileSync: (key: string) => boolean;
455
- /**
456
- * Gets the metadata of a file in the virtual file system (VFS).
457
- *
458
- * @param path - The path or id of the file.
459
- * @returns The metadata of the file if it exists, otherwise undefined.
460
- */
461
- getMetadata: (path: string) => VirtualFileMetadata | undefined;
462
- /**
463
- * Lists files in a given path.
464
- *
465
- * @param path - The path to list files from.
466
- * @returns An array of file names in the specified path.
467
- */
468
- listSync: (path: string) => string[];
469
- /**
470
- * Lists files in a given path.
471
- *
472
- * @param path - The path to list files from.
473
- * @returns An array of file names in the specified path.
474
- */
475
- list: (path: string) => Promise<string[]>;
476
- /**
477
- * Removes a file or symbolic link in the virtual file system (VFS).
478
- *
479
- * @param path - The path to the file to remove.
480
- * @returns A promise that resolves when the file is removed.
481
- */
482
- removeSync: (path: string) => void;
483
- /**
484
- * Asynchronously removes a file or symbolic link in the virtual file system (VFS).
485
- *
486
- * @param path - The path to the file to remove.
487
- * @returns A promise that resolves when the file is removed.
488
- */
489
- remove: (path: string) => Promise<void>;
490
- /**
491
- * Reads a file from the virtual file system (VFS).
492
- *
493
- * @param path - The path or id of the file.
494
- * @returns The contents of the file if it exists, otherwise undefined.
495
- */
496
- read: (path: string) => Promise<string | undefined>;
497
- /**
498
- * Reads a file from the virtual file system (VFS).
499
- *
500
- * @param path - The path or id of the file.
501
- */
502
- readSync: (path: string) => string | undefined;
503
- /**
504
- * Writes a file to the virtual file system (VFS).
505
- *
506
- * @param path - The path to the file.
507
- * @param data - The contents of the file.
508
- * @param options - Options for writing the file.
509
- * @returns A promise that resolves when the file is written.
510
- */
511
- write: (path: string, data: string, options?: WriteOptions) => Promise<void>;
512
- /**
513
- * Writes a file to the virtual file system (VFS).
514
- *
515
- * @param path - The path to the file.
516
- * @param data - The contents of the file.
517
- * @param options - Options for writing the file.
518
- */
519
- writeSync: (path: string, data: string, options?: WriteOptions) => void;
520
- /**
521
- * Creates a directory at the specified path.
522
- *
523
- * @param dirPath - The path of the directory to create.
524
- */
525
- mkdir: (dirPath: string) => Promise<void>;
526
- /**
527
- * Synchronously creates a directory at the specified path.
528
- *
529
- * @param dirPath - The path of the directory to create.
530
- */
531
- mkdirSync: (dirPath: string) => void;
532
- /**
533
- * Moves a file from one path to another in the virtual file system (VFS).
534
- *
535
- * @param srcPath - The source path to move
536
- * @param destPath - The destination path to move to
537
- */
538
- move: (srcPath: string, destPath: string) => Promise<void>;
539
- /**
540
- * Synchronously moves a file from one path to another in the virtual file system (VFS).
541
- *
542
- * @param srcPath - The source path to move
543
- * @param destPath - The destination path to move to
544
- */
545
- moveSync: (srcPath: string, destPath: string) => void;
546
- /**
547
- * Copies a file from one path to another in the virtual file system (VFS).
548
- *
549
- * @param srcPath - The source path to copy
550
- * @param destPath - The destination path to copy to
551
- */
552
- copy: (srcPath: string | URL | Omit<AssetGlob, "output">, destPath: string | URL) => Promise<void>;
553
- /**
554
- * Synchronously copies a file from one path to another in the virtual file system (VFS).
555
- *
556
- * @param srcPath - The source path to copy
557
- * @param destPath - The destination path to copy to
558
- */
559
- copySync: (srcPath: string | URL | Omit<AssetGlob, "output">, destPath: string | URL) => void;
560
- /**
561
- * Glob files in the virtual file system (VFS) based on the provided pattern(s).
562
- *
563
- * @param pattern - A pattern (or multiple patterns) to use to determine the file paths to return
564
- * @returns An array of file paths matching the provided pattern(s)
565
- */
566
- glob: (patterns: string | Omit<AssetGlob, "output"> | (string | Omit<AssetGlob, "output">)[]) => Promise<string[]>;
567
- /**
568
- * Synchronously glob files in the virtual file system (VFS) based on the provided pattern(s).
569
- *
570
- * @param pattern - A pattern (or multiple patterns) to use to determine the file paths to return
571
- * @returns An array of file paths matching the provided pattern(s)
572
- */
573
- globSync: (patterns: string | Omit<AssetGlob, "output"> | (string | Omit<AssetGlob, "output">)[]) => string[];
574
- /**
575
- * A helper function to resolve modules using the Jiti resolver
576
- *
577
- * @remarks
578
- * This function can be used to resolve modules relative to the project root directory.
579
- *
580
- * @example
581
- * ```ts
582
- * const resolvedPath = await context.resolve("some-module", "/path/to/importer");
583
- * ```
584
- *
585
- * @param id - The module to resolve.
586
- * @param importer - An optional path to the importer module.
587
- * @param options - Additional resolution options.
588
- * @returns A promise that resolves to the resolved module path.
589
- */
590
- resolve: (id: string, importer?: string, options?: ResolveOptions$1) => Promise<string | undefined>;
591
- /**
592
- * A synchronous helper function to resolve modules using the Jiti resolver
593
- *
594
- * @remarks
595
- * This function can be used to resolve modules relative to the project root directory.
596
- *
597
- * @example
598
- * ```ts
599
- * const resolvedPath = context.resolveSync("some-module", "/path/to/importer");
600
- * ```
601
- *
602
- * @param id - The module to resolve.
603
- * @param importer - An optional path to the importer module.
604
- * @param options - Additional resolution options.
605
- * @returns The resolved module path.
606
- */
607
- resolveSync: (id: string, importer?: string, options?: ResolveOptions$1) => string | undefined;
608
- /**
609
- * Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
610
- */
611
- dispose: () => Promise<void>;
612
- }
613
- //#endregion
614
- //#region ../powerlines/src/types/commands.d.ts
615
- declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
616
- type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
617
- //#endregion
618
- //#region ../powerlines/src/types/resolved.d.ts
619
- interface ResolvedEntryTypeDefinition extends TypeDefinition {
620
- /**
621
- * The user provided entry point in the source code
622
- */
623
- input: TypeDefinition;
624
- /**
625
- * An optional name to use in the package export during the build process
626
- */
627
- output?: string;
628
- }
629
- type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "ssr">> & {
630
- /**
631
- * The name of the environment
632
- */
633
- name: string;
634
- /**
635
- * Configuration options for the preview server
636
- */
637
- preview?: ResolvedPreviewOptions;
638
- };
639
- type ResolvedAssetGlob = AssetGlob & Required<Pick<AssetGlob, "input">>;
640
- type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> & {
641
- assets: ResolvedAssetGlob[];
642
- }> & Pick<OutputConfig, "storage">;
643
- /**
644
- * The resolved options for the Powerlines project configuration.
645
- */
646
- type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
647
- /**
648
- * The configuration options that were provided inline to the Powerlines CLI.
649
- */
650
- inlineConfig: InlineConfig<TUserConfig>;
651
- /**
652
- * The original configuration options that were provided by the user to the Powerlines process.
653
- */
654
- userConfig: TUserConfig;
655
- /**
656
- * A string identifier for the Powerlines command being executed.
657
- */
658
- command: NonUndefined<InlineConfig<TUserConfig>["command"]>;
659
- /**
660
- * The root directory of the project's source code
661
- *
662
- * @defaultValue "\{projectRoot\}/src"
663
- */
664
- sourceRoot: NonUndefined<TUserConfig["sourceRoot"]>;
665
- /**
666
- * The root directory of the project.
667
- */
668
- projectRoot: NonUndefined<TUserConfig["root"]>;
669
- /**
670
- * The type of project being built.
671
- */
672
- projectType: NonUndefined<TUserConfig["type"]>;
673
- /**
674
- * The output configuration options to use for the build process
675
- */
676
- output: OutputResolvedConfig;
677
- /**
678
- * Configuration provided to build processes
679
- *
680
- * @remarks
681
- * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
682
- */
683
- build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
684
- /**
685
- * The log level to use for the Powerlines processes.
686
- *
687
- * @defaultValue "info"
688
- */
689
- logLevel: "error" | "warn" | "info" | "debug" | "trace" | null;
690
- };
691
- type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
692
- //#endregion
693
- //#region ../powerlines/src/types/plugin.d.ts
694
- interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
695
- /**
696
- * The order in which the plugin should be applied.
697
- */
698
- order?: "pre" | "post" | null | undefined;
699
- /**
700
- * A filter to determine when the hook should be called.
701
- */
702
- filter?: Pick<HookFilter, TFilter>;
703
- /**
704
- * The hook function to be called.
705
- */
706
- handler: THookFunction;
707
- }
708
- type PluginHook<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> = THookFunction | PluginHookObject<THookFunction, TFilter>;
709
- /**
710
- * A result returned by the plugin from the `types` hook that describes the declaration types output file.
711
- */
712
- interface TypesResult {
713
- directives?: string[];
714
- code: string;
715
- }
716
- type DeepPartial$1<T> = { [K in keyof T]?: DeepPartial$1<T[K]> };
717
- type ConfigResult<TContext extends PluginContext = PluginContext> = DeepPartial$1<TContext["config"]> & Record<string, any>;
718
- interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext> extends Record<CommandType, (this: TContext) => MaybePromise<void>> {
719
- /**
720
- * A function that returns configuration options to be merged with the build context's options.
721
- *
722
- * @remarks
723
- * 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.
724
- *
725
- * @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.
726
- *
727
- * @see https://vitejs.dev/guide/api-plugin#config
728
- *
729
- * @param this - The build context.
730
- * @param config - The partial configuration object to be modified.
731
- * @returns A promise that resolves to a partial configuration object.
732
- */
733
- config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>;
734
- /**
735
- * 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.
736
- *
737
- * @remarks
738
- * 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.
739
- *
740
- * @see https://vitejs.dev/guide/api-plugin#configenvironment
741
- *
742
- * @param this - The build context.
743
- * @param name - The name of the environment being configured.
744
- * @param environment - The Vite-like environment object containing information about the current build environment.
745
- * @returns A promise that resolves when the hook is complete.
746
- */
747
- configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>;
748
- /**
749
- * A hook that is called when the plugin is resolved.
750
- *
751
- * @see https://vitejs.dev/guide/api-plugin#configresolved
752
- *
753
- * @param this - The build context.
754
- * @returns A promise that resolves when the hook is complete.
755
- */
756
- configResolved: (this: TContext) => MaybePromise<void>;
757
- /**
758
- * 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.
759
- *
760
- * @param this - The build context.
761
- * @param code - The source code to generate types for.
762
- * @returns A promise that resolves when the hook is complete.
763
- */
764
- types: (this: TContext, code: string) => MaybePromise<TypesResult | string | undefined | null>;
765
- /**
766
- * A hook that is called at the start of the build process.
767
- *
768
- * @param this - The build context and unplugin build context.
769
- * @returns A promise that resolves when the hook is complete.
770
- */
771
- buildStart: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
772
- /**
773
- * A hook that is called at the end of the build process.
774
- *
775
- * @param this - The build context and unplugin build context.
776
- * @returns A promise that resolves when the hook is complete.
777
- */
778
- buildEnd: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
779
- /**
780
- * A hook that is called to transform the source code.
781
- *
782
- * @param this - The build context, unplugin build context, and unplugin context.
783
- * @param code - The source code to transform.
784
- * @param id - The identifier of the source code.
785
- * @returns A promise that resolves when the hook is complete.
786
- */
787
- transform: (this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult>;
788
- /**
789
- * A hook that is called to load the source code.
790
- *
791
- * @param this - The build context, unplugin build context, and unplugin context.
792
- * @param id - The identifier of the source code.
793
- * @returns A promise that resolves when the hook is complete.
794
- */
795
- load: (this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<TransformResult>;
796
- /**
797
- * A hook that is called to resolve the identifier of the source code.
798
- *
799
- * @param this - The build context, unplugin build context, and unplugin context.
800
- * @param id - The identifier of the source code.
801
- * @param importer - The importer of the source code.
802
- * @param options - The options for resolving the identifier.
803
- * @returns A promise that resolves when the hook is complete.
804
- */
805
- resolveId: (this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
806
- isEntry: boolean;
807
- }) => MaybePromise<string | ExternalIdResult | null | undefined>;
808
- /**
809
- * A hook that is called to write the bundle to disk.
810
- *
811
- * @param this - The build context.
812
- * @returns A promise that resolves when the hook is complete.
813
- */
814
- writeBundle: (this: TContext) => MaybePromise<void>;
815
- }
816
- type BuildPlugin<TContext extends PluginContext = PluginContext, TBuildVariant$1 extends UnpluginBuildVariant = UnpluginBuildVariant, TOptions extends Required<UnpluginOptions>[TBuildVariant$1] = Required<UnpluginOptions>[TBuildVariant$1]> = { [TKey in keyof TOptions]: TOptions[TKey] extends FunctionLike ? (this: ThisParameterType<TOptions[TKey]> & TContext, ...args: Parameters<TOptions[TKey]>) => ReturnType<TOptions[TKey]> | MaybePromise<ReturnType<TOptions[TKey]>> : TOptions[TKey] };
817
- type PluginHooks<TContext extends PluginContext = PluginContext> = { [TKey in keyof BasePluginHookFunctions<TContext>]: PluginHook<BasePluginHookFunctions<TContext>[TKey]> } & {
818
- /**
819
- * A function that returns configuration options to be merged with the build context's options.
820
- *
821
- * @remarks
822
- * 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.
823
- *
824
- * @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.
825
- *
826
- * @see https://vitejs.dev/guide/api-plugin#config
827
- *
828
- * @param this - The build context.
829
- * @param config - The partial configuration object to be modified.
830
- * @returns A promise that resolves to a partial configuration object.
831
- */
832
- config: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>> | ConfigResult<TContext>;
833
- /**
834
- * A hook that is called to transform the source code.
835
- *
836
- * @param this - The build context, unplugin build context, and unplugin context.
837
- * @param code - The source code to transform.
838
- * @param id - The identifier of the source code.
839
- * @returns A promise that resolves when the hook is complete.
840
- */
841
- transform: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult>, "code" | "id">;
842
- /**
843
- * A hook that is called to load the source code.
844
- *
845
- * @param this - The build context, unplugin build context, and unplugin context.
846
- * @param id - The identifier of the source code.
847
- * @returns A promise that resolves when the hook is complete.
848
- */
849
- load: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<TransformResult>, "id">;
850
- /**
851
- * A hook that is called to resolve the identifier of the source code.
852
- *
853
- * @param this - The build context, unplugin build context, and unplugin context.
854
- * @param id - The identifier of the source code.
855
- * @param importer - The importer of the source code.
856
- * @param options - The options for resolving the identifier.
857
- * @returns A promise that resolves when the hook is complete.
858
- */
859
- resolveId: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
860
- isEntry: boolean;
861
- }) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
862
- };
863
- type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = { [TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant> };
864
- interface Plugin<in out TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> extends Partial<PluginHooks<TContext>>, PluginBuildPlugins<TContext> {
865
- /**
866
- * The name of the plugin, for use in deduplication, error messages and logs.
867
- */
868
- name: string;
869
- /**
870
- * An API object that can be used for inter-plugin communication.
871
- *
872
- * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
873
- */
874
- api?: Record<string, any>;
875
- /**
876
- * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.
877
- *
878
- * @remarks
879
- * The Plugin invocation order is as follows:
880
- * - `enforce: 'pre'` plugins
881
- * - `order: 'pre'` plugin hooks
882
- * - any other plugins (normal)
883
- * - `order: 'post'` plugin hooks
884
- * - `enforce: 'post'` plugins
885
- *
886
- * @see https://vitejs.dev/guide/api-plugin.html#plugin-ordering
887
- * @see https://rollupjs.org/plugin-development/#build-hooks
888
- * @see https://webpack.js.org/concepts/loaders/#enforce---pre-and-post
889
- * @see https://esbuild.github.io/plugins/#concepts
890
- */
891
- enforce?: "pre" | "post";
892
- /**
893
- * A function to determine if two plugins are the same and can be de-duplicated.
894
- *
895
- * @remarks
896
- * If this is not provided, plugins are de-duplicated by comparing their names.
897
- *
898
- * @param other - The other plugin to compare against.
899
- * @returns `true` if the two plugins are the same, `false` otherwise.
900
- */
901
- dedupe?: false | ((other: Plugin<any>) => boolean);
902
- /**
903
- * A list of pre-requisite plugins that must be loaded before this plugin can be used.
904
- */
905
- dependsOn?: PluginConfig<any>[];
906
- /**
907
- * Define environments where this plugin should be active. By default, the plugin is active in all environments.
908
- *
909
- * @param environment - The environment to check.
910
- * @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
911
- */
912
- applyToEnvironment?: (environment: EnvironmentResolvedConfig) => boolean | PluginConfig<any>;
913
- }
914
- //#endregion
915
- //#region ../powerlines/src/types/tsconfig.d.ts
916
- type ReflectionMode = "default" | "explicit" | "never";
917
- type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
918
- /**
919
- * Defines the level of reflection to be used during the transpilation process.
920
- *
921
- * @remarks
922
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
923
- * - `minimal` - Only the essential type information is captured.
924
- * - `normal` - Additional type information is captured, including some contextual data.
925
- * - `verbose` - All available type information is captured, including detailed contextual data.
926
- */
927
- type ReflectionLevel = "minimal" | "normal" | "verbose";
928
- interface DeepkitOptions {
929
- /**
930
- * Either true to activate reflection for all files compiled using this tsconfig,
931
- * or a list of globs/file paths relative to this tsconfig.json.
932
- * Globs/file paths can be prefixed with a ! to exclude them.
933
- */
934
- reflection?: RawReflectionMode;
935
- /**
936
- * Defines the level of reflection to be used during the transpilation process.
937
- *
938
- * @remarks
939
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
940
- * - `minimal` - Only the essential type information is captured.
941
- * - `normal` - Additional type information is captured, including some contextual data.
942
- * - `verbose` - All available type information is captured, including detailed contextual data.
943
- */
944
- reflectionLevel?: ReflectionLevel;
945
- }
946
- type TSCompilerOptions = CompilerOptions & DeepkitOptions;
947
- /**
948
- * The TypeScript compiler configuration.
949
- *
950
- * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
951
- */
952
- interface TSConfig extends Omit<TsConfigJson, "reflection"> {
953
- /**
954
- * Either true to activate reflection for all files compiled using this tsconfig,
955
- * or a list of globs/file paths relative to this tsconfig.json.
956
- * Globs/file paths can be prefixed with a ! to exclude them.
957
- */
958
- reflection?: RawReflectionMode;
959
- /**
960
- * Defines the level of reflection to be used during the transpilation process.
961
- *
962
- * @remarks
963
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
964
- * - `minimal` - Only the essential type information is captured.
965
- * - `normal` - Additional type information is captured, including some contextual data.
966
- * - `verbose` - All available type information is captured, including detailed contextual data.
967
- */
968
- reflectionLevel?: ReflectionLevel;
969
- /**
970
- * Instructs the TypeScript compiler how to compile `.ts` files.
971
- */
972
- compilerOptions?: TSCompilerOptions;
973
- }
974
- type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
975
- originalTsconfigJson: TsConfigJson;
976
- tsconfigJson: TSConfig;
977
- tsconfigFilePath: string;
978
- };
979
- //#endregion
980
- //#region ../powerlines/src/types/config.d.ts
981
- type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
982
- /**
983
- * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
984
- */
985
- type WorkspaceConfig = Partial<StormWorkspaceConfig> & Required<Pick<StormWorkspaceConfig, "workspaceRoot">>;
986
- type PluginFactory<in out TContext extends PluginContext = PluginContext, TOptions = any> = (options: TOptions) => MaybePromise<Plugin<TContext>>;
987
- /**
988
- * A configuration tuple for a Powerlines plugin.
989
- */
990
- type PluginConfigTuple<TContext extends PluginContext = PluginContext, TOptions = any> = [string | PluginFactory<TContext, TOptions>, TOptions] | [Plugin<TContext>];
991
- /**
992
- * A configuration object for a Powerlines plugin.
993
- */
994
- type PluginConfigObject<TContext extends PluginContext = PluginContext, TOptions = any> = {
995
- plugin: string | PluginFactory<TContext, TOptions>;
996
- options: TOptions;
997
- } | {
998
- plugin: Plugin<TContext>;
999
- options?: never;
1000
- };
1001
- /**
1002
- * A configuration tuple for a Powerlines plugin.
1003
- */
1004
- type PluginConfig<TContext extends PluginContext = PluginContext> = string | PluginFactory<TContext, void> | Plugin<TContext> | Promise<Plugin<TContext>> | PluginConfigTuple<TContext> | PluginConfigObject<TContext>;
1005
- type ProjectType = "application" | "library";
1006
- interface DeployConfig {
1007
- /**
1008
- * The deployment variant being used by the Powerlines engine.
1009
- *
1010
- * @example
1011
- * ```ts
1012
- * export default defineConfig({
1013
- * deploy: {
1014
- * variant: "cloudflare"
1015
- * }
1016
- * });
1017
- *
1018
- * ```
1019
- */
1020
- variant?: string;
1021
- }
1022
- interface OutputConfig {
1023
- /**
1024
- * The path to output the final compiled files to
1025
- *
1026
- * @remarks
1027
- * If a value is not provided, Powerlines will attempt to:
1028
- * 1. Use the `outDir` value in the `tsconfig.json` file.
1029
- * 2. Use the `dist` directory in the project root directory.
1030
- *
1031
- * @defaultValue "dist/\{projectRoot\}"
1032
- */
1033
- outputPath?: string;
1034
- /**
1035
- * The output directory path for the project build.
1036
- *
1037
- * @remarks
1038
- * 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.
1039
- *
1040
- * @defaultValue "\{projectRoot\}/dist"
1041
- */
1042
- buildPath?: string;
1043
- /**
1044
- * The folder where the generated runtime artifacts will be located
1045
- *
1046
- * @remarks
1047
- * This folder will contain all runtime artifacts and builtins generated during the "prepare" phase.
1048
- *
1049
- * @defaultValue "\{projectRoot\}/.powerlines"
1050
- */
1051
- artifactsPath?: string;
1052
- /**
1053
- * The path of the generated runtime declaration file relative to the workspace root.
1054
- *
1055
- * @defaultValue "\{projectRoot\}/powerlines.d.ts"
1056
- */
1057
- dts?: string | false;
1058
- /**
1059
- * A prefix to use for identifying builtin modules
1060
- *
1061
- * @remarks
1062
- * This prefix will be used to identify all builtin modules generated during the "prepare" phase. An example builtin ID for a module called `"utils"` would be `"{builtinPrefix}:utils"`.
1063
- *
1064
- * @defaultValue "powerlines"
1065
- */
1066
- builtinPrefix?: string;
1067
- /**
1068
- * The module format of the output files
1069
- *
1070
- * @remarks
1071
- * 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.
1072
- *
1073
- * @defaultValue "esm"
1074
- */
1075
- format?: Format | Format[];
1076
- /**
1077
- * A list of assets to copy to the output directory
1078
- *
1079
- * @remarks
1080
- * 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.
1081
- */
1082
- assets?: Array<string | AssetGlob>;
1083
- /**
1084
- * A string preset or a custom {@link StoragePort} to provide fine-grained control over generated/output file storage.
1085
- *
1086
- * @remarks
1087
- * If a string preset is provided, it must be one of the following values:
1088
- * - `"virtual"`: Uses the local file system for storage.
1089
- * - `"fs"`: Uses an in-memory virtual file system for storage.
1090
- *
1091
- * If a custom {@link StoragePort} is provided, it will be used for all file storage operations during the build process.
1092
- *
1093
- * @defaultValue "virtual"
1094
- */
1095
- storage?: StoragePort | StoragePreset;
1096
- }
1097
- interface BaseConfig {
1098
- /**
1099
- * The entry point(s) for the application
1100
- */
1101
- entry?: TypeDefinitionParameter | TypeDefinitionParameter[];
1102
- /**
1103
- * Configuration for the output of the build process
1104
- */
1105
- output?: OutputConfig;
1106
- /**
1107
- * Configuration for cleaning the build artifacts
1108
- *
1109
- * @remarks
1110
- * If set to `false`, the cleaning process will be disabled.
1111
- */
1112
- clean?: Record<string, any> | false;
1113
- /**
1114
- * Configuration for linting the source code
1115
- *
1116
- * @remarks
1117
- * If set to `false`, linting will be disabled.
1118
- */
1119
- lint?: Record<string, any> | false;
1120
- /**
1121
- * Configuration for testing the source code
1122
- *
1123
- * @remarks
1124
- * If set to `false`, testing will be disabled.
1125
- */
1126
- test?: Record<string, any> | false;
1127
- /**
1128
- * Configuration for the transformation of the source code
1129
- */
1130
- transform?: Record<string, any>;
1131
- /**
1132
- * Configuration provided to build processes
1133
- *
1134
- * @remarks
1135
- * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
1136
- */
1137
- build?: BuildConfig;
1138
- /**
1139
- * Configuration for documentation generation
1140
- *
1141
- * @remarks
1142
- * This configuration will be used by the documentation generation plugins during the `docs` command.
1143
- */
1144
- docs?: Record<string, any>;
1145
- /**
1146
- * Configuration for deploying the source code
1147
- *
1148
- * @remarks
1149
- * If set to `false`, the deployment will be disabled.
1150
- */
1151
- deploy?: DeployConfig | false;
1152
- /**
1153
- * The path to the tsconfig file to be used by the compiler
1154
- *
1155
- * @remarks
1156
- * 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).
1157
- *
1158
- * @defaultValue "\{projectRoot\}/tsconfig.json"
1159
- */
1160
- tsconfig?: string;
1161
- /**
1162
- * The raw {@link TSConfig} object to be used by the compiler. This object will be merged with the `tsconfig.json` file.
1163
- *
1164
- * @see https://www.typescriptlang.org/tsconfig
1165
- *
1166
- * @remarks
1167
- * If populated, this option takes higher priority than `tsconfig`
1168
- */
1169
- tsconfigRaw?: TSConfig;
1170
- }
1171
- interface EnvironmentConfig extends BaseConfig {
1172
- /**
1173
- * Configuration options for the preview server
1174
- */
1175
- preview?: PreviewOptions;
1176
- /**
1177
- * A flag indicating whether the build is for a Server-Side Rendering environment.
1178
- */
1179
- ssr?: boolean;
1180
- /**
1181
- * Define if this environment is used for Server-Side Rendering
1182
- *
1183
- * @defaultValue "server" (if it isn't the client environment)
1184
- */
1185
- consumer?: "client" | "server";
1186
- }
1187
- interface CommonUserConfig extends BaseConfig {
1188
- /**
1189
- * The name of the project
1190
- */
1191
- name?: string;
1192
- /**
1193
- * The project display title
1194
- *
1195
- * @remarks
1196
- * This option is used in documentation generation and other places where a human-readable title is needed.
1197
- */
1198
- title?: string;
1199
- /**
1200
- * A description of the project
1201
- *
1202
- * @remarks
1203
- * If this option is not provided, the build process will try to use the \`description\` value from the `\package.json\` file.
1204
- */
1205
- description?: string;
1206
- /**
1207
- * The log level to use for the Powerlines processes.
1208
- *
1209
- * @defaultValue "info"
1210
- */
1211
- logLevel?: LogLevelLabel | null;
1212
- /**
1213
- * A custom logger function to use for logging messages
1214
- */
1215
- customLogger?: LogFn;
1216
- /**
1217
- * 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.
1218
- *
1219
- * @defaultValue "production"
1220
- */
1221
- mode?: "development" | "test" | "production";
1222
- /**
1223
- * The type of project being built
1224
- *
1225
- * @defaultValue "application"
1226
- */
1227
- type?: ProjectType;
1228
- /**
1229
- * The root directory of the project
1230
- */
1231
- root: string;
1232
- /**
1233
- * The root directory of the project's source code
1234
- *
1235
- * @defaultValue "\{root\}/src"
1236
- */
1237
- sourceRoot?: string;
1238
- /**
1239
- * A path to a custom configuration file to be used instead of the default `storm.json`, `powerlines.config.js`, or `powerlines.config.ts` files.
1240
- *
1241
- * @remarks
1242
- * This option is useful for running Powerlines commands with different configuration files, such as in CI/CD environments or when testing different configurations.
1243
- */
1244
- configFile?: string;
1245
- /**
1246
- * Should the Powerlines CLI processes skip installing missing packages?
1247
- *
1248
- * @remarks
1249
- * This option is useful for CI/CD environments where the installation of packages is handled by a different process.
1250
- *
1251
- * @defaultValue false
1252
- */
1253
- skipInstalls?: boolean;
1254
- /**
1255
- * Should the compiler processes skip any improvements that make use of cache?
1256
- *
1257
- * @defaultValue false
1258
- */
1259
- skipCache?: boolean;
1260
- /**
1261
- * A list of resolvable paths to plugins used during the build process
1262
- */
1263
- plugins?: PluginConfig<PluginContext<any>>[];
1264
- /**
1265
- * Environment-specific configurations
1266
- */
1267
- environments?: Record<string, EnvironmentConfig>;
1268
- /**
1269
- * A string identifier that allows a child framework or tool to identify itself when using Powerlines.
1270
- *
1271
- * @remarks
1272
- * If no values are provided for {@link OutputConfig.dts | output.dts}, {@link OutputConfig.builtinPrefix | output.builtinPrefix}, or {@link OutputConfig.artifactsPath | output.artifactsFolder}, this value will be used as the default.
1273
- *
1274
- * @defaultValue "powerlines"
1275
- */
1276
- framework?: string;
1277
- }
1278
- interface UserConfig$1<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant$1 extends string = any> extends Omit<CommonUserConfig, "build"> {
1279
- /**
1280
- * Configuration provided to build processes
1281
- *
1282
- * @remarks
1283
- * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
1284
- */
1285
- build: Omit<TBuildConfig, "override"> & {
1286
- /**
1287
- * The build variant being used by the Powerlines engine.
1288
- */
1289
- variant?: TBuildVariant$1;
1290
- /**
1291
- * An optional set of override options to apply to the selected build variant.
1292
- *
1293
- * @remarks
1294
- * This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
1295
- */
1296
- override?: Partial<TBuildResolvedConfig>;
1297
- };
1298
- }
1299
- type ViteUserConfig = UserConfig$1<ViteBuildConfig, ViteResolvedBuildConfig, "vite">;
1300
- type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
1301
- /**
1302
- * The configuration provided while executing Powerlines commands.
1303
- */
1304
- type InlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Partial<TUserConfig> & {
1305
- /**
1306
- * A string identifier for the Powerlines command being executed
1307
- */
1308
- command: PowerlinesCommand;
1309
- };
1310
- //#endregion
1311
- //#region ../powerlines/src/types/context.d.ts
1312
- interface MetaInfo {
1313
- /**
1314
- * The checksum generated from the resolved options
1315
- */
1316
- checksum: string;
1317
- /**
1318
- * The build id
1319
- */
1320
- buildId: string;
1321
- /**
1322
- * The release id
1323
- */
1324
- releaseId: string;
1325
- /**
1326
- * The build timestamp
1327
- */
1328
- timestamp: number;
1329
- /**
1330
- * A hash that represents the path to the project root directory
1331
- */
1332
- projectRootHash: string;
1333
- /**
1334
- * A hash that represents the path to the project root directory
1335
- */
1336
- configHash: string;
1337
- }
1338
- interface Resolver extends Jiti {
1339
- plugin: Jiti;
1340
- }
1341
- interface TransformResult$1 {
1342
- code: string;
1343
- map: SourceMap | null;
1344
- }
1345
- interface InitContextOptions {
1346
- /**
1347
- * If false, the plugin will be loaded after all other plugins.
1348
- *
1349
- * @defaultValue true
1350
- */
1351
- isHighPriority: boolean;
1352
- }
1353
- interface FetchOptions extends FetchRequestOptions {
1354
- /**
1355
- * An indicator specifying that the request should bypass any caching
1356
- */
1357
- skipCache?: boolean;
1358
- }
1359
- interface ParseOptions extends ParserOptions {
1360
- /**
1361
- * When true this allows return statements to be outside functions to e.g. support parsing CommonJS code.
1362
- */
1363
- allowReturnOutsideFunction?: boolean;
1364
- }
1365
- /**
1366
- * The unresolved Powerlines context.
1367
- *
1368
- * @remarks
1369
- * This context is used before the user configuration has been fully resolved after the `config`.
1370
- */
1371
- interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
1372
- /**
1373
- * The Storm workspace configuration
1374
- */
1375
- workspaceConfig: WorkspaceConfig;
1376
- /**
1377
- * An object containing the options provided to Powerlines
1378
- */
1379
- config: Omit<TResolvedConfig["userConfig"], "build" | "output"> & Required<Pick<TResolvedConfig["userConfig"], "build" | "output">> & {
1380
- projectRoot: NonUndefined<TResolvedConfig["userConfig"]["root"]>;
1381
- sourceRoot: NonUndefined<TResolvedConfig["userConfig"]["sourceRoot"]>;
1382
- output: TResolvedConfig["output"];
1383
- };
1384
- /**
1385
- * A logging function for the Powerlines engine
1386
- */
1387
- log: LogFn;
1388
- /**
1389
- * A logging function for fatal messages
1390
- */
1391
- fatal: (message: string | UnpluginMessage) => void;
1392
- /**
1393
- * A logging function for error messages
1394
- */
1395
- error: (message: string | UnpluginMessage) => void;
1396
- /**
1397
- * A logging function for warning messages
1398
- */
1399
- warn: (message: string | UnpluginMessage) => void;
1400
- /**
1401
- * A logging function for informational messages
1402
- */
1403
- info: (message: string | UnpluginMessage) => void;
1404
- /**
1405
- * A logging function for debug messages
1406
- */
1407
- debug: (message: string | UnpluginMessage) => void;
1408
- /**
1409
- * A logging function for trace messages
1410
- */
1411
- trace: (message: string | UnpluginMessage) => void;
1412
- /**
1413
- * The metadata information
1414
- */
1415
- meta: MetaInfo;
1416
- /**
1417
- * The metadata information currently written to disk
1418
- */
1419
- persistedMeta?: MetaInfo;
1420
- /**
1421
- * The Powerlines artifacts directory
1422
- */
1423
- artifactsPath: string;
1424
- /**
1425
- * The path to the Powerlines builtin runtime modules directory
1426
- */
1427
- builtinsPath: string;
1428
- /**
1429
- * The path to the Powerlines entry modules directory
1430
- */
1431
- entryPath: string;
1432
- /**
1433
- * The path to the Powerlines TypeScript declaration files directory
1434
- */
1435
- dtsPath: string;
1436
- /**
1437
- * The path to a directory where the reflection data buffers (used by the build processes) are stored
1438
- */
1439
- dataPath: string;
1440
- /**
1441
- * The path to a directory where the project cache (used by the build processes) is stored
1442
- */
1443
- cachePath: string;
1444
- /**
1445
- * The Powerlines environment paths
1446
- */
1447
- envPaths: EnvPaths;
1448
- /**
1449
- * The file system path to the Powerlines package installation
1450
- */
1451
- powerlinesPath: string;
1452
- /**
1453
- * The relative path to the Powerlines workspace root directory
1454
- */
1455
- relativeToWorkspaceRoot: string;
1456
- /**
1457
- * The project's `package.json` file content
1458
- */
1459
- packageJson: PackageJson & Record<string, any>;
1460
- /**
1461
- * The project's `project.json` file content
1462
- */
1463
- projectJson?: Record<string, any>;
1464
- /**
1465
- * The dependency installations required by the project
1466
- */
1467
- dependencies: Record<string, string | Range>;
1468
- /**
1469
- * The development dependency installations required by the project
1470
- */
1471
- devDependencies: Record<string, string | Range>;
1472
- /**
1473
- * The parsed TypeScript configuration from the `tsconfig.json` file
1474
- */
1475
- tsconfig: ParsedTypeScriptConfig;
1476
- /**
1477
- * The entry points of the source code
1478
- */
1479
- entry: ResolvedEntryTypeDefinition[];
1480
- /**
1481
- * The virtual file system manager used during the build process to reference generated runtime files
1482
- */
1483
- fs: VirtualFileSystemInterface;
1484
- /**
1485
- * The Jiti module resolver
1486
- */
1487
- resolver: Resolver;
1488
- /**
1489
- * The builtin module id that exist in the Powerlines virtual file system
1490
- */
1491
- builtins: string[];
1492
- /**
1493
- * The {@link Project} instance used for type reflection and module manipulation
1494
- *
1495
- * @see https://ts-morph.com/
1496
- *
1497
- * @remarks
1498
- * This instance is created lazily on first access.
1499
- */
1500
- program: Project;
1501
- /**
1502
- * A function to perform HTTP fetch requests
1503
- *
1504
- * @remarks
1505
- * This function uses a caching layer to avoid duplicate requests during the Powerlines process.
1506
- *
1507
- * @example
1508
- * ```ts
1509
- * const response = await context.fetch("https://api.example.com/data");
1510
- * const data = await response.json();
1511
- * ```
1512
- *
1513
- * @see https://github.com/nodejs/undici
1514
- *
1515
- * @param input - The URL to fetch.
1516
- * @param options - The fetch request options.
1517
- * @returns A promise that resolves to a response returned by the fetch.
1518
- */
1519
- fetch: (input: RequestInfo, options?: FetchOptions) => Promise<Response>;
1520
- /**
1521
- * Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
1522
- *
1523
- * @remarks
1524
- * This function can be used to parse TypeScript code into an AST for further analysis or transformation.
1525
- *
1526
- * @example
1527
- * ```ts
1528
- * const ast = context.parse("const x: number = 42;");
1529
- * ```
1530
- *
1531
- * @see https://rollupjs.org/plugin-development/#this-parse
1532
- * @see https://github.com/oxc/oxc
1533
- *
1534
- * @param code - The source code to parse.
1535
- * @param options - The options to pass to the parser.
1536
- * @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
1537
- */
1538
- parse: (code: string, options?: ParseOptions) => Promise<ParseResult>;
1539
- /**
1540
- * A helper function to resolve modules using the Jiti resolver
1541
- *
1542
- * @remarks
1543
- * This function can be used to resolve modules relative to the project root directory.
1544
- *
1545
- * @example
1546
- * ```ts
1547
- * const resolvedPath = await context.resolve("some-module", "/path/to/importer");
1548
- * ```
1549
- *
1550
- * @param id - The module to resolve.
1551
- * @param importer - An optional path to the importer module.
1552
- * @param options - Additional resolution options.
1553
- * @returns A promise that resolves to the resolved module path.
1554
- */
1555
- resolve: (id: string, importer?: string, options?: ResolveOptions$1) => Promise<ExternalIdResult | undefined>;
1556
- /**
1557
- * A helper function to load modules using the Jiti resolver
1558
- *
1559
- * @remarks
1560
- * This function can be used to load modules relative to the project root directory.
1561
- *
1562
- * @example
1563
- * ```ts
1564
- * const module = await context.load("some-module", "/path/to/importer");
1565
- * ```
1566
- *
1567
- * @param id - The module to load.
1568
- * @returns A promise that resolves to the loaded module.
1569
- */
1570
- load: (id: string) => Promise<TransformResult$1 | undefined>;
1571
- /**
1572
- * The Powerlines builtin virtual files
1573
- */
1574
- getBuiltins: () => Promise<VirtualFile[]>;
1575
- /**
1576
- * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
1577
- *
1578
- * @param code - The source code of the builtin file
1579
- * @param id - The unique identifier of the builtin file
1580
- * @param path - An optional path to write the builtin file to
1581
- */
1582
- emitBuiltin: (code: string, id: string, path?: string) => Promise<void>;
1583
- /**
1584
- * Resolves a entry virtual file and writes it to the VFS if it does not already exist
1585
- *
1586
- * @param code - The source code of the entry file
1587
- * @param path - An optional path to write the entry file to
1588
- */
1589
- emitEntry: (code: string, path: string) => Promise<void>;
1590
- /**
1591
- * A function to update the context fields using a new user configuration options
1592
- */
1593
- withUserConfig: (userConfig: UserConfig$1, options?: InitContextOptions) => Promise<void>;
1594
- /**
1595
- * A function to update the context fields using inline configuration options
1596
- */
1597
- withInlineConfig: (inlineConfig: InlineConfig, options?: InitContextOptions) => Promise<void>;
1598
- /**
1599
- * Create a new logger instance
1600
- *
1601
- * @param name - The name to use for the logger instance
1602
- * @returns A logger function
1603
- */
1604
- createLog: (name: string | null) => LogFn;
1605
- /**
1606
- * Extend the current logger instance with a new name
1607
- *
1608
- * @param name - The name to use for the extended logger instance
1609
- * @returns A logger function
1610
- */
1611
- extendLog: (name: string) => LogFn;
1612
- /**
1613
- * Generates a checksum representing the current context state
1614
- *
1615
- * @returns A promise that resolves to a string representing the checksum
1616
- */
1617
- generateChecksum: () => Promise<string>;
1618
- }
1619
- type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = Omit<UnresolvedContext<TResolvedConfig>, "config"> & {
1620
- /**
1621
- * The fully resolved Powerlines configuration
1622
- */
1623
- config: TResolvedConfig;
1624
- };
1625
- interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig>, UnpluginContext {
1626
- /**
1627
- * The environment specific resolved configuration
1628
- */
1629
- environment: EnvironmentResolvedConfig;
1630
- /**
1631
- * An alternative property name for the {@link log} property
1632
- *
1633
- * @remarks
1634
- * This is provided for compatibility with other logging libraries that expect a `logger` property.
1635
- */
1636
- logger: LogFn;
1637
- }
1638
- type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = UnpluginBuildContext & PluginContext<TResolvedConfig>;
1639
- //#endregion
1640
- //#region src/types/plugin.d.ts
1641
- type VitePluginOptions = Partial<ViteBuildConfig> & {
1642
- /**
1643
- * Whether to use [rolldown-vite](https://vite.dev/guide/rolldown.html) for the build.
1644
- *
1645
- * @defaultValue false
1646
- */
1647
- rolldown?: boolean;
1648
- };
1649
- type VitePluginResolvedConfig = ViteResolvedConfig;
1650
- type VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = PluginContext<TResolvedConfig>;
1651
- declare type __ΩVitePluginOptions = any[];
1652
- declare type __ΩVitePluginResolvedConfig = any[];
1653
- declare type __ΩVitePluginContext = any[];
1654
- //#endregion
1655
- export { __ΩVitePluginOptions as a, __ΩVitePluginContext as i, VitePluginOptions as n, __ΩVitePluginResolvedConfig as o, VitePluginResolvedConfig as r, Plugin as s, VitePluginContext as t };