@powerlines/plugin-env 0.13.15 → 0.13.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel/index.d.cts +3 -5
- package/dist/babel/index.d.ts +3 -5
- package/dist/babel/plugin.d.cts +3 -5
- package/dist/babel/plugin.d.ts +3 -5
- package/dist/components/env.d.cts +1 -3
- package/dist/components/env.d.ts +1 -3
- package/dist/components/index.d.cts +1 -3
- package/dist/components/index.d.ts +1 -3
- package/dist/helpers/index.d.cts +3 -5
- package/dist/helpers/index.d.ts +3 -5
- package/dist/helpers/load.d.cts +4 -6
- package/dist/helpers/load.d.ts +4 -6
- package/dist/helpers/persistence.cjs +1 -1
- package/dist/helpers/persistence.d.cts +6 -8
- package/dist/helpers/persistence.d.ts +6 -8
- package/dist/helpers/persistence.js +1 -1
- package/dist/helpers/reflect.d.cts +3 -5
- package/dist/helpers/reflect.d.ts +3 -5
- package/dist/helpers/template-helpers.d.cts +3 -5
- package/dist/helpers/template-helpers.d.ts +3 -5
- package/dist/index.d.cts +4 -6
- package/dist/index.d.ts +4 -6
- package/dist/{runtime-BRVCxO4z.d.cts → runtime-BZR8Re97.d.ts} +166 -64
- package/dist/{runtime-nCpMYmRi.d.ts → runtime-CXFOdIeH.d.cts} +166 -64
- package/dist/types/index.d.cts +3 -5
- package/dist/types/index.d.ts +3 -5
- package/dist/types/plugin.d.cts +3 -5
- package/dist/types/plugin.d.ts +3 -5
- package/dist/types/runtime.d.cts +3 -5
- package/dist/types/runtime.d.ts +3 -5
- package/dist/{vfs-Bl84Hw2V.d.cts → vfs-BGmsy47f.d.cts} +36 -52
- package/dist/{vfs-Bl84Hw2V.d.ts → vfs-BGmsy47f.d.ts} +36 -52
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PluginContext, b as Plugin } from './runtime-
|
|
2
|
-
export { E as EnvInterface, S as SecretsInterface } from './runtime-
|
|
1
|
+
import { P as PluginContext, b as Plugin } from './runtime-CXFOdIeH.cjs';
|
|
2
|
+
export { E as EnvInterface, S as SecretsInterface } from './runtime-CXFOdIeH.cjs';
|
|
3
3
|
import { Children } from '@alloy-js/core/jsx-runtime';
|
|
4
4
|
import { PrintTreeOptions } from '@alloy-js/core';
|
|
5
5
|
import { EnvPluginContext, EnvPluginResolvedConfig } from './types/plugin.cjs';
|
|
@@ -12,6 +12,7 @@ export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, createEnvReflection,
|
|
|
12
12
|
export { formatEnvField, removeEnvPrefix } from './helpers/source-file-env.cjs';
|
|
13
13
|
export { createTemplateReflection } from './helpers/template-helpers.cjs';
|
|
14
14
|
import '@stryke/env/get-env-paths';
|
|
15
|
+
import '@stryke/types/base';
|
|
15
16
|
import '@stryke/types/package-json';
|
|
16
17
|
import 'jiti';
|
|
17
18
|
import 'oxc-parser';
|
|
@@ -21,7 +22,6 @@ import '@babel/core';
|
|
|
21
22
|
import '@storm-software/build-tools/types';
|
|
22
23
|
import '@storm-software/config-tools/types';
|
|
23
24
|
import '@storm-software/config/types';
|
|
24
|
-
import '@stryke/types/base';
|
|
25
25
|
import '@stryke/types/configuration';
|
|
26
26
|
import '@stryke/types/file';
|
|
27
27
|
import 'vite';
|
|
@@ -29,11 +29,9 @@ import '@babel/helper-plugin-utils';
|
|
|
29
29
|
import '@stryke/types/array';
|
|
30
30
|
import '@stryke/types/tsconfig';
|
|
31
31
|
import 'typescript';
|
|
32
|
-
import './vfs-
|
|
32
|
+
import './vfs-BGmsy47f.cjs';
|
|
33
33
|
import '@stryke/json/types';
|
|
34
|
-
import 'memfs';
|
|
35
34
|
import 'node:fs';
|
|
36
|
-
import 'unionfs';
|
|
37
35
|
import '@deepkit/type';
|
|
38
36
|
import '@stryke/capnp';
|
|
39
37
|
import '@stryke/env/types';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PluginContext, b as Plugin } from './runtime-
|
|
2
|
-
export { E as EnvInterface, S as SecretsInterface } from './runtime-
|
|
1
|
+
import { P as PluginContext, b as Plugin } from './runtime-BZR8Re97.js';
|
|
2
|
+
export { E as EnvInterface, S as SecretsInterface } from './runtime-BZR8Re97.js';
|
|
3
3
|
import { Children } from '@alloy-js/core/jsx-runtime';
|
|
4
4
|
import { PrintTreeOptions } from '@alloy-js/core';
|
|
5
5
|
import { EnvPluginContext, EnvPluginResolvedConfig } from './types/plugin.js';
|
|
@@ -12,6 +12,7 @@ export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, createEnvReflection,
|
|
|
12
12
|
export { formatEnvField, removeEnvPrefix } from './helpers/source-file-env.js';
|
|
13
13
|
export { createTemplateReflection } from './helpers/template-helpers.js';
|
|
14
14
|
import '@stryke/env/get-env-paths';
|
|
15
|
+
import '@stryke/types/base';
|
|
15
16
|
import '@stryke/types/package-json';
|
|
16
17
|
import 'jiti';
|
|
17
18
|
import 'oxc-parser';
|
|
@@ -21,7 +22,6 @@ import '@babel/core';
|
|
|
21
22
|
import '@storm-software/build-tools/types';
|
|
22
23
|
import '@storm-software/config-tools/types';
|
|
23
24
|
import '@storm-software/config/types';
|
|
24
|
-
import '@stryke/types/base';
|
|
25
25
|
import '@stryke/types/configuration';
|
|
26
26
|
import '@stryke/types/file';
|
|
27
27
|
import 'vite';
|
|
@@ -29,11 +29,9 @@ import '@babel/helper-plugin-utils';
|
|
|
29
29
|
import '@stryke/types/array';
|
|
30
30
|
import '@stryke/types/tsconfig';
|
|
31
31
|
import 'typescript';
|
|
32
|
-
import './vfs-
|
|
32
|
+
import './vfs-BGmsy47f.js';
|
|
33
33
|
import '@stryke/json/types';
|
|
34
|
-
import 'memfs';
|
|
35
34
|
import 'node:fs';
|
|
36
|
-
import 'unionfs';
|
|
37
35
|
import '@deepkit/type';
|
|
38
36
|
import '@stryke/capnp';
|
|
39
37
|
import '@stryke/env/types';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { EnvPaths } from '@stryke/env/get-env-paths';
|
|
2
|
+
import { NonUndefined, MaybePromise, FunctionLike } from '@stryke/types/base';
|
|
2
3
|
import { PackageJson } from '@stryke/types/package-json';
|
|
3
4
|
import { Jiti } from 'jiti';
|
|
4
5
|
import { ParserOptions, ParseResult } from 'oxc-parser';
|
|
5
6
|
import { Range } from 'semver';
|
|
6
|
-
import { TransformResult, ExternalIdResult, HookFilter, UnpluginOptions, UnpluginContext,
|
|
7
|
+
import { TransformResult, ExternalIdResult, HookFilter, UnpluginOptions, UnpluginContext, UnpluginMessage, UnpluginBuildContext } from 'unplugin';
|
|
7
8
|
import { PluginItem, PluginObj, PluginPass, transformAsync } from '@babel/core';
|
|
8
9
|
import { Format } from '@storm-software/build-tools/types';
|
|
9
10
|
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
10
11
|
import { StormWorkspaceConfig } from '@storm-software/config/types';
|
|
11
|
-
import { NonUndefined, MaybePromise, FunctionLike } from '@stryke/types/base';
|
|
12
12
|
import { TypeDefinition, TypeDefinitionParameter } from '@stryke/types/configuration';
|
|
13
13
|
import { AssetGlob } from '@stryke/types/file';
|
|
14
14
|
import { ResolvedPreviewOptions, PreviewOptions } from 'vite';
|
|
@@ -16,7 +16,7 @@ import { BabelAPI } from '@babel/helper-plugin-utils';
|
|
|
16
16
|
import { ArrayValues } from '@stryke/types/array';
|
|
17
17
|
import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
|
|
18
18
|
import ts from 'typescript';
|
|
19
|
-
import { O as OutputModeType, V as VirtualFileSystemInterface, a as VirtualFile, P as PowerlinesWriteFileOptions } from './vfs-
|
|
19
|
+
import { O as OutputModeType, V as VirtualFileSystemInterface, a as VirtualFile, P as PowerlinesWriteFileOptions } from './vfs-BGmsy47f.js';
|
|
20
20
|
|
|
21
21
|
type BabelPluginPass<TState = unknown> = PluginPass & TState;
|
|
22
22
|
type BabelTransformPluginFilter = (code: string, id: string) => boolean;
|
|
@@ -45,6 +45,87 @@ interface BuildConfig {
|
|
|
45
45
|
* @defaultValue "neutral"
|
|
46
46
|
*/
|
|
47
47
|
platform?: "node" | "browser" | "neutral";
|
|
48
|
+
/**
|
|
49
|
+
* Array of strings indicating the polyfills to include for the build.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* {
|
|
57
|
+
* polyfill: ['{projectRoot}/custom-polyfill.ts']
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
polyfill?: string[];
|
|
62
|
+
/**
|
|
63
|
+
* 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.
|
|
64
|
+
*
|
|
65
|
+
* @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
|
|
66
|
+
*/
|
|
67
|
+
mainFields?: string[];
|
|
68
|
+
/**
|
|
69
|
+
* Array of strings indicating what conditions should be used for module resolution.
|
|
70
|
+
*/
|
|
71
|
+
conditions?: string[];
|
|
72
|
+
/**
|
|
73
|
+
* Array of strings indicating what file extensions should be used for module resolution.
|
|
74
|
+
*
|
|
75
|
+
* @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
|
|
76
|
+
*/
|
|
77
|
+
extensions?: string[];
|
|
78
|
+
/**
|
|
79
|
+
* Array of strings indicating what modules should be deduplicated to a single version in the build.
|
|
80
|
+
*
|
|
81
|
+
* @remarks
|
|
82
|
+
* 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.
|
|
83
|
+
*/
|
|
84
|
+
dedupe?: string[];
|
|
85
|
+
/**
|
|
86
|
+
* Array of strings or regular expressions that indicate what modules are builtin for the environment.
|
|
87
|
+
*/
|
|
88
|
+
builtins?: (string | RegExp)[];
|
|
89
|
+
/**
|
|
90
|
+
* Define global variable replacements.
|
|
91
|
+
*
|
|
92
|
+
* @remarks
|
|
93
|
+
* This option allows you to specify global constants that will be replaced in the code during the build process. It is similar to the `define` option in esbuild and Vite, enabling you to replace specific identifiers with constant expressions at build time.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* {
|
|
98
|
+
* define: {
|
|
99
|
+
* __VERSION__: '"1.0.0"',
|
|
100
|
+
* __DEV__: 'process.env.NODE_ENV !== "production"'
|
|
101
|
+
* }
|
|
102
|
+
* }
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* @see https://esbuild.github.io/api/#define
|
|
106
|
+
* @see https://vitejs.dev/config/build-options.html#define
|
|
107
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/replace
|
|
108
|
+
*/
|
|
109
|
+
define?: Record<string, any>;
|
|
110
|
+
/**
|
|
111
|
+
* Global variables that will have import statements injected where necessary
|
|
112
|
+
*
|
|
113
|
+
* @remarks
|
|
114
|
+
* This option allows you to specify global variables that should be automatically imported from specified modules whenever they are used in the code. This is particularly useful for polyfilling Node.js globals in a browser environment.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* {
|
|
119
|
+
* inject: {
|
|
120
|
+
* process: 'process/browser',
|
|
121
|
+
* Buffer: ['buffer', 'Buffer'],
|
|
122
|
+
* }
|
|
123
|
+
* }
|
|
124
|
+
* ```
|
|
125
|
+
*
|
|
126
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/inject
|
|
127
|
+
*/
|
|
128
|
+
inject?: Record<string, string | string[]>;
|
|
48
129
|
/**
|
|
49
130
|
* The alias mappings to use for module resolution during the build process.
|
|
50
131
|
*
|
|
@@ -60,8 +141,13 @@ interface BuildConfig {
|
|
|
60
141
|
* }
|
|
61
142
|
* }
|
|
62
143
|
* ```
|
|
144
|
+
*
|
|
145
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/alias
|
|
63
146
|
*/
|
|
64
|
-
alias?: Record<string, string
|
|
147
|
+
alias?: Record<string, string> | Array<{
|
|
148
|
+
find: string | RegExp;
|
|
149
|
+
replacement: string;
|
|
150
|
+
}>;
|
|
65
151
|
/**
|
|
66
152
|
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
67
153
|
*
|
|
@@ -78,15 +164,16 @@ interface BuildConfig {
|
|
|
78
164
|
*/
|
|
79
165
|
skipNodeModulesBundle?: boolean;
|
|
80
166
|
/**
|
|
81
|
-
*
|
|
167
|
+
* An optional set of override options to apply to the selected build variant.
|
|
82
168
|
*
|
|
83
|
-
* @
|
|
169
|
+
* @remarks
|
|
170
|
+
* This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
|
|
84
171
|
*/
|
|
85
|
-
|
|
172
|
+
override?: Record<string, any>;
|
|
86
173
|
}
|
|
87
|
-
type BuildResolvedConfig = BuildConfig
|
|
174
|
+
type BuildResolvedConfig = Omit<BuildConfig, "override">;
|
|
88
175
|
|
|
89
|
-
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "
|
|
176
|
+
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
90
177
|
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
91
178
|
|
|
92
179
|
interface ResolvedEntryTypeDefinition extends TypeDefinition {
|
|
@@ -100,7 +187,7 @@ interface ResolvedEntryTypeDefinition extends TypeDefinition {
|
|
|
100
187
|
output?: string;
|
|
101
188
|
}
|
|
102
189
|
type BabelResolvedConfig = Omit<BabelUserConfig, "plugins" | "presets"> & Required<Pick<BabelUserConfig, "plugins" | "presets">>;
|
|
103
|
-
type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "ssr" | "preview"
|
|
190
|
+
type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "mode" | "ssr">> & {
|
|
104
191
|
/**
|
|
105
192
|
* The name of the environment
|
|
106
193
|
*/
|
|
@@ -117,7 +204,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
|
|
|
117
204
|
/**
|
|
118
205
|
* The resolved options for the Powerlines project configuration.
|
|
119
206
|
*/
|
|
120
|
-
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "
|
|
207
|
+
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework">> & {
|
|
121
208
|
/**
|
|
122
209
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
123
210
|
*/
|
|
@@ -148,6 +235,13 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
|
|
|
148
235
|
* The output configuration options to use for the build process
|
|
149
236
|
*/
|
|
150
237
|
output: OutputResolvedConfig;
|
|
238
|
+
/**
|
|
239
|
+
* Configuration provided to build processes
|
|
240
|
+
*
|
|
241
|
+
* @remarks
|
|
242
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
|
|
243
|
+
*/
|
|
244
|
+
build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
|
|
151
245
|
/**
|
|
152
246
|
* The log level to use for the Powerlines processes.
|
|
153
247
|
*
|
|
@@ -178,6 +272,10 @@ interface GenerateTypesResult {
|
|
|
178
272
|
directives?: string[];
|
|
179
273
|
code: string;
|
|
180
274
|
}
|
|
275
|
+
type DeepPartial<T> = {
|
|
276
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
277
|
+
};
|
|
278
|
+
type ConfigResult<TContext extends PluginContext = PluginContext> = DeepPartial<TContext["config"]> & Record<string, any>;
|
|
181
279
|
interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext> extends Record<CommandType, (this: TContext) => MaybePromise<void>> {
|
|
182
280
|
/**
|
|
183
281
|
* A function that returns configuration options to be merged with the build context's options.
|
|
@@ -193,7 +291,7 @@ interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext
|
|
|
193
291
|
* @param config - The partial configuration object to be modified.
|
|
194
292
|
* @returns A promise that resolves to a partial configuration object.
|
|
195
293
|
*/
|
|
196
|
-
config: (this:
|
|
294
|
+
config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>;
|
|
197
295
|
/**
|
|
198
296
|
* 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
297
|
*
|
|
@@ -296,7 +394,7 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
|
|
|
296
394
|
* @param config - The partial configuration object to be modified.
|
|
297
395
|
* @returns A promise that resolves to a partial configuration object.
|
|
298
396
|
*/
|
|
299
|
-
config: PluginHook<(this:
|
|
397
|
+
config: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>> | ConfigResult<TContext>;
|
|
300
398
|
/**
|
|
301
399
|
* A hook that is called to transform the source code.
|
|
302
400
|
*
|
|
@@ -572,24 +670,33 @@ interface BaseConfig {
|
|
|
572
670
|
* The entry point(s) for the application
|
|
573
671
|
*/
|
|
574
672
|
entry?: TypeDefinitionParameter | TypeDefinitionParameter[];
|
|
673
|
+
/**
|
|
674
|
+
* Configuration for the output of the build process
|
|
675
|
+
*/
|
|
676
|
+
output?: OutputConfig;
|
|
575
677
|
/**
|
|
576
678
|
* Configuration for linting the source code
|
|
679
|
+
*
|
|
680
|
+
* @remarks
|
|
681
|
+
* If set to `false`, linting will be disabled.
|
|
577
682
|
*/
|
|
578
683
|
lint?: Record<string, any> | false;
|
|
579
684
|
/**
|
|
580
685
|
* Configuration for testing the source code
|
|
686
|
+
*
|
|
687
|
+
* @remarks
|
|
688
|
+
* If set to `false`, testing will be disabled.
|
|
581
689
|
*/
|
|
582
690
|
test?: Record<string, any> | false;
|
|
583
|
-
/**
|
|
584
|
-
* Configuration for the output of the build process
|
|
585
|
-
*/
|
|
586
|
-
output?: OutputConfig;
|
|
587
691
|
/**
|
|
588
692
|
* Configuration for the transformation of the source code
|
|
589
693
|
*/
|
|
590
694
|
transform?: Record<string, any>;
|
|
591
695
|
/**
|
|
592
|
-
*
|
|
696
|
+
* Configuration provided to build processes
|
|
697
|
+
*
|
|
698
|
+
* @remarks
|
|
699
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
|
|
593
700
|
*/
|
|
594
701
|
build?: BuildConfig;
|
|
595
702
|
/**
|
|
@@ -599,6 +706,13 @@ interface BaseConfig {
|
|
|
599
706
|
* This configuration will be used by the documentation generation plugins during the `docs` command.
|
|
600
707
|
*/
|
|
601
708
|
docs?: Record<string, any>;
|
|
709
|
+
/**
|
|
710
|
+
* Configuration for deploying the source code
|
|
711
|
+
*
|
|
712
|
+
* @remarks
|
|
713
|
+
* If set to `false`, the deployment will be disabled.
|
|
714
|
+
*/
|
|
715
|
+
deploy?: Record<string, any> | false;
|
|
602
716
|
/**
|
|
603
717
|
* The path to the tsconfig file to be used by the compiler
|
|
604
718
|
*
|
|
@@ -619,37 +733,6 @@ interface BaseConfig {
|
|
|
619
733
|
tsconfigRaw?: TSConfig;
|
|
620
734
|
}
|
|
621
735
|
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
736
|
/**
|
|
654
737
|
* Configuration options for the preview server
|
|
655
738
|
*/
|
|
@@ -722,16 +805,28 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
722
805
|
*/
|
|
723
806
|
framework?: string;
|
|
724
807
|
}
|
|
725
|
-
type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = CommonUserConfig & {
|
|
726
|
-
|
|
808
|
+
type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = Omit<CommonUserConfig, "build"> & {
|
|
809
|
+
/**
|
|
810
|
+
* Configuration provided to build processes
|
|
811
|
+
*
|
|
812
|
+
* @remarks
|
|
813
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
|
|
814
|
+
*/
|
|
815
|
+
build: Omit<TBuildConfig, "override"> & {
|
|
727
816
|
/**
|
|
728
817
|
* The build variant being used by the Powerlines engine.
|
|
729
818
|
*/
|
|
730
819
|
variant?: TBuildVariant;
|
|
820
|
+
/**
|
|
821
|
+
* An optional set of override options to apply to the selected build variant.
|
|
822
|
+
*
|
|
823
|
+
* @remarks
|
|
824
|
+
* This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
|
|
825
|
+
*/
|
|
826
|
+
override?: Partial<TBuildResolvedConfig>;
|
|
731
827
|
};
|
|
732
|
-
override?: Partial<TBuildResolvedConfig>;
|
|
733
828
|
};
|
|
734
|
-
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "
|
|
829
|
+
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
|
|
735
830
|
/**
|
|
736
831
|
* The configuration provided while executing Powerlines commands.
|
|
737
832
|
*/
|
|
@@ -778,14 +873,6 @@ interface MetaInfo {
|
|
|
778
873
|
* A hash that represents the path to the project root directory
|
|
779
874
|
*/
|
|
780
875
|
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
876
|
}
|
|
790
877
|
interface Resolver extends Jiti {
|
|
791
878
|
plugin: Jiti;
|
|
@@ -798,7 +885,13 @@ interface InitContextOptions {
|
|
|
798
885
|
*/
|
|
799
886
|
isHighPriority: boolean;
|
|
800
887
|
}
|
|
801
|
-
|
|
888
|
+
/**
|
|
889
|
+
* The unresolved Powerlines context.
|
|
890
|
+
*
|
|
891
|
+
* @remarks
|
|
892
|
+
* This context is used before the user configuration has been fully resolved after the `config`.
|
|
893
|
+
*/
|
|
894
|
+
interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
|
|
802
895
|
/**
|
|
803
896
|
* The Storm workspace configuration
|
|
804
897
|
*/
|
|
@@ -806,7 +899,10 @@ interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
|
|
|
806
899
|
/**
|
|
807
900
|
* An object containing the options provided to Powerlines
|
|
808
901
|
*/
|
|
809
|
-
config: TResolvedConfig
|
|
902
|
+
config: Omit<TResolvedConfig["userConfig"], "build" | "output"> & Required<Pick<TResolvedConfig["userConfig"], "build" | "output">> & {
|
|
903
|
+
projectRoot: NonUndefined<TResolvedConfig["userConfig"]["root"]>;
|
|
904
|
+
output: TResolvedConfig["output"];
|
|
905
|
+
};
|
|
810
906
|
/**
|
|
811
907
|
* A logging function for the Powerlines engine
|
|
812
908
|
*/
|
|
@@ -963,6 +1059,12 @@ interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
|
|
|
963
1059
|
*/
|
|
964
1060
|
extendLog: (name: string) => LogFn;
|
|
965
1061
|
}
|
|
1062
|
+
type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = Omit<UnresolvedContext<TResolvedConfig>, "config"> & {
|
|
1063
|
+
/**
|
|
1064
|
+
* The fully resolved Powerlines configuration
|
|
1065
|
+
*/
|
|
1066
|
+
config: TResolvedConfig;
|
|
1067
|
+
};
|
|
966
1068
|
interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig>, UnpluginContext {
|
|
967
1069
|
/**
|
|
968
1070
|
* The environment specific resolved configuration
|
|
@@ -1774,4 +1876,4 @@ interface SecretsInterface {
|
|
|
1774
1876
|
ENCRYPTION_KEY: string;
|
|
1775
1877
|
}
|
|
1776
1878
|
|
|
1777
|
-
export type { BabelUserConfig as B, Context as C, DeclareBabelTransformPluginReturn as D, EnvInterface as E, PluginContext as P, ResolvedConfig as R, SecretsInterface as S,
|
|
1879
|
+
export type { BabelUserConfig as B, Context as C, DeclareBabelTransformPluginReturn as D, EnvInterface as E, PluginContext as P, ResolvedConfig as R, SecretsInterface as S, UnresolvedContext as U, EnvironmentResolvedConfig as a, Plugin as b, UserConfig as c, BabelResolvedConfig as d };
|