@powerlines/plugin-react 0.1.0

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