@powerlines/plugin-env 0.13.4 → 0.13.6

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