@powerlines/plugin-react 0.1.47 → 0.1.49

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 (91) hide show
  1. package/README.md +8 -2
  2. package/dist/chunk-CF6LXmkI.mjs +1 -0
  3. package/dist/components/index.cjs +1 -1
  4. package/dist/components/index.d.cts +4 -6
  5. package/dist/components/index.d.mts +4 -0
  6. package/dist/components/index.mjs +1 -0
  7. package/dist/components/react-optimized.cjs +1 -8
  8. package/dist/components/react-optimized.d.cts +3 -95
  9. package/dist/components/react-optimized.d.mts +3 -0
  10. package/dist/components/react-optimized.mjs +1 -0
  11. package/dist/components-MTvNCZDU.mjs +1 -0
  12. package/dist/index-B8OHl-c_.d.mts +1 -0
  13. package/dist/index-BR1oNnaF.d.cts +1 -0
  14. package/dist/index-CFG0_wK4.d.cts +1 -0
  15. package/dist/index-DNLi60D-.d.mts +1 -0
  16. package/dist/index.cjs +67 -8
  17. package/dist/index.d.cts +32 -53
  18. package/dist/index.d.cts.map +1 -0
  19. package/dist/index.d.mts +47 -0
  20. package/dist/index.d.mts.map +1 -0
  21. package/dist/index.mjs +65 -0
  22. package/dist/index.mjs.map +1 -0
  23. package/dist/plugin-C9ZuWdaR.d.cts +1781 -0
  24. package/dist/plugin-C9ZuWdaR.d.cts.map +1 -0
  25. package/dist/plugin-G4qbpIjB.mjs +1 -0
  26. package/dist/plugin-JgSIR_pC.d.mts +1779 -0
  27. package/dist/plugin-JgSIR_pC.d.mts.map +1 -0
  28. package/dist/plugin-sboatcNU.d.mts +1779 -0
  29. package/dist/plugin-sboatcNU.d.mts.map +1 -0
  30. package/dist/react-optimized-B4-nlx1E.d.mts +103 -0
  31. package/dist/react-optimized-B4-nlx1E.d.mts.map +1 -0
  32. package/dist/react-optimized-BO9knQDM.cjs +1 -0
  33. package/dist/react-optimized-B_P6YxHv.mjs +2 -0
  34. package/dist/react-optimized-B_P6YxHv.mjs.map +1 -0
  35. package/dist/react-optimized-CY318RuO.d.cts +102 -0
  36. package/dist/react-optimized-CY318RuO.d.cts.map +1 -0
  37. package/dist/react-optimized-CbXKgStb.d.mts +103 -0
  38. package/dist/react-optimized-CbXKgStb.d.mts.map +1 -0
  39. package/dist/resolved-C3sdBJbK.d.mts +1680 -0
  40. package/dist/resolved-C3sdBJbK.d.mts.map +1 -0
  41. package/dist/resolved-C8Vvfp78.d.cts +1679 -0
  42. package/dist/resolved-C8Vvfp78.d.cts.map +1 -0
  43. package/dist/resolved-cGosdCt1.d.mts +1681 -0
  44. package/dist/resolved-cGosdCt1.d.mts.map +1 -0
  45. package/dist/runtime-Bp9G0scd.cjs +0 -0
  46. package/dist/runtime-CH2w8aTC.d.mts +16 -0
  47. package/dist/runtime-CH2w8aTC.d.mts.map +1 -0
  48. package/dist/runtime-DEBqRdSt.d.mts +793 -0
  49. package/dist/runtime-DEBqRdSt.d.mts.map +1 -0
  50. package/dist/runtime-DRosxZBg.d.mts +793 -0
  51. package/dist/runtime-DRosxZBg.d.mts.map +1 -0
  52. package/dist/runtime-FcS-im6N.d.mts +16 -0
  53. package/dist/runtime-FcS-im6N.d.mts.map +1 -0
  54. package/dist/runtime-ag6w6CSq.d.cts +793 -0
  55. package/dist/runtime-ag6w6CSq.d.cts.map +1 -0
  56. package/dist/runtime-cDYyRPa0.mjs +1 -0
  57. package/dist/runtime-e8zq29Og.d.cts +16 -0
  58. package/dist/runtime-e8zq29Og.d.cts.map +1 -0
  59. package/dist/types/index.cjs +1 -1
  60. package/dist/types/index.d.cts +6 -32
  61. package/dist/types/index.d.mts +6 -0
  62. package/dist/types/index.mjs +1 -0
  63. package/dist/types/plugin.cjs +1 -1
  64. package/dist/types/plugin.d.cts +4 -1796
  65. package/dist/types/plugin.d.mts +4 -0
  66. package/dist/types/plugin.mjs +1 -0
  67. package/dist/types/runtime.cjs +1 -1
  68. package/dist/types/runtime.d.cts +4 -38
  69. package/dist/types/runtime.d.mts +4 -0
  70. package/dist/types/runtime.mjs +1 -0
  71. package/dist/types-C5ggNT4K.mjs +1 -0
  72. package/dist/types-a8gm_IaQ.cjs +0 -0
  73. package/package.json +47 -36
  74. package/dist/chunk-FBBMZ4NC.cjs +0 -7
  75. package/dist/chunk-UCUR73HG.js +0 -7
  76. package/dist/components/index.d.ts +0 -6
  77. package/dist/components/index.js +0 -1
  78. package/dist/components/react-optimized.d.ts +0 -95
  79. package/dist/components/react-optimized.js +0 -8
  80. package/dist/fs-ECFlqnPg.d.cts +0 -378
  81. package/dist/fs-ECFlqnPg.d.ts +0 -378
  82. package/dist/index.d.ts +0 -65
  83. package/dist/index.js +0 -8
  84. package/dist/runtime-C5ZrfPiA.d.cts +0 -2008
  85. package/dist/runtime-kdZZtKC2.d.ts +0 -2008
  86. package/dist/types/index.d.ts +0 -32
  87. package/dist/types/index.js +0 -1
  88. package/dist/types/plugin.d.ts +0 -1796
  89. package/dist/types/runtime.d.ts +0 -38
  90. /package/dist/{types/plugin.js → components-BWLXb7a2.cjs} +0 -0
  91. /package/dist/{types/runtime.js → plugin-pBKbb5K9.cjs} +0 -0
@@ -1,2008 +0,0 @@
1
- import { EnvPaths } from '@stryke/env/get-env-paths';
2
- import { FetchRequestOptions } from '@stryke/http/fetch';
3
- import { NonUndefined, MaybePromise, FunctionLike } from '@stryke/types/base';
4
- import { PackageJson } from '@stryke/types/package-json';
5
- import { Jiti } from 'jiti';
6
- import { SourceMap } from 'magic-string';
7
- import { ParserOptions, ParseResult } from 'oxc-parser';
8
- import { Range } from 'semver';
9
- import { Project } from 'ts-morph';
10
- import { RequestInfo, Response } from 'undici';
11
- import { TransformResult as TransformResult$1, ExternalIdResult, HookFilter, UnpluginOptions, UnpluginContext, UnpluginMessage, UnpluginBuildContext } from 'unplugin';
12
- import { PluginItem, PluginObj, PluginPass, transformAsync } from '@babel/core';
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 { ResolvedPreviewOptions, PreviewOptions } from 'vite';
19
- import { BabelAPI } from '@babel/helper-plugin-utils';
20
- import { S as StoragePort, a as StoragePreset, V as VirtualFileSystemInterface, R as ResolveOptions, b as VirtualFile } from './fs-ECFlqnPg.js';
21
- import { ArrayValues } from '@stryke/types/array';
22
- import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
23
- import ts from 'typescript';
24
-
25
- type BabelPluginPass<TState = unknown> = PluginPass & TState;
26
- type BabelTransformPluginFilter = (code: string, id: string) => boolean;
27
- type BabelTransformPlugin<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = ((context: TContext) => (options: {
28
- name: string;
29
- log: LogFn;
30
- api: BabelAPI;
31
- options: TOptions;
32
- context: TContext;
33
- dirname: string;
34
- }) => PluginObj<TOptions & BabelPluginPass<TState>>) & {
35
- $$name: string;
36
- };
37
- type BabelTransformPluginOptions<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = PluginItem | BabelTransformPlugin<TContext, TOptions, TState> | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions] | [
38
- BabelTransformPlugin<TContext, TOptions, TState>,
39
- TOptions,
40
- BabelTransformPluginFilter
41
- ];
42
-
43
- type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
44
- interface BuildConfig {
45
- /**
46
- * The platform to build the project for
47
- *
48
- * @defaultValue "neutral"
49
- */
50
- platform?: "node" | "browser" | "neutral";
51
- /**
52
- * Array of strings indicating the polyfills to include for the build.
53
- *
54
- * @remarks
55
- * 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).
56
- *
57
- * @example
58
- * ```ts
59
- * {
60
- * polyfill: ['{projectRoot}/custom-polyfill.ts']
61
- * }
62
- * ```
63
- */
64
- polyfill?: string[];
65
- /**
66
- * 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.
67
- *
68
- * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
69
- */
70
- mainFields?: string[];
71
- /**
72
- * Array of strings indicating what conditions should be used for module resolution.
73
- */
74
- conditions?: string[];
75
- /**
76
- * Array of strings indicating what file extensions should be used for module resolution.
77
- *
78
- * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
79
- */
80
- extensions?: string[];
81
- /**
82
- * Array of strings indicating what modules should be deduplicated to a single version in the build.
83
- *
84
- * @remarks
85
- * 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.
86
- */
87
- dedupe?: string[];
88
- /**
89
- * Array of strings or regular expressions that indicate what modules are builtin for the environment.
90
- */
91
- builtins?: (string | RegExp)[];
92
- /**
93
- * Define global variable replacements.
94
- *
95
- * @remarks
96
- * 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.
97
- *
98
- * @example
99
- * ```ts
100
- * {
101
- * define: {
102
- * __VERSION__: '"1.0.0"',
103
- * __DEV__: 'process.env.NODE_ENV !== "production"'
104
- * }
105
- * }
106
- * ```
107
- *
108
- * @see https://esbuild.github.io/api/#define
109
- * @see https://vitejs.dev/config/build-options.html#define
110
- * @see https://github.com/rollup/plugins/tree/master/packages/replace
111
- */
112
- define?: Record<string, any>;
113
- /**
114
- * Global variables that will have import statements injected where necessary
115
- *
116
- * @remarks
117
- * 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.
118
- *
119
- * @example
120
- * ```ts
121
- * {
122
- * inject: {
123
- * process: 'process/browser',
124
- * Buffer: ['buffer', 'Buffer'],
125
- * }
126
- * }
127
- * ```
128
- *
129
- * @see https://github.com/rollup/plugins/tree/master/packages/inject
130
- */
131
- inject?: Record<string, string | string[]>;
132
- /**
133
- * The alias mappings to use for module resolution during the build process.
134
- *
135
- * @remarks
136
- * This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
137
- *
138
- * @example
139
- * ```ts
140
- * {
141
- * alias: {
142
- * "@utils": "./src/utils",
143
- * "@components": "./src/components"
144
- * }
145
- * }
146
- * ```
147
- *
148
- * @see https://github.com/rollup/plugins/tree/master/packages/alias
149
- */
150
- alias?: Record<string, string> | Array<{
151
- find: string | RegExp;
152
- replacement: string;
153
- }>;
154
- /**
155
- * A list of modules that should not be bundled, even if they are external dependencies.
156
- *
157
- * @remarks
158
- * 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.
159
- */
160
- external?: (string | RegExp)[];
161
- /**
162
- * A list of modules that should always be bundled, even if they are external dependencies.
163
- */
164
- noExternal?: (string | RegExp)[];
165
- /**
166
- * Should the Powerlines CLI processes skip bundling the `node_modules` directory?
167
- */
168
- skipNodeModulesBundle?: boolean;
169
- /**
170
- * An optional set of override options to apply to the selected build variant.
171
- *
172
- * @remarks
173
- * 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.
174
- */
175
- override?: Record<string, any>;
176
- }
177
- type BuildResolvedConfig = Omit<BuildConfig, "override">;
178
-
179
- declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
180
- type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
181
-
182
- interface ResolvedEntryTypeDefinition extends TypeDefinition {
183
- /**
184
- * The user provided entry point in the source code
185
- */
186
- input: TypeDefinition;
187
- /**
188
- * An optional name to use in the package export during the build process
189
- */
190
- output?: string;
191
- }
192
- type BabelResolvedConfig = Omit<BabelUserConfig, "plugins" | "presets"> & Required<Pick<BabelUserConfig, "plugins" | "presets">>;
193
- type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "ssr">> & {
194
- /**
195
- * The name of the environment
196
- */
197
- name: string;
198
- /**
199
- * Configuration options for the preview server
200
- */
201
- preview?: ResolvedPreviewOptions;
202
- };
203
- type ResolvedAssetGlob = AssetGlob & Required<Pick<AssetGlob, "input">>;
204
- type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> & {
205
- assets: ResolvedAssetGlob[];
206
- }> & Pick<OutputConfig, "storage">;
207
- /**
208
- * The resolved options for the Powerlines project configuration.
209
- */
210
- type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = 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">> & {
211
- /**
212
- * The configuration options that were provided inline to the Powerlines CLI.
213
- */
214
- inlineConfig: InlineConfig<TUserConfig>;
215
- /**
216
- * The original configuration options that were provided by the user to the Powerlines process.
217
- */
218
- userConfig: TUserConfig;
219
- /**
220
- * A string identifier for the Powerlines command being executed.
221
- */
222
- command: NonUndefined<InlineConfig<TUserConfig>["command"]>;
223
- /**
224
- * The root directory of the project's source code
225
- *
226
- * @defaultValue "\{projectRoot\}/src"
227
- */
228
- sourceRoot: NonUndefined<TUserConfig["sourceRoot"]>;
229
- /**
230
- * The root directory of the project.
231
- */
232
- projectRoot: NonUndefined<TUserConfig["root"]>;
233
- /**
234
- * The type of project being built.
235
- */
236
- projectType: NonUndefined<TUserConfig["type"]>;
237
- /**
238
- * The output configuration options to use for the build process
239
- */
240
- output: OutputResolvedConfig;
241
- /**
242
- * Configuration provided to build processes
243
- *
244
- * @remarks
245
- * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
246
- */
247
- build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
248
- /**
249
- * The log level to use for the Powerlines processes.
250
- *
251
- * @defaultValue "info"
252
- */
253
- logLevel: "error" | "warn" | "info" | "debug" | "trace" | null;
254
- };
255
-
256
- interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
257
- /**
258
- * The order in which the plugin should be applied.
259
- */
260
- order?: "pre" | "post" | null | undefined;
261
- /**
262
- * A filter to determine when the hook should be called.
263
- */
264
- filter?: Pick<HookFilter, TFilter>;
265
- /**
266
- * The hook function to be called.
267
- */
268
- handler: THookFunction;
269
- }
270
- type PluginHook<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> = THookFunction | PluginHookObject<THookFunction, TFilter>;
271
- /**
272
- * A result returned by the plugin from the `generateTypes` hook that describes the declaration types output file.
273
- */
274
- interface GenerateTypesResult {
275
- directives?: string[];
276
- code: string;
277
- }
278
- type DeepPartial<T> = {
279
- [K in keyof T]?: DeepPartial<T[K]>;
280
- };
281
- type ConfigResult<TContext extends PluginContext = PluginContext> = DeepPartial<TContext["config"]> & Record<string, any>;
282
- interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext> extends Record<CommandType, (this: TContext) => MaybePromise<void>> {
283
- /**
284
- * A function that returns configuration options to be merged with the build context's options.
285
- *
286
- * @remarks
287
- * 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.
288
- *
289
- * @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.
290
- *
291
- * @see https://vitejs.dev/guide/api-plugin#config
292
- *
293
- * @param this - The build context.
294
- * @param config - The partial configuration object to be modified.
295
- * @returns A promise that resolves to a partial configuration object.
296
- */
297
- config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>;
298
- /**
299
- * 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.
300
- *
301
- * @remarks
302
- * 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.
303
- *
304
- * @see https://vitejs.dev/guide/api-plugin#configenvironment
305
- *
306
- * @param this - The build context.
307
- * @param name - The name of the environment being configured.
308
- * @param environment - The Vite-like environment object containing information about the current build environment.
309
- * @returns A promise that resolves when the hook is complete.
310
- */
311
- configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>;
312
- /**
313
- * A hook that is called when the plugin is resolved.
314
- *
315
- * @see https://vitejs.dev/guide/api-plugin#configresolved
316
- *
317
- * @param this - The build context.
318
- * @returns A promise that resolves when the hook is complete.
319
- */
320
- configResolved: (this: TContext) => MaybePromise<void>;
321
- /**
322
- * 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.
323
- *
324
- * @param this - The build context.
325
- * @param code - The source code to generate types for.
326
- * @returns A promise that resolves when the hook is complete.
327
- */
328
- generateTypes: (this: TContext, code: string) => MaybePromise<GenerateTypesResult | string | undefined | null>;
329
- /**
330
- * A hook that is called at the start of the build process.
331
- *
332
- * @param this - The build context and unplugin build context.
333
- * @returns A promise that resolves when the hook is complete.
334
- */
335
- buildStart: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
336
- /**
337
- * A hook that is called at the end of the build process.
338
- *
339
- * @param this - The build context and unplugin build context.
340
- * @returns A promise that resolves when the hook is complete.
341
- */
342
- buildEnd: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
343
- /**
344
- * A hook that is called to transform the source code.
345
- *
346
- * @param this - The build context, unplugin build context, and unplugin context.
347
- * @param code - The source code to transform.
348
- * @param id - The identifier of the source code.
349
- * @returns A promise that resolves when the hook is complete.
350
- */
351
- transform: (this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult$1>;
352
- /**
353
- * A hook that is called to load the source code.
354
- *
355
- * @param this - The build context, unplugin build context, and unplugin context.
356
- * @param id - The identifier of the source code.
357
- * @returns A promise that resolves when the hook is complete.
358
- */
359
- load: (this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<TransformResult$1>;
360
- /**
361
- * A hook that is called to resolve the identifier of the source code.
362
- *
363
- * @param this - The build context, unplugin build context, and unplugin context.
364
- * @param id - The identifier of the source code.
365
- * @param importer - The importer of the source code.
366
- * @param options - The options for resolving the identifier.
367
- * @returns A promise that resolves when the hook is complete.
368
- */
369
- resolveId: (this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
370
- isEntry: boolean;
371
- }) => MaybePromise<string | ExternalIdResult | null | undefined>;
372
- /**
373
- * A hook that is called to write the bundle to disk.
374
- *
375
- * @param this - The build context.
376
- * @returns A promise that resolves when the hook is complete.
377
- */
378
- writeBundle: (this: TContext) => MaybePromise<void>;
379
- }
380
- type BuildPlugin<TContext extends PluginContext = PluginContext, TBuildVariant extends UnpluginBuildVariant = UnpluginBuildVariant, TOptions extends Required<UnpluginOptions>[TBuildVariant] = Required<UnpluginOptions>[TBuildVariant]> = {
381
- [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];
382
- };
383
- type PluginHooks<TContext extends PluginContext = PluginContext> = {
384
- [TKey in keyof BasePluginHookFunctions<TContext>]: PluginHook<BasePluginHookFunctions<TContext>[TKey]>;
385
- } & {
386
- /**
387
- * A function that returns configuration options to be merged with the build context's options.
388
- *
389
- * @remarks
390
- * 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.
391
- *
392
- * @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.
393
- *
394
- * @see https://vitejs.dev/guide/api-plugin#config
395
- *
396
- * @param this - The build context.
397
- * @param config - The partial configuration object to be modified.
398
- * @returns A promise that resolves to a partial configuration object.
399
- */
400
- config: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>> | ConfigResult<TContext>;
401
- /**
402
- * A hook that is called to transform the source code.
403
- *
404
- * @param this - The build context, unplugin build context, and unplugin context.
405
- * @param code - The source code to transform.
406
- * @param id - The identifier of the source code.
407
- * @returns A promise that resolves when the hook is complete.
408
- */
409
- transform: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult$1>, "code" | "id">;
410
- /**
411
- * A hook that is called to load the source code.
412
- *
413
- * @param this - The build context, unplugin build context, and unplugin context.
414
- * @param id - The identifier of the source code.
415
- * @returns A promise that resolves when the hook is complete.
416
- */
417
- load: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<TransformResult$1>, "id">;
418
- /**
419
- * A hook that is called to resolve the identifier of the source code.
420
- *
421
- * @param this - The build context, unplugin build context, and unplugin context.
422
- * @param id - The identifier of the source code.
423
- * @param importer - The importer of the source code.
424
- * @param options - The options for resolving the identifier.
425
- * @returns A promise that resolves when the hook is complete.
426
- */
427
- resolveId: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
428
- isEntry: boolean;
429
- }) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
430
- };
431
- type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = {
432
- [TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant>;
433
- };
434
- interface Plugin<in out TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> extends Partial<PluginHooks<TContext>>, PluginBuildPlugins<TContext> {
435
- /**
436
- * The name of the plugin, for use in deduplication, error messages and logs.
437
- */
438
- name: string;
439
- /**
440
- * An API object that can be used for inter-plugin communication.
441
- *
442
- * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
443
- */
444
- api?: Record<string, any>;
445
- /**
446
- * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.
447
- *
448
- * @remarks
449
- * The Plugin invocation order is as follows:
450
- * - `enforce: 'pre'` plugins
451
- * - `order: 'pre'` plugin hooks
452
- * - any other plugins (normal)
453
- * - `order: 'post'` plugin hooks
454
- * - `enforce: 'post'` plugins
455
- *
456
- * @see https://vitejs.dev/guide/api-plugin.html#plugin-ordering
457
- * @see https://rollupjs.org/plugin-development/#build-hooks
458
- * @see https://webpack.js.org/concepts/loaders/#enforce---pre-and-post
459
- * @see https://esbuild.github.io/plugins/#concepts
460
- */
461
- enforce?: "pre" | "post";
462
- /**
463
- * A function to determine if two plugins are the same and can be de-duplicated.
464
- *
465
- * @remarks
466
- * If this is not provided, plugins are de-duplicated by comparing their names.
467
- *
468
- * @param other - The other plugin to compare against.
469
- * @returns `true` if the two plugins are the same, `false` otherwise.
470
- */
471
- dedupe?: false | ((other: Plugin<any>) => boolean);
472
- /**
473
- * A list of pre-requisite plugins that must be loaded before this plugin can be used.
474
- */
475
- dependsOn?: PluginConfig<any>[];
476
- /**
477
- * Define environments where this plugin should be active. By default, the plugin is active in all environments.
478
- *
479
- * @param environment - The environment to check.
480
- * @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
481
- */
482
- applyToEnvironment?: (environment: EnvironmentResolvedConfig) => MaybePromise<boolean | Plugin<TContext>>;
483
- }
484
-
485
- type ReflectionMode = "default" | "explicit" | "never";
486
- type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
487
- /**
488
- * Defines the level of reflection to be used during the transpilation process.
489
- *
490
- * @remarks
491
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
492
- * - `minimal` - Only the essential type information is captured.
493
- * - `normal` - Additional type information is captured, including some contextual data.
494
- * - `verbose` - All available type information is captured, including detailed contextual data.
495
- */
496
- type ReflectionLevel = "minimal" | "normal" | "verbose";
497
- interface DeepkitOptions {
498
- /**
499
- * Either true to activate reflection for all files compiled using this tsconfig,
500
- * or a list of globs/file paths relative to this tsconfig.json.
501
- * Globs/file paths can be prefixed with a ! to exclude them.
502
- */
503
- reflection?: RawReflectionMode;
504
- /**
505
- * Defines the level of reflection to be used during the transpilation process.
506
- *
507
- * @remarks
508
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
509
- * - `minimal` - Only the essential type information is captured.
510
- * - `normal` - Additional type information is captured, including some contextual data.
511
- * - `verbose` - All available type information is captured, including detailed contextual data.
512
- */
513
- reflectionLevel?: ReflectionLevel;
514
- }
515
- type TSCompilerOptions = CompilerOptions & DeepkitOptions;
516
- /**
517
- * The TypeScript compiler configuration.
518
- *
519
- * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
520
- */
521
- interface TSConfig extends Omit<TsConfigJson, "reflection"> {
522
- /**
523
- * Either true to activate reflection for all files compiled using this tsconfig,
524
- * or a list of globs/file paths relative to this tsconfig.json.
525
- * Globs/file paths can be prefixed with a ! to exclude them.
526
- */
527
- reflection?: RawReflectionMode;
528
- /**
529
- * Defines the level of reflection to be used during the transpilation process.
530
- *
531
- * @remarks
532
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
533
- * - `minimal` - Only the essential type information is captured.
534
- * - `normal` - Additional type information is captured, including some contextual data.
535
- * - `verbose` - All available type information is captured, including detailed contextual data.
536
- */
537
- reflectionLevel?: ReflectionLevel;
538
- /**
539
- * Instructs the TypeScript compiler how to compile `.ts` files.
540
- */
541
- compilerOptions?: TSCompilerOptions;
542
- }
543
- type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
544
- originalTsconfigJson: TsConfigJson;
545
- tsconfigJson: TSConfig;
546
- tsconfigFilePath: string;
547
- };
548
-
549
- type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
550
- /**
551
- * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
552
- */
553
- type WorkspaceConfig = Partial<StormWorkspaceConfig> & Required<Pick<StormWorkspaceConfig, "workspaceRoot">>;
554
- type PluginFactory<in out TContext extends PluginContext = PluginContext, TOptions = any> = (options: TOptions) => MaybePromise<Plugin<TContext>>;
555
- /**
556
- * A configuration tuple for a Powerlines plugin.
557
- */
558
- type PluginConfigTuple<TContext extends PluginContext = PluginContext, TOptions = any> = [string | PluginFactory<TContext, TOptions>, TOptions] | [Plugin<TContext>];
559
- /**
560
- * A configuration object for a Powerlines plugin.
561
- */
562
- type PluginConfigObject<TContext extends PluginContext = PluginContext, TOptions = any> = {
563
- plugin: string | PluginFactory<TContext, TOptions>;
564
- options: TOptions;
565
- } | {
566
- plugin: Plugin<TContext>;
567
- options?: never;
568
- };
569
- /**
570
- * A configuration tuple for a Powerlines plugin.
571
- */
572
- type PluginConfig<TContext extends PluginContext = PluginContext> = string | PluginFactory<TContext, void> | Plugin<TContext> | Promise<Plugin<TContext>> | PluginConfigTuple<TContext> | PluginConfigObject<TContext>;
573
- type ProjectType = "application" | "library";
574
- type BabelUserConfig = Parameters<typeof transformAsync>[1] & {
575
- /**
576
- * The Babel plugins to be used during the build process
577
- */
578
- plugins?: BabelTransformPluginOptions[];
579
- /**
580
- * The Babel presets to be used during the build process
581
- */
582
- presets?: BabelTransformPluginOptions[];
583
- };
584
- interface DeployConfig {
585
- /**
586
- * The deployment variant being used by the Powerlines engine.
587
- *
588
- * @example
589
- * ```ts
590
- * export default defineConfig({
591
- * deploy: {
592
- * variant: "cloudflare"
593
- * }
594
- * });
595
- *
596
- * ```
597
- */
598
- variant?: string;
599
- }
600
- interface OutputConfig {
601
- /**
602
- * The path to output the final compiled files to
603
- *
604
- * @remarks
605
- * If a value is not provided, Powerlines will attempt to:
606
- * 1. Use the `outDir` value in the `tsconfig.json` file.
607
- * 2. Use the `dist` directory in the project root directory.
608
- *
609
- * @defaultValue "dist/\{projectRoot\}"
610
- */
611
- outputPath?: string;
612
- /**
613
- * The output directory path for the project build.
614
- *
615
- * @remarks
616
- * 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.
617
- *
618
- * @defaultValue "\{projectRoot\}/dist"
619
- */
620
- buildPath?: string;
621
- /**
622
- * The folder where the generated runtime artifacts will be located
623
- *
624
- * @remarks
625
- * This folder will contain all runtime artifacts and builtins generated during the "prepare" phase.
626
- *
627
- * @defaultValue "\{projectRoot\}/.powerlines"
628
- */
629
- artifactsPath?: string;
630
- /**
631
- * The path of the generated runtime declaration file relative to the workspace root.
632
- *
633
- * @defaultValue "\{projectRoot\}/powerlines.d.ts"
634
- */
635
- dts?: string | false;
636
- /**
637
- * A prefix to use for identifying builtin modules
638
- *
639
- * @remarks
640
- * 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"`.
641
- *
642
- * @defaultValue "powerlines"
643
- */
644
- builtinPrefix?: string;
645
- /**
646
- * The module format of the output files
647
- *
648
- * @remarks
649
- * 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.
650
- *
651
- * @defaultValue "esm"
652
- */
653
- format?: Format | Format[];
654
- /**
655
- * A list of assets to copy to the output directory
656
- *
657
- * @remarks
658
- * 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.
659
- */
660
- assets?: Array<string | AssetGlob>;
661
- /**
662
- * A string preset or a custom {@link StoragePort} to provide fine-grained control over generated/output file storage.
663
- *
664
- * @remarks
665
- * If a string preset is provided, it must be one of the following values:
666
- * - `"virtual"`: Uses the local file system for storage.
667
- * - `"fs"`: Uses an in-memory virtual file system for storage.
668
- *
669
- * If a custom {@link StoragePort} is provided, it will be used for all file storage operations during the build process.
670
- *
671
- * @defaultValue "virtual"
672
- */
673
- storage?: StoragePort | StoragePreset;
674
- }
675
- interface BaseConfig {
676
- /**
677
- * The entry point(s) for the application
678
- */
679
- entry?: TypeDefinitionParameter | TypeDefinitionParameter[];
680
- /**
681
- * Configuration for the output of the build process
682
- */
683
- output?: OutputConfig;
684
- /**
685
- * Configuration for linting the source code
686
- *
687
- * @remarks
688
- * If set to `false`, linting will be disabled.
689
- */
690
- lint?: Record<string, any> | false;
691
- /**
692
- * Configuration for testing the source code
693
- *
694
- * @remarks
695
- * If set to `false`, testing will be disabled.
696
- */
697
- test?: Record<string, any> | false;
698
- /**
699
- * Configuration for the transformation of the source code
700
- */
701
- transform?: Record<string, any>;
702
- /**
703
- * Configuration provided to build processes
704
- *
705
- * @remarks
706
- * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
707
- */
708
- build?: BuildConfig;
709
- /**
710
- * Configuration for documentation generation
711
- *
712
- * @remarks
713
- * This configuration will be used by the documentation generation plugins during the `docs` command.
714
- */
715
- docs?: Record<string, any>;
716
- /**
717
- * Configuration for deploying the source code
718
- *
719
- * @remarks
720
- * If set to `false`, the deployment will be disabled.
721
- */
722
- deploy?: DeployConfig | false;
723
- /**
724
- * The path to the tsconfig file to be used by the compiler
725
- *
726
- * @remarks
727
- * 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).
728
- *
729
- * @defaultValue "\{projectRoot\}/tsconfig.json"
730
- */
731
- tsconfig?: string;
732
- /**
733
- * The raw {@link TSConfig} object to be used by the compiler. This object will be merged with the `tsconfig.json` file.
734
- *
735
- * @see https://www.typescriptlang.org/tsconfig
736
- *
737
- * @remarks
738
- * If populated, this option takes higher priority than `tsconfig`
739
- */
740
- tsconfigRaw?: TSConfig;
741
- }
742
- interface EnvironmentConfig extends BaseConfig {
743
- /**
744
- * Configuration options for the preview server
745
- */
746
- preview?: PreviewOptions;
747
- /**
748
- * A flag indicating whether the build is for a Server-Side Rendering environment.
749
- */
750
- ssr?: boolean;
751
- /**
752
- * Define if this environment is used for Server-Side Rendering
753
- *
754
- * @defaultValue "server" (if it isn't the client environment)
755
- */
756
- consumer?: "client" | "server";
757
- }
758
- interface CommonUserConfig extends BaseConfig {
759
- /**
760
- * The name of the project
761
- */
762
- name?: string;
763
- /**
764
- * The project display title
765
- *
766
- * @remarks
767
- * This option is used in documentation generation and other places where a human-readable title is needed.
768
- */
769
- title?: string;
770
- /**
771
- * A description of the project
772
- *
773
- * @remarks
774
- * If this option is not provided, the build process will try to use the \`description\` value from the `\package.json\` file.
775
- */
776
- description?: string;
777
- /**
778
- * The log level to use for the Powerlines processes.
779
- *
780
- * @defaultValue "info"
781
- */
782
- logLevel?: LogLevelLabel | null;
783
- /**
784
- * A custom logger function to use for logging messages
785
- */
786
- customLogger?: LogFn;
787
- /**
788
- * 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.
789
- *
790
- * @defaultValue "production"
791
- */
792
- mode?: "development" | "test" | "production";
793
- /**
794
- * The type of project being built
795
- *
796
- * @defaultValue "application"
797
- */
798
- type?: ProjectType;
799
- /**
800
- * The root directory of the project
801
- */
802
- root: string;
803
- /**
804
- * The root directory of the project's source code
805
- *
806
- * @defaultValue "\{root\}/src"
807
- */
808
- sourceRoot?: string;
809
- /**
810
- * A path to a custom configuration file to be used instead of the default `storm.json`, `powerlines.config.js`, or `powerlines.config.ts` files.
811
- *
812
- * @remarks
813
- * This option is useful for running Powerlines commands with different configuration files, such as in CI/CD environments or when testing different configurations.
814
- */
815
- configFile?: string;
816
- /**
817
- * Should the Powerlines CLI processes skip installing missing packages?
818
- *
819
- * @remarks
820
- * This option is useful for CI/CD environments where the installation of packages is handled by a different process.
821
- *
822
- * @defaultValue false
823
- */
824
- skipInstalls?: boolean;
825
- /**
826
- * Should the compiler processes skip any improvements that make use of cache?
827
- *
828
- * @defaultValue false
829
- */
830
- skipCache?: boolean;
831
- /**
832
- * A list of resolvable paths to plugins used during the build process
833
- */
834
- plugins?: PluginConfig<PluginContext<any>>[];
835
- /**
836
- * Environment-specific configurations
837
- */
838
- environments?: Record<string, EnvironmentConfig>;
839
- /**
840
- * A string identifier that allows a child framework or tool to identify itself when using Powerlines.
841
- *
842
- * @remarks
843
- * 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.
844
- *
845
- * @defaultValue "powerlines"
846
- */
847
- framework?: string;
848
- }
849
- interface UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> extends Omit<CommonUserConfig, "build"> {
850
- /**
851
- * Configuration provided to build processes
852
- *
853
- * @remarks
854
- * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
855
- */
856
- build: Omit<TBuildConfig, "override"> & {
857
- /**
858
- * The build variant being used by the Powerlines engine.
859
- */
860
- variant?: TBuildVariant;
861
- /**
862
- * An optional set of override options to apply to the selected build variant.
863
- *
864
- * @remarks
865
- * 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.
866
- */
867
- override?: Partial<TBuildResolvedConfig>;
868
- };
869
- }
870
- type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
871
- /**
872
- * The configuration provided while executing Powerlines commands.
873
- */
874
- type InlineConfig<TUserConfig extends UserConfig = UserConfig> = Partial<TUserConfig> & {
875
- /**
876
- * A string identifier for the Powerlines command being executed
877
- */
878
- command: PowerlinesCommand;
879
- };
880
-
881
- /**
882
- * The severity level of a {@link LogRecord}.
883
- */
884
- type LogLevel = "debug" | "info" | "warning" | "error" | "fatal";
885
- declare const LogLevel: {
886
- DEBUG: LogLevel;
887
- INFO: LogLevel;
888
- WARNING: LogLevel;
889
- ERROR: LogLevel;
890
- FATAL: LogLevel;
891
- };
892
- interface MetaInfo {
893
- /**
894
- * The checksum generated from the resolved options
895
- */
896
- checksum: string;
897
- /**
898
- * The build id
899
- */
900
- buildId: string;
901
- /**
902
- * The release id
903
- */
904
- releaseId: string;
905
- /**
906
- * The build timestamp
907
- */
908
- timestamp: number;
909
- /**
910
- * A hash that represents the path to the project root directory
911
- */
912
- projectRootHash: string;
913
- /**
914
- * A hash that represents the path to the project root directory
915
- */
916
- configHash: string;
917
- }
918
- interface Resolver extends Jiti {
919
- plugin: Jiti;
920
- }
921
- interface TransformResult {
922
- code: string;
923
- map: SourceMap | null;
924
- }
925
- interface InitContextOptions {
926
- /**
927
- * If false, the plugin will be loaded after all other plugins.
928
- *
929
- * @defaultValue true
930
- */
931
- isHighPriority: boolean;
932
- }
933
- interface FetchOptions extends FetchRequestOptions {
934
- /**
935
- * An indicator specifying that the request should bypass any caching
936
- */
937
- skipCache?: boolean;
938
- }
939
- interface ParseOptions extends ParserOptions {
940
- /**
941
- * When true this allows return statements to be outside functions to e.g. support parsing CommonJS code.
942
- */
943
- allowReturnOutsideFunction?: boolean;
944
- }
945
- /**
946
- * The unresolved Powerlines context.
947
- *
948
- * @remarks
949
- * This context is used before the user configuration has been fully resolved after the `config`.
950
- */
951
- interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
952
- /**
953
- * The Storm workspace configuration
954
- */
955
- workspaceConfig: WorkspaceConfig;
956
- /**
957
- * An object containing the options provided to Powerlines
958
- */
959
- config: Omit<TResolvedConfig["userConfig"], "build" | "output"> & Required<Pick<TResolvedConfig["userConfig"], "build" | "output">> & {
960
- projectRoot: NonUndefined<TResolvedConfig["userConfig"]["root"]>;
961
- sourceRoot: NonUndefined<TResolvedConfig["userConfig"]["sourceRoot"]>;
962
- output: TResolvedConfig["output"];
963
- };
964
- /**
965
- * A logging function for the Powerlines engine
966
- */
967
- log: LogFn;
968
- /**
969
- * A logging function for fatal messages
970
- */
971
- fatal: (message: string | UnpluginMessage) => void;
972
- /**
973
- * A logging function for error messages
974
- */
975
- error: (message: string | UnpluginMessage) => void;
976
- /**
977
- * A logging function for warning messages
978
- */
979
- warn: (message: string | UnpluginMessage) => void;
980
- /**
981
- * A logging function for informational messages
982
- */
983
- info: (message: string | UnpluginMessage) => void;
984
- /**
985
- * A logging function for debug messages
986
- */
987
- debug: (message: string | UnpluginMessage) => void;
988
- /**
989
- * A logging function for trace messages
990
- */
991
- trace: (message: string | UnpluginMessage) => void;
992
- /**
993
- * The metadata information
994
- */
995
- meta: MetaInfo;
996
- /**
997
- * The metadata information currently written to disk
998
- */
999
- persistedMeta?: MetaInfo;
1000
- /**
1001
- * The Powerlines artifacts directory
1002
- */
1003
- artifactsPath: string;
1004
- /**
1005
- * The path to the Powerlines builtin runtime modules directory
1006
- */
1007
- builtinsPath: string;
1008
- /**
1009
- * The path to the Powerlines entry modules directory
1010
- */
1011
- entryPath: string;
1012
- /**
1013
- * The path to the Powerlines TypeScript declaration files directory
1014
- */
1015
- dtsPath: string;
1016
- /**
1017
- * The path to a directory where the reflection data buffers (used by the build processes) are stored
1018
- */
1019
- dataPath: string;
1020
- /**
1021
- * The path to a directory where the project cache (used by the build processes) is stored
1022
- */
1023
- cachePath: string;
1024
- /**
1025
- * The Powerlines environment paths
1026
- */
1027
- envPaths: EnvPaths;
1028
- /**
1029
- * The file system path to the Powerlines package installation
1030
- */
1031
- powerlinesPath: string;
1032
- /**
1033
- * The relative path to the Powerlines workspace root directory
1034
- */
1035
- relativeToWorkspaceRoot: string;
1036
- /**
1037
- * The project's `package.json` file content
1038
- */
1039
- packageJson: PackageJson & Record<string, any>;
1040
- /**
1041
- * The project's `project.json` file content
1042
- */
1043
- projectJson?: Record<string, any>;
1044
- /**
1045
- * The dependency installations required by the project
1046
- */
1047
- dependencies: Record<string, string | Range>;
1048
- /**
1049
- * The development dependency installations required by the project
1050
- */
1051
- devDependencies: Record<string, string | Range>;
1052
- /**
1053
- * The parsed TypeScript configuration from the `tsconfig.json` file
1054
- */
1055
- tsconfig: ParsedTypeScriptConfig;
1056
- /**
1057
- * The entry points of the source code
1058
- */
1059
- entry: ResolvedEntryTypeDefinition[];
1060
- /**
1061
- * The virtual file system manager used during the build process to reference generated runtime files
1062
- */
1063
- fs: VirtualFileSystemInterface;
1064
- /**
1065
- * The Jiti module resolver
1066
- */
1067
- resolver: Resolver;
1068
- /**
1069
- * The builtin module id that exist in the Powerlines virtual file system
1070
- */
1071
- builtins: string[];
1072
- /**
1073
- * The {@link Project} instance used for type reflection and module manipulation
1074
- *
1075
- * @see https://ts-morph.com/
1076
- *
1077
- * @remarks
1078
- * This instance is created lazily on first access.
1079
- */
1080
- program: Project;
1081
- /**
1082
- * A function to perform HTTP fetch requests
1083
- *
1084
- * @remarks
1085
- * This function uses a caching layer to avoid duplicate requests during the Powerlines process.
1086
- *
1087
- * @example
1088
- * ```ts
1089
- * const response = await context.fetch("https://api.example.com/data");
1090
- * const data = await response.json();
1091
- * ```
1092
- *
1093
- * @see https://github.com/nodejs/undici
1094
- *
1095
- * @param input - The URL to fetch.
1096
- * @param options - The fetch request options.
1097
- * @returns A promise that resolves to a response returned by the fetch.
1098
- */
1099
- fetch: (input: RequestInfo, options?: FetchOptions) => Promise<Response>;
1100
- /**
1101
- * Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
1102
- *
1103
- * @remarks
1104
- * This function can be used to parse TypeScript code into an AST for further analysis or transformation.
1105
- *
1106
- * @example
1107
- * ```ts
1108
- * const ast = context.parse("const x: number = 42;");
1109
- * ```
1110
- *
1111
- * @see https://rollupjs.org/plugin-development/#this-parse
1112
- * @see https://github.com/oxc/oxc
1113
- *
1114
- * @param code - The source code to parse.
1115
- * @param options - The options to pass to the parser.
1116
- * @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
1117
- */
1118
- parse: (code: string, options?: ParseOptions) => Promise<ParseResult>;
1119
- /**
1120
- * A helper function to resolve modules using the Jiti resolver
1121
- *
1122
- * @remarks
1123
- * This function can be used to resolve modules relative to the project root directory.
1124
- *
1125
- * @example
1126
- * ```ts
1127
- * const resolvedPath = await context.resolve("some-module", "/path/to/importer");
1128
- * ```
1129
- *
1130
- * @param id - The module to resolve.
1131
- * @param importer - An optional path to the importer module.
1132
- * @param options - Additional resolution options.
1133
- * @returns A promise that resolves to the resolved module path.
1134
- */
1135
- resolve: (id: string, importer?: string, options?: ResolveOptions) => Promise<ExternalIdResult | undefined>;
1136
- /**
1137
- * A helper function to load modules using the Jiti resolver
1138
- *
1139
- * @remarks
1140
- * This function can be used to load modules relative to the project root directory.
1141
- *
1142
- * @example
1143
- * ```ts
1144
- * const module = await context.load("some-module", "/path/to/importer");
1145
- * ```
1146
- *
1147
- * @param id - The module to load.
1148
- * @returns A promise that resolves to the loaded module.
1149
- */
1150
- load: (id: string) => Promise<TransformResult | undefined>;
1151
- /**
1152
- * The Powerlines builtin virtual files
1153
- */
1154
- getBuiltins: () => Promise<VirtualFile[]>;
1155
- /**
1156
- * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
1157
- *
1158
- * @param code - The source code of the builtin file
1159
- * @param id - The unique identifier of the builtin file
1160
- * @param path - An optional path to write the builtin file to
1161
- */
1162
- emitBuiltin: (code: string, id: string, path?: string) => Promise<void>;
1163
- /**
1164
- * Resolves a entry virtual file and writes it to the VFS if it does not already exist
1165
- *
1166
- * @param code - The source code of the entry file
1167
- * @param path - An optional path to write the entry file to
1168
- */
1169
- emitEntry: (code: string, path: string) => Promise<void>;
1170
- /**
1171
- * A function to update the context fields using a new user configuration options
1172
- */
1173
- withUserConfig: (userConfig: UserConfig, options?: InitContextOptions) => Promise<void>;
1174
- /**
1175
- * A function to update the context fields using inline configuration options
1176
- */
1177
- withInlineConfig: (inlineConfig: InlineConfig, options?: InitContextOptions) => Promise<void>;
1178
- /**
1179
- * Create a new logger instance
1180
- *
1181
- * @param name - The name to use for the logger instance
1182
- * @returns A logger function
1183
- */
1184
- createLog: (name: string | null) => LogFn;
1185
- /**
1186
- * Extend the current logger instance with a new name
1187
- *
1188
- * @param name - The name to use for the extended logger instance
1189
- * @returns A logger function
1190
- */
1191
- extendLog: (name: string) => LogFn;
1192
- /**
1193
- * Generates a checksum representing the current context state
1194
- *
1195
- * @returns A promise that resolves to a string representing the checksum
1196
- */
1197
- generateChecksum: () => Promise<string>;
1198
- }
1199
- type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = Omit<UnresolvedContext<TResolvedConfig>, "config"> & {
1200
- /**
1201
- * The fully resolved Powerlines configuration
1202
- */
1203
- config: TResolvedConfig;
1204
- };
1205
- interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig>, UnpluginContext {
1206
- /**
1207
- * The environment specific resolved configuration
1208
- */
1209
- environment: EnvironmentResolvedConfig;
1210
- /**
1211
- * An alternative property name for the {@link log} property
1212
- *
1213
- * @remarks
1214
- * This is provided for compatibility with other logging libraries that expect a `logger` property.
1215
- */
1216
- logger: LogFn;
1217
- }
1218
- type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = UnpluginBuildContext & PluginContext<TResolvedConfig>;
1219
-
1220
- /**
1221
- * The base environment configuration used by Powerlines applications
1222
- *
1223
- * @remarks
1224
- * This interface is used to define the environment variables, configuration options, and runtime settings used by applications. It is used to provide type safety, autocompletion, and default values for the environment variables. The comments of each variable are used to provide documentation descriptions when running the \`powerlines docs\` command.
1225
- *
1226
- * @categoryDescription Platform
1227
- * The name of the platform the configuration parameter is intended for use in.
1228
- *
1229
- * @showCategories
1230
- */
1231
- interface EnvInterface {
1232
- /**
1233
- * The name of the application.
1234
- *
1235
- * @readonly
1236
- * @category neutral
1237
- */
1238
- readonly APP_NAME: string;
1239
- /**
1240
- * The version of the application.
1241
- *
1242
- * @defaultValue "1.0.0"
1243
- *
1244
- * @readonly
1245
- * @category neutral
1246
- */
1247
- readonly APP_VERSION: string;
1248
- /**
1249
- * The unique identifier for the build.
1250
- *
1251
- * @readonly
1252
- * @category neutral
1253
- */
1254
- readonly BUILD_ID: string;
1255
- /**
1256
- * The timestamp the build was ran at.
1257
- *
1258
- * @readonly
1259
- * @category neutral
1260
- */
1261
- readonly BUILD_TIMESTAMP: string;
1262
- /**
1263
- * A checksum hash created during the build.
1264
- *
1265
- * @readonly
1266
- * @category neutral
1267
- */
1268
- readonly BUILD_CHECKSUM: string;
1269
- /**
1270
- * The unique identifier for the release.
1271
- *
1272
- * @readonly
1273
- * @category neutral
1274
- */
1275
- readonly RELEASE_ID: string;
1276
- /**
1277
- * The tag for the release. This is generally in the format of "\<APP_NAME\>\@\<APP_VERSION\>".
1278
- *
1279
- * @readonly
1280
- * @category neutral
1281
- */
1282
- readonly RELEASE_TAG: string;
1283
- /**
1284
- * The name of the organization that maintains the application.
1285
- *
1286
- * @remarks
1287
- * This variable is used to specify the name of the organization that maintains the application. If not provided in an environment, it will try to use the value in {@link @storm-software/config-tools/StormWorkspaceConfig#organization}.
1288
- *
1289
- * @alias ORG
1290
- * @alias ORG_ID
1291
- * @category neutral
1292
- */
1293
- ORGANIZATION: string;
1294
- /**
1295
- * The platform for which the application was built.
1296
- *
1297
- * @defaultValue "neutral"
1298
- *
1299
- * @category neutral
1300
- */
1301
- PLATFORM: "node" | "neutral" | "browser";
1302
- /**
1303
- * The mode in which the application is running.
1304
- *
1305
- * @defaultValue "production"
1306
- *
1307
- * @alias NODE_ENV
1308
- *
1309
- * @category neutral
1310
- */
1311
- MODE: "development" | "test" | "production";
1312
- /**
1313
- * The environment the application is running in. This value will be populated with the value of `MODE` if not provided.
1314
- *
1315
- * @defaultValue "production"
1316
- *
1317
- * @alias ENV
1318
- * @alias VERCEL_ENV
1319
- * @category neutral
1320
- */
1321
- ENVIRONMENT: string;
1322
- /**
1323
- * Indicates if the application is running in debug mode.
1324
- *
1325
- * @category neutral
1326
- */
1327
- DEBUG: boolean;
1328
- /**
1329
- * An indicator that specifies the current runtime is a test environment.
1330
- *
1331
- * @category neutral
1332
- */
1333
- TEST: boolean;
1334
- /**
1335
- * An indicator that specifies the current runtime is a minimal environment.
1336
- *
1337
- * @category node
1338
- */
1339
- MINIMAL: boolean;
1340
- /**
1341
- * An indicator that specifies the current runtime is a no color environment.
1342
- *
1343
- * @category node
1344
- */
1345
- NO_COLOR: boolean;
1346
- /**
1347
- * An indicator that specifies the current runtime is a force color environment.
1348
- *
1349
- * @category node
1350
- */
1351
- FORCE_COLOR: boolean | number;
1352
- /**
1353
- * An indicator that specifies the current runtime should force hyperlinks in terminal output.
1354
- *
1355
- * @remarks
1356
- * This variable is used to force hyperlinks in terminal output, even if the terminal does not support them. This is useful for debugging and development purposes.
1357
-
1358
- * @category node
1359
- */
1360
- FORCE_HYPERLINK: boolean | number;
1361
- /**
1362
- * The name of the agent running the application. This variable is set by certain CI/CD systems.
1363
- *
1364
- * @readonly
1365
- * @category neutral
1366
- */
1367
- readonly AGENT_NAME?: string;
1368
- /**
1369
- * The color terminal type. This variable is set by certain terminal emulators.
1370
- *
1371
- * @readonly
1372
- * @category node
1373
- */
1374
- readonly COLORTERM?: string;
1375
- /**
1376
- * The terminal type. This variable is set by certain CI/CD systems.
1377
- *
1378
- * @remarks
1379
- * This variable is used to specify the terminal type that the application is running in. It can be used to determine how to format output for the terminal.
1380
- *
1381
- * @readonly
1382
- * @category node
1383
- */
1384
- readonly TERM?: string;
1385
- /**
1386
- * The terminal program name. This variable is set by certain terminal emulators.
1387
- *
1388
- * @readonly
1389
- * @category node
1390
- */
1391
- readonly TERM_PROGRAM?: string;
1392
- /**
1393
- * The terminal program version. This variable is set by certain terminal emulators.
1394
- *
1395
- * @readonly
1396
- * @category node
1397
- */
1398
- readonly TERM_PROGRAM_VERSION?: string;
1399
- /**
1400
- * The terminal emulator name. This variable is set by certain terminal emulators.
1401
- *
1402
- * @readonly
1403
- * @category node
1404
- */
1405
- readonly TERMINAL_EMULATOR?: string;
1406
- /**
1407
- * The terminal emulator session ID. This variable is set by certain terminal emulators.
1408
- *
1409
- * @readonly
1410
- * @category node
1411
- */
1412
- readonly WT_SESSION?: string;
1413
- /**
1414
- * An indicator that specifies the current terminal is running Terminus Sublime. This variable is set by certain terminal emulators.
1415
- *
1416
- * @readonly
1417
- * @category node
1418
- */
1419
- readonly TERMINUS_SUBLIME?: boolean;
1420
- /**
1421
- * The ConEmu task name. This variable is set by certain terminal emulators.
1422
- *
1423
- * @readonly
1424
- * @category node
1425
- */
1426
- readonly ConEmuTask?: string;
1427
- /**
1428
- * The cursor trace ID. This variable is set by certain terminal emulators.
1429
- *
1430
- * @readonly
1431
- * @category node
1432
- */
1433
- readonly CURSOR_TRACE_ID?: string;
1434
- /**
1435
- * The VTE version. This variable is set by certain terminal emulators.
1436
- *
1437
- * @readonly
1438
- * @category node
1439
- */
1440
- readonly VTE_VERSION?: string;
1441
- /**
1442
- * Indicates if error stack traces should be captured.
1443
- *
1444
- * @category neutral
1445
- */
1446
- STACKTRACE: boolean;
1447
- /**
1448
- * Indicates if error data should be included.
1449
- *
1450
- * @category neutral
1451
- */
1452
- INCLUDE_ERROR_DATA: boolean;
1453
- /**
1454
- * A web page to lookup error messages and display additional information given an error code.
1455
- *
1456
- * @remarks
1457
- * This variable is used to provide a URL to a page that can be used to look up error messages given an error code. This is used to provide a more user-friendly error message to the user.
1458
- *
1459
- * @title Error Details URL
1460
- * @category neutral
1461
- */
1462
- ERROR_URL: string;
1463
- /**
1464
- * The default timezone for the application.
1465
- *
1466
- * @defaultValue "America/New_York"
1467
- * @category neutral
1468
- */
1469
- DEFAULT_TIMEZONE: string;
1470
- /**
1471
- * The default locale to be used in the application.
1472
- *
1473
- * @defaultValue "en_US"
1474
- * @category neutral
1475
- */
1476
- DEFAULT_LOCALE: string;
1477
- /**
1478
- * The default lowest log level to accept. If `null`, the logger will reject all records. This value only applies if `lowestLogLevel` is not provided to the `logs` configuration.
1479
- *
1480
- * @defaultValue "info"
1481
- *
1482
- * @category neutral
1483
- */
1484
- LOG_LEVEL?: LogLevel | null;
1485
- /**
1486
- * An indicator that specifies the current runtime is a continuous integration environment.
1487
- *
1488
- * @title Continuous Integration
1489
- * @alias CONTINUOUS_INTEGRATION
1490
- * @category neutral
1491
- */
1492
- CI: boolean;
1493
- /**
1494
- * The unique identifier for the current run. This value is set by certain CI/CD systems.
1495
- *
1496
- * @readonly
1497
- * @category node
1498
- */
1499
- readonly RUN_ID?: string;
1500
- /**
1501
- * The agola git reference. This value is set by certain CI/CD systems.
1502
- *
1503
- * @readonly
1504
- * @category node
1505
- */
1506
- readonly AGOLA_GIT_REF?: string;
1507
- /**
1508
- * The appcircle build ID. This value is set by certain CI/CD systems.
1509
- *
1510
- * @readonly
1511
- * @category node
1512
- */
1513
- readonly AC_APPCIRCLE?: string;
1514
- /**
1515
- * The appveyor build ID. This value is set by certain CI/CD systems.
1516
- *
1517
- * @readonly
1518
- * @category node
1519
- */
1520
- readonly APPVEYOR?: string;
1521
- /**
1522
- * The codebuild build ID. This value is set by certain CI/CD systems.
1523
- *
1524
- * @readonly
1525
- * @category node
1526
- */
1527
- readonly CODEBUILD?: string;
1528
- /**
1529
- * The task force build ID. This value is set by certain CI/CD systems.
1530
- *
1531
- * @readonly
1532
- * @category node
1533
- */
1534
- readonly TF_BUILD?: string;
1535
- /**
1536
- * The bamboo plan key. This value is set by certain CI/CD systems.
1537
- *
1538
- * @readonly
1539
- * @category node
1540
- */
1541
- readonly bamboo_planKey?: string;
1542
- /**
1543
- * The bitbucket commit. This value is set by certain CI/CD systems.
1544
- *
1545
- * @readonly
1546
- * @category node
1547
- */
1548
- readonly BITBUCKET_COMMIT?: string;
1549
- /**
1550
- * The bitrise build ID. This value is set by certain CI/CD systems.
1551
- *
1552
- * @readonly
1553
- * @category node
1554
- */
1555
- readonly BITRISE_IO?: string;
1556
- /**
1557
- * The buddy workspace ID. This value is set by certain CI/CD systems.
1558
- *
1559
- * @readonly
1560
- * @category node
1561
- */
1562
- readonly BUDDY_WORKSPACE_ID?: string;
1563
- /**
1564
- * The buildkite build ID. This value is set by certain CI/CD systems.
1565
- *
1566
- * @readonly
1567
- * @category node
1568
- */
1569
- readonly BUILDKITE?: string;
1570
- /**
1571
- * The circleci build ID. This value is set by certain CI/CD systems.
1572
- *
1573
- * @readonly
1574
- * @category node
1575
- */
1576
- readonly CIRCLECI?: string;
1577
- /**
1578
- * The cirrus-ci build ID. This value is set by certain CI/CD systems.
1579
- *
1580
- * @readonly
1581
- * @category node
1582
- */
1583
- readonly CIRRUS_CI?: string;
1584
- /**
1585
- * The cf build ID. This value is set by certain CI/CD systems.
1586
- *
1587
- * @readonly
1588
- * @category node
1589
- */
1590
- readonly CF_BUILD_ID?: string;
1591
- /**
1592
- * The cm build ID. This value is set by certain CI/CD systems.
1593
- *
1594
- * @readonly
1595
- * @category node
1596
- */
1597
- readonly CM_BUILD_ID?: string;
1598
- /**
1599
- * The ci name. This value is set by certain CI/CD systems.
1600
- *
1601
- * @readonly
1602
- * @category node
1603
- */
1604
- readonly CI_NAME?: string;
1605
- /**
1606
- * The drone build ID. This value is set by certain CI/CD systems.
1607
- *
1608
- * @readonly
1609
- * @category node
1610
- */
1611
- readonly DRONE?: string;
1612
- /**
1613
- * The dsari build ID. This value is set by certain CI/CD systems.
1614
- *
1615
- * @readonly
1616
- * @category node
1617
- */
1618
- readonly DSARI?: string;
1619
- /**
1620
- * The earthly build ID. This value is set by certain CI/CD systems.
1621
- *
1622
- * @readonly
1623
- * @category node
1624
- */
1625
- readonly EARTHLY_CI?: string;
1626
- /**
1627
- * The eas build ID. This value is set by certain CI/CD systems.
1628
- *
1629
- * @readonly
1630
- * @category node
1631
- */
1632
- readonly EAS_BUILD?: string;
1633
- /**
1634
- * The gerrit project. This value is set by certain CI/CD systems.
1635
- *
1636
- * @readonly
1637
- * @category node
1638
- */
1639
- readonly GERRIT_PROJECT?: string;
1640
- /**
1641
- * The gitea actions build ID. This value is set by certain CI/CD systems.
1642
- *
1643
- * @readonly
1644
- * @category node
1645
- */
1646
- readonly GITEA_ACTIONS?: string;
1647
- /**
1648
- * The github actions build ID. This value is set by certain CI/CD systems.
1649
- *
1650
- * @readonly
1651
- * @category node
1652
- */
1653
- readonly GITHUB_ACTIONS?: string;
1654
- /**
1655
- * The gitlab ci build ID. This value is set by certain CI/CD systems.
1656
- *
1657
- * @readonly
1658
- * @category node
1659
- */
1660
- readonly GITLAB_CI?: string;
1661
- /**
1662
- * The go cd build ID. This value is set by certain CI/CD systems.
1663
- *
1664
- * @readonly
1665
- * @category node
1666
- */
1667
- readonly GOCD?: string;
1668
- /**
1669
- * The builder output build ID. This value is set by certain CI/CD systems.
1670
- *
1671
- * @readonly
1672
- * @category node
1673
- */
1674
- readonly BUILDER_OUTPUT?: string;
1675
- /**
1676
- * The harness build ID. This value is set by certain CI/CD systems.
1677
- *
1678
- * @readonly
1679
- * @category node
1680
- */
1681
- readonly HARNESS_BUILD_ID?: string;
1682
- /**
1683
- * The jenkins url. This value is set by certain CI/CD systems.
1684
- *
1685
- * @readonly
1686
- * @category node
1687
- */
1688
- readonly JENKINS_URL?: string;
1689
- /**
1690
- * The layerci build ID. This value is set by certain CI/CD systems.
1691
- *
1692
- * @readonly
1693
- * @category node
1694
- */
1695
- readonly LAYERCI?: string;
1696
- /**
1697
- * The magnum build ID. This value is set by certain CI/CD systems.
1698
- *
1699
- * @readonly
1700
- * @category node
1701
- */
1702
- readonly MAGNUM?: string;
1703
- /**
1704
- * The netlify build ID. This value is set by certain CI/CD systems.
1705
- *
1706
- * @readonly
1707
- * @category node
1708
- */
1709
- readonly NETLIFY?: string;
1710
- /**
1711
- * The nevercode build ID. This value is set by certain CI/CD systems.
1712
- *
1713
- * @readonly
1714
- * @category node
1715
- */
1716
- readonly NEVERCODE?: string;
1717
- /**
1718
- * The prow job ID. This value is set by certain CI/CD systems.
1719
- *
1720
- * @readonly
1721
- * @category node
1722
- */
1723
- readonly PROW_JOB_ID?: string;
1724
- /**
1725
- * The release build ID. This value is set by certain CI/CD systems.
1726
- *
1727
- * @readonly
1728
- * @category node
1729
- */
1730
- readonly RELEASE_BUILD_ID?: string;
1731
- /**
1732
- * The render build ID. This value is set by certain CI/CD systems.
1733
- *
1734
- * @readonly
1735
- * @category node
1736
- */
1737
- readonly RENDER?: string;
1738
- /**
1739
- * The sailci build ID. This value is set by certain CI/CD systems.
1740
- *
1741
- * @readonly
1742
- * @category node
1743
- */
1744
- readonly SAILCI?: string;
1745
- /**
1746
- * The hudson build ID. This value is set by certain CI/CD systems.
1747
- *
1748
- * @readonly
1749
- * @category node
1750
- */
1751
- readonly HUDSON?: string;
1752
- /**
1753
- * The screwdriver build ID. This value is set by certain CI/CD systems.
1754
- *
1755
- * @readonly
1756
- * @category node
1757
- */
1758
- readonly SCREWDRIVER?: string;
1759
- /**
1760
- * The semaphore build ID. This value is set by certain CI/CD systems.
1761
- *
1762
- * @readonly
1763
- * @category node
1764
- */
1765
- readonly SEMAPHORE?: string;
1766
- /**
1767
- * The sourcehut build ID. This value is set by certain CI/CD systems.
1768
- *
1769
- * @readonly
1770
- * @category node
1771
- */
1772
- readonly SOURCEHUT?: string;
1773
- /**
1774
- * The spaceship build ID. This value is set by certain CI/CD systems.
1775
- *
1776
- * @readonly
1777
- * @category node
1778
- */
1779
- readonly SPACESHIP_CI?: string;
1780
- /**
1781
- * The strider build ID. This value is set by certain CI/CD systems.
1782
- *
1783
- * @readonly
1784
- * @category node
1785
- */
1786
- readonly STRIDER?: string;
1787
- /**
1788
- * The task ID. This value is set by certain CI/CD systems.
1789
- *
1790
- * @readonly
1791
- * @category node
1792
- */
1793
- readonly TASK_ID?: string;
1794
- /**
1795
- * The teamcity version. This value is set by certain CI/CD systems.
1796
- *
1797
- * @readonly
1798
- * @category node
1799
- */
1800
- readonly TEAMCITY_VERSION?: string;
1801
- /**
1802
- * The travis build ID. This value is set by certain CI/CD systems.
1803
- *
1804
- * @readonly
1805
- * @category node
1806
- */
1807
- readonly TRAVIS?: string;
1808
- /**
1809
- * The vela build ID. This value is set by certain CI/CD systems.
1810
- *
1811
- * @readonly
1812
- * @category node
1813
- */
1814
- readonly VELA?: string;
1815
- /**
1816
- * The now builder build ID. This value is set by certain CI/CD systems.
1817
- *
1818
- * @readonly
1819
- * @category node
1820
- */
1821
- readonly NOW_BUILDER?: string;
1822
- /**
1823
- * The appcenter build ID. This value is set by certain CI/CD systems.
1824
- *
1825
- * @readonly
1826
- * @category node
1827
- */
1828
- readonly APPCENTER_BUILD_ID?: string;
1829
- /**
1830
- * The xcode project build ID. This value is set by certain CI/CD systems.
1831
- *
1832
- * @readonly
1833
- * @category node
1834
- */
1835
- readonly CI_XCODE_PROJECT?: string;
1836
- /**
1837
- * The xcode server build ID. This value is set by certain CI/CD systems.
1838
- *
1839
- * @readonly
1840
- * @category node
1841
- */
1842
- readonly XCS?: string;
1843
- /**
1844
- * The application's runtime data directory.
1845
- *
1846
- * @remarks
1847
- * This variable is used to override the base path of the system's local application data directory. This variable is used to set the \`$storm.paths.data\` property.
1848
- *
1849
- * @title Data Directory
1850
- * @category node
1851
- */
1852
- DATA_DIR?: string;
1853
- /**
1854
- * The application's configuration data directory.
1855
- *
1856
- * @remarks
1857
- * This variable is used to override the base path of the system's local application configuration directory. This variable is used to set the \`$storm.paths.config\` property.
1858
- *
1859
- * @title Configuration Directory
1860
- * @category node
1861
- */
1862
- CONFIG_DIR?: string;
1863
- /**
1864
- * The application's cached data directory.
1865
- *
1866
- * @remarks
1867
- * This variable is used to override the base path of the system's local cache data directory. This variable is used to set the \`$storm.paths.cache\` property.
1868
- *
1869
- * @title Cache Directory
1870
- * @category node
1871
- */
1872
- CACHE_DIR?: string;
1873
- /**
1874
- * The application's logging directory.
1875
- *
1876
- * @remarks
1877
- * This variable is used to override the base path of the system's local application log directory. This variable is used to set the \`$storm.paths.log\` property.
1878
- *
1879
- * @title Log Directory
1880
- * @category node
1881
- */
1882
- LOG_DIR?: string;
1883
- /**
1884
- * The application's temporary data directory.
1885
- *
1886
- * @remarks
1887
- * This variable is used to override the base path of the system's local temporary data directory. This variable is used to set the \`$storm.paths.temp\` property.
1888
- *
1889
- * @title Temporary Directory
1890
- * @category node
1891
- */
1892
- TEMP_DIR?: string;
1893
- /**
1894
- * A variable that specifies the current user's local application data directory on Windows.
1895
- *
1896
- * @see https://www.advancedinstaller.com/appdata-localappdata-programdata.html
1897
- *
1898
- * @remarks
1899
- * This variable is used to specify a path to application data that is specific to the current user. This variable can be used to set the \`$storm.paths.data\`, \`$storm.paths.cache\`, and \`$storm.paths.log\` properties.
1900
- *
1901
- * @readonly
1902
- * @category node
1903
- */
1904
- readonly LOCALAPPDATA?: string;
1905
- /**
1906
- * A variable that specifies the application data directory on Windows.
1907
- *
1908
- * @see https://www.advancedinstaller.com/appdata-localappdata-programdata.html
1909
- *
1910
- * @remarks
1911
- * This variable is used to specify a path to application data that is specific to the current user. This variable can be used to set the \`$storm.paths.config\` property.
1912
- *
1913
- * @readonly
1914
- * @category node
1915
- */
1916
- readonly APPDATA?: string;
1917
- /**
1918
- * A variable that specifies the data path in the home directory on Linux systems using the XDG base directory specification.
1919
- *
1920
- * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c
1921
- *
1922
- * @remarks
1923
- * This variable is used to specify a path to application data that is specific to the current user. This variable can be used to set the \`$storm.paths.data\` property.
1924
- *
1925
- * @readonly
1926
- * @category node
1927
- */
1928
- readonly XDG_DATA_HOME?: string;
1929
- /**
1930
- * A variable that specifies the configuration path in the home directory on Linux systems using the XDG base directory specification.
1931
- *
1932
- * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c
1933
- *
1934
- * @remarks
1935
- * This variable is used to specify a path to configuration data that is specific to the current user. This variable can be used to set the \`$storm.paths.config\` property.
1936
- *
1937
- * @readonly
1938
- * @category node
1939
- */
1940
- readonly XDG_CONFIG_HOME?: string;
1941
- /**
1942
- * A variable that specifies the cache path in the home directory on Linux systems using the XDG base directory specification.
1943
- *
1944
- * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c
1945
- *
1946
- * @remarks
1947
- * This variable is used to specify a path to cache data that is specific to the current user. This variable can be used to set the \`$storm.paths.cache\` property.
1948
- *
1949
- * @readonly
1950
- * @category node
1951
- */
1952
- readonly XDG_CACHE_HOME?: string;
1953
- /**
1954
- * A variable that specifies the state directory on Linux systems using the XDG base directory specification.
1955
- *
1956
- * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c
1957
- *
1958
- * @remarks
1959
- * This variable is used to specify a path to application state data that is specific to the current user. This variable can be used to set the \`$storm.paths.state\` property.
1960
- *
1961
- * @readonly
1962
- * @category node
1963
- */
1964
- readonly XDG_STATE_HOME?: string;
1965
- /**
1966
- * A variable that specifies the runtime directory on Linux systems using the XDG base directory specification.
1967
- *
1968
- * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c
1969
- *
1970
- * @remarks
1971
- * This variable is used to specify a path to runtime data that is specific to the current user. This variable can be used to set the \`$storm.paths.temp\` property.
1972
- *
1973
- * @readonly
1974
- * @category node
1975
- */
1976
- readonly XDG_RUNTIME_DIR?: string;
1977
- /**
1978
- * A variable that specifies the [Devenv](https://devenv.sh/) runtime directory.
1979
- *
1980
- * @see https://devenv.sh/files-and-variables/#devenv_dotfile
1981
- * @see https://nixos.org/
1982
- *
1983
- * @remarks
1984
- * This variable is used to specify a path to application data that is specific to the current [Nix](https://nixos.org/) environment. This variable can be used to set the \`$storm.paths.temp\` property.
1985
- *
1986
- * @category node
1987
- */
1988
- DEVENV_RUNTIME?: string;
1989
- }
1990
- /**
1991
- * The base secrets configuration used by Powerlines applications
1992
- *
1993
- * @remarks
1994
- * This interface is used to define the secret configuration options used by Powerlines applications. It is used to provide type safety, autocompletion, and default values for the environment variables. The comments of each variable are used to provide documentation descriptions when running the \`storm docs\` command. Since these are secrets, no default values should be provided and the values should be kept confidential (excluded from the client).
1995
- */
1996
- interface SecretsInterface {
1997
- /**
1998
- * The secret key used for encryption and decryption.
1999
- *
2000
- * @remarks
2001
- * This variable is used to provide a secret key for encryption and decryption of sensitive data. It is important that this value is kept confidential and not exposed in client-side code or public repositories.
2002
- *
2003
- * @title Encryption Key
2004
- */
2005
- ENCRYPTION_KEY: string;
2006
- }
2007
-
2008
- export type { BabelUserConfig as B, EnvInterface as E, PluginContext as P, ResolvedConfig as R, SecretsInterface as S, UserConfig as U, Plugin as a, BabelResolvedConfig as b };