@powerlines/plugin-env 0.13.14 → 0.13.16

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.
@@ -1,6 +1,7 @@
1
1
  export { envBabelPlugin } from './plugin.cjs';
2
- import '../runtime-BRVCxO4z.cjs';
2
+ import '../runtime-DsoL32bv.cjs';
3
3
  import '@stryke/env/get-env-paths';
4
+ import '@stryke/types/base';
4
5
  import '@stryke/types/package-json';
5
6
  import 'jiti';
6
7
  import 'oxc-parser';
@@ -10,7 +11,6 @@ import '@babel/core';
10
11
  import '@storm-software/build-tools/types';
11
12
  import '@storm-software/config-tools/types';
12
13
  import '@storm-software/config/types';
13
- import '@stryke/types/base';
14
14
  import '@stryke/types/configuration';
15
15
  import '@stryke/types/file';
16
16
  import 'vite';
@@ -1,6 +1,7 @@
1
1
  export { envBabelPlugin } from './plugin.js';
2
- import '../runtime-nCpMYmRi.js';
2
+ import '../runtime-DEVUXRrw.js';
3
3
  import '@stryke/env/get-env-paths';
4
+ import '@stryke/types/base';
4
5
  import '@stryke/types/package-json';
5
6
  import 'jiti';
6
7
  import 'oxc-parser';
@@ -10,7 +11,6 @@ import '@babel/core';
10
11
  import '@storm-software/build-tools/types';
11
12
  import '@storm-software/config-tools/types';
12
13
  import '@storm-software/config/types';
13
- import '@stryke/types/base';
14
14
  import '@stryke/types/configuration';
15
15
  import '@stryke/types/file';
16
16
  import 'vite';
@@ -1,6 +1,7 @@
1
- import { D as DeclareBabelTransformPluginReturn } from '../runtime-BRVCxO4z.cjs';
1
+ import { D as DeclareBabelTransformPluginReturn } from '../runtime-DsoL32bv.cjs';
2
2
  import { EnvPluginContext, EnvPluginResolvedConfig } from '../types/plugin.cjs';
3
3
  import '@stryke/env/get-env-paths';
4
+ import '@stryke/types/base';
4
5
  import '@stryke/types/package-json';
5
6
  import 'jiti';
6
7
  import 'oxc-parser';
@@ -10,7 +11,6 @@ import '@babel/core';
10
11
  import '@storm-software/build-tools/types';
11
12
  import '@storm-software/config-tools/types';
12
13
  import '@storm-software/config/types';
13
- import '@stryke/types/base';
14
14
  import '@stryke/types/configuration';
15
15
  import '@stryke/types/file';
16
16
  import 'vite';
@@ -1,6 +1,7 @@
1
- import { D as DeclareBabelTransformPluginReturn } from '../runtime-nCpMYmRi.js';
1
+ import { D as DeclareBabelTransformPluginReturn } from '../runtime-DEVUXRrw.js';
2
2
  import { EnvPluginContext, EnvPluginResolvedConfig } from '../types/plugin.js';
3
3
  import '@stryke/env/get-env-paths';
4
+ import '@stryke/types/base';
4
5
  import '@stryke/types/package-json';
5
6
  import 'jiti';
6
7
  import 'oxc-parser';
@@ -10,7 +11,6 @@ import '@babel/core';
10
11
  import '@storm-software/build-tools/types';
11
12
  import '@storm-software/config-tools/types';
12
13
  import '@storm-software/config/types';
13
- import '@stryke/types/base';
14
14
  import '@stryke/types/configuration';
15
15
  import '@stryke/types/file';
16
16
  import 'vite';
@@ -3,8 +3,9 @@ export { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectio
3
3
  export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from './reflect.cjs';
4
4
  export { formatEnvField, removeEnvPrefix } from './source-file-env.cjs';
5
5
  export { createTemplateReflection } from './template-helpers.cjs';
6
- import '../runtime-BRVCxO4z.cjs';
6
+ import '../runtime-DsoL32bv.cjs';
7
7
  import '@stryke/env/get-env-paths';
8
+ import '@stryke/types/base';
8
9
  import '@stryke/types/package-json';
9
10
  import 'jiti';
10
11
  import 'oxc-parser';
@@ -14,7 +15,6 @@ import '@babel/core';
14
15
  import '@storm-software/build-tools/types';
15
16
  import '@storm-software/config-tools/types';
16
17
  import '@storm-software/config/types';
17
- import '@stryke/types/base';
18
18
  import '@stryke/types/configuration';
19
19
  import '@stryke/types/file';
20
20
  import 'vite';
@@ -3,8 +3,9 @@ export { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectio
3
3
  export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from './reflect.js';
4
4
  export { formatEnvField, removeEnvPrefix } from './source-file-env.js';
5
5
  export { createTemplateReflection } from './template-helpers.js';
6
- import '../runtime-nCpMYmRi.js';
6
+ import '../runtime-DEVUXRrw.js';
7
7
  import '@stryke/env/get-env-paths';
8
+ import '@stryke/types/base';
8
9
  import '@stryke/types/package-json';
9
10
  import 'jiti';
10
11
  import 'oxc-parser';
@@ -14,7 +15,6 @@ import '@babel/core';
14
15
  import '@storm-software/build-tools/types';
15
16
  import '@storm-software/config-tools/types';
16
17
  import '@storm-software/config/types';
17
- import '@stryke/types/base';
18
18
  import '@stryke/types/configuration';
19
19
  import '@stryke/types/file';
20
20
  import 'vite';
@@ -1,7 +1,8 @@
1
- import { a as EnvironmentResolvedConfig } from '../runtime-BRVCxO4z.cjs';
1
+ import { a as EnvironmentResolvedConfig } from '../runtime-DsoL32bv.cjs';
2
2
  import { DotenvParseOutput } from '@stryke/env/types';
3
3
  import { EnvPluginContext, EnvPluginOptions } from '../types/plugin.cjs';
4
4
  import '@stryke/env/get-env-paths';
5
+ import '@stryke/types/base';
5
6
  import '@stryke/types/package-json';
6
7
  import 'jiti';
7
8
  import 'oxc-parser';
@@ -11,7 +12,6 @@ import '@babel/core';
11
12
  import '@storm-software/build-tools/types';
12
13
  import '@storm-software/config-tools/types';
13
14
  import '@storm-software/config/types';
14
- import '@stryke/types/base';
15
15
  import '@stryke/types/configuration';
16
16
  import '@stryke/types/file';
17
17
  import 'vite';
@@ -1,7 +1,8 @@
1
- import { a as EnvironmentResolvedConfig } from '../runtime-nCpMYmRi.js';
1
+ import { a as EnvironmentResolvedConfig } from '../runtime-DEVUXRrw.js';
2
2
  import { DotenvParseOutput } from '@stryke/env/types';
3
3
  import { EnvPluginContext, EnvPluginOptions } from '../types/plugin.js';
4
4
  import '@stryke/env/get-env-paths';
5
+ import '@stryke/types/base';
5
6
  import '@stryke/types/package-json';
6
7
  import 'jiti';
7
8
  import 'oxc-parser';
@@ -11,7 +12,6 @@ import '@babel/core';
11
12
  import '@storm-software/build-tools/types';
12
13
  import '@storm-software/config-tools/types';
13
14
  import '@storm-software/config/types';
14
- import '@stryke/types/base';
15
15
  import '@stryke/types/configuration';
16
16
  import '@stryke/types/file';
17
17
  import 'vite';
@@ -4,4 +4,4 @@
4
4
  *
5
5
  *****************************************/
6
6
 
7
- async function b(e){return resolve.resolvePackage("@powerlines/plugin-env/types/runtime",{paths:[e.workspaceConfig.workspaceRoot,joinPaths.joinPaths(e.workspaceConfig.workspaceRoot,e.config.projectRoot)]})}chunkFBBMZ4NC_cjs.a(b,"resolveRuntimeTypeFile");async function Z(e){return {file:await b(e),name:"EnvInterface"}}chunkFBBMZ4NC_cjs.a(Z,"getEnvDefaultTypeDefinition");async function x(e){return {file:await b(e),name:"SecretsInterface"}}chunkFBBMZ4NC_cjs.a(x,"getSecretsDefaultTypeDefinition");function B(e,n="env"){return joinPaths.joinPaths(resolveReflections.getReflectionsPath(e),"env",`${n}-types.bin`)}chunkFBBMZ4NC_cjs.a(B,"getEnvTypeReflectionsPath");async function M(e,n="env"){const t=B(e,n);if(!node_fs.existsSync(t)){if(!e.env.types.env||isEmptyObject.isEmptyObject(e.env.types.env)){const f=reflect.createEnvReflection(e),P=new v__namespace.Message;f.messageRoot=P.initRoot(reflection.SerializedTypes),f.dataBuffer=P.toArrayBuffer(),e.env.types.env=f,await z(e,e.env.types.env,n);}return e.env.types.env}const o=await buffer.readFileBuffer(t),i=new v__namespace.Message(o,false).getRoot(reflection.SerializedTypes),r=type.resolveClassType(type.deserializeType(capnp.convertFromCapnp(i.types)));return e.env.types[n]=r,e.env.types[n].messageRoot=i,e.env.types[n].dataBuffer=o,r}chunkFBBMZ4NC_cjs.a(M,"readEnvTypeReflection");async function z(e,n,t="env"){const o=n.serializeType(),s=new v__namespace.Message,i=s.initRoot(reflection.SerializedTypes);capnp.convertToCapnp(o,i._initTypes(o.length)),await e.fs.writeFile(B(e,t),node_buffer.Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}chunkFBBMZ4NC_cjs.a(z,"writeEnvTypeReflection");function l(e,n){return joinPaths.joinPaths(resolveReflections.getReflectionsPath(e),"env",`${n}.bin`)}chunkFBBMZ4NC_cjs.a(l,"getEnvReflectionsPath");async function ee(e){const n=l(e,"env");if(!node_fs.existsSync(n)){if(e.env.types.env||(e.env.types.env=await M(e,"env")),!e.env.used.env||isEmptyObject.isEmptyObject(e.env.used.env)){const r=reflect.createEnvReflection(e,{type:{kind:type.ReflectionKind.objectLiteral,typeName:"Env",description:`An object containing the environment configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:"application"}.`,types:[]},superReflection:e.env.types.env});r.name="Env";const f=new v__namespace.Message;r.messageRoot=f.initRoot(reflection.SerializedTypes),r.dataBuffer=f.toArrayBuffer(),e.env.used.env=r,await S(e,e.env.used.env,"env");}return e.env.used.env}const t=await buffer.readFileBuffer(n),s=new v__namespace.Message(t,false).getRoot(reflection.SerializedTypes),i=type.resolveClassType(type.deserializeType(capnp.convertFromCapnp(s.types)));return e.env.used.env=i,e.env.used.env.messageRoot=s,e.env.used.env.dataBuffer=t,i}chunkFBBMZ4NC_cjs.a(ee,"readEnvReflection");async function ne(e){const n=l(e,"secrets");if(!node_fs.existsSync(n)){if(e.env.types.secrets||(e.env.types.secrets=await M(e,"secrets")),!e.env.used.secrets||isEmptyObject.isEmptyObject(e.env.used.secrets)){const r=reflect.createEnvReflection(e,{type:{kind:type.ReflectionKind.objectLiteral,typeName:"Secrets",description:`An object containing the secret configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:"application"}.`,types:[]},superReflection:e.env.types.secrets});r.name="Secrets";const f=new v__namespace.Message;r.messageRoot=f.initRoot(reflection.SerializedTypes),r.dataBuffer=f.toArrayBuffer(),e.env.used.secrets=r,await S(e,e.env.used.secrets,"secrets");}return e.env.used.secrets}const t=await buffer.readFileBuffer(n),s=new v__namespace.Message(t,false).getRoot(reflection.SerializedTypes),i=type.resolveClassType(type.deserializeType(capnp.convertFromCapnp(s.types)));return e.env.used.secrets=i,e.env.used.secrets.messageRoot=s,e.env.used.secrets.dataBuffer=t,i}chunkFBBMZ4NC_cjs.a(ne,"readSecretsReflection");async function S(e,n,t="env"){const o=n.serializeType(),s=new v__namespace.Message,i=s.initRoot(reflection.SerializedTypes);capnp.convertToCapnp(o,i._initTypes(o.length)),await e.fs.writeFile(l(e,t),node_buffer.Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}chunkFBBMZ4NC_cjs.a(S,"writeEnvReflection");function se(e,n,t="env"){const o=n.serializeType(),s=new v__namespace.Message,i=s.initRoot(reflection.SerializedTypes);capnp.convertToCapnp(o,i._initTypes(o.length)),e.fs.writeFileSync(l(e,t),node_buffer.Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}chunkFBBMZ4NC_cjs.a(se,"writeEnvReflectionSync");exports.getEnvDefaultTypeDefinition=Z;exports.getEnvReflectionsPath=l;exports.getEnvTypeReflectionsPath=B;exports.getSecretsDefaultTypeDefinition=x;exports.readEnvReflection=ee;exports.readEnvTypeReflection=M;exports.readSecretsReflection=ne;exports.resolveRuntimeTypeFile=b;exports.writeEnvReflection=S;exports.writeEnvReflectionSync=se;exports.writeEnvTypeReflection=z;
7
+ async function b(e){return resolve.resolvePackage("@powerlines/plugin-env/types/runtime",{paths:[e.workspaceConfig.workspaceRoot,joinPaths.joinPaths(e.workspaceConfig.workspaceRoot,e.config.projectRoot)]})}chunkFBBMZ4NC_cjs.a(b,"resolveRuntimeTypeFile");async function x(e){return {file:await b(e),name:"EnvInterface"}}chunkFBBMZ4NC_cjs.a(x,"getEnvDefaultTypeDefinition");async function ee(e){return {file:await b(e),name:"SecretsInterface"}}chunkFBBMZ4NC_cjs.a(ee,"getSecretsDefaultTypeDefinition");function B(e,n="env"){return joinPaths.joinPaths(resolveReflections.getReflectionsPath(e),"env",`${n}-types.bin`)}chunkFBBMZ4NC_cjs.a(B,"getEnvTypeReflectionsPath");async function M(e,n="env"){const t=B(e,n);if(!node_fs.existsSync(t)){if(!e.env.types.env||isEmptyObject.isEmptyObject(e.env.types.env)){const f=reflect.createEnvReflection(e),P=new v__namespace.Message;f.messageRoot=P.initRoot(reflection.SerializedTypes),f.dataBuffer=P.toArrayBuffer(),e.env.types.env=f,await z(e,e.env.types.env,n);}return e.env.types.env}const o=await buffer.readFileBuffer(t),i=new v__namespace.Message(o,false).getRoot(reflection.SerializedTypes),r=type.resolveClassType(type.deserializeType(capnp.convertFromCapnp(i.types)));return e.env.types[n]=r,e.env.types[n].messageRoot=i,e.env.types[n].dataBuffer=o,r}chunkFBBMZ4NC_cjs.a(M,"readEnvTypeReflection");async function z(e,n,t="env"){const o=n.serializeType(),s=new v__namespace.Message,i=s.initRoot(reflection.SerializedTypes);capnp.convertToCapnp(o,i._initTypes(o.length)),await e.fs.writeFile(B(e,t),node_buffer.Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}chunkFBBMZ4NC_cjs.a(z,"writeEnvTypeReflection");function l(e,n){return joinPaths.joinPaths(resolveReflections.getReflectionsPath(e),"env",`${n}.bin`)}chunkFBBMZ4NC_cjs.a(l,"getEnvReflectionsPath");async function ne(e){const n=l(e,"env");if(!node_fs.existsSync(n)){if(e.env.types.env||(e.env.types.env=await M(e,"env")),!e.env.used.env||isEmptyObject.isEmptyObject(e.env.used.env)){const r=reflect.createEnvReflection(e,{type:{kind:type.ReflectionKind.objectLiteral,typeName:"Env",description:`An object containing the environment configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:"application"}.`,types:[]},superReflection:e.env.types.env});r.name="Env";const f=new v__namespace.Message;r.messageRoot=f.initRoot(reflection.SerializedTypes),r.dataBuffer=f.toArrayBuffer(),e.env.used.env=r,await S(e,e.env.used.env,"env");}return e.env.used.env}const t=await buffer.readFileBuffer(n),s=new v__namespace.Message(t,false).getRoot(reflection.SerializedTypes),i=type.resolveClassType(type.deserializeType(capnp.convertFromCapnp(s.types)));return e.env.used.env=i,e.env.used.env.messageRoot=s,e.env.used.env.dataBuffer=t,i}chunkFBBMZ4NC_cjs.a(ne,"readEnvReflection");async function se(e){const n=l(e,"secrets");if(!node_fs.existsSync(n)){if(e.env.types.secrets||(e.env.types.secrets=await M(e,"secrets")),!e.env.used.secrets||isEmptyObject.isEmptyObject(e.env.used.secrets)){const r=reflect.createEnvReflection(e,{type:{kind:type.ReflectionKind.objectLiteral,typeName:"Secrets",description:`An object containing the secret configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:"application"}.`,types:[]},superReflection:e.env.types.secrets});r.name="Secrets";const f=new v__namespace.Message;r.messageRoot=f.initRoot(reflection.SerializedTypes),r.dataBuffer=f.toArrayBuffer(),e.env.used.secrets=r,await S(e,e.env.used.secrets,"secrets");}return e.env.used.secrets}const t=await buffer.readFileBuffer(n),s=new v__namespace.Message(t,false).getRoot(reflection.SerializedTypes),i=type.resolveClassType(type.deserializeType(capnp.convertFromCapnp(s.types)));return e.env.used.secrets=i,e.env.used.secrets.messageRoot=s,e.env.used.secrets.dataBuffer=t,i}chunkFBBMZ4NC_cjs.a(se,"readSecretsReflection");async function S(e,n,t="env"){const o=n.serializeType(),s=new v__namespace.Message,i=s.initRoot(reflection.SerializedTypes);capnp.convertToCapnp(o,i._initTypes(o.length)),await e.fs.writeFile(l(e,t),node_buffer.Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}chunkFBBMZ4NC_cjs.a(S,"writeEnvReflection");function te(e,n,t="env"){const o=n.serializeType(),s=new v__namespace.Message,i=s.initRoot(reflection.SerializedTypes);capnp.convertToCapnp(o,i._initTypes(o.length)),e.fs.writeFileSync(l(e,t),node_buffer.Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}chunkFBBMZ4NC_cjs.a(te,"writeEnvReflectionSync");exports.getEnvDefaultTypeDefinition=x;exports.getEnvReflectionsPath=l;exports.getEnvTypeReflectionsPath=B;exports.getSecretsDefaultTypeDefinition=ee;exports.readEnvReflection=ne;exports.readEnvTypeReflection=M;exports.readSecretsReflection=se;exports.resolveRuntimeTypeFile=b;exports.writeEnvReflection=S;exports.writeEnvReflectionSync=te;exports.writeEnvTypeReflection=z;
@@ -1,8 +1,9 @@
1
1
  import { ReflectionClass } from '@deepkit/type';
2
2
  import { TypeDefinition } from '@stryke/types/configuration';
3
- import { C as Context } from '../runtime-BRVCxO4z.cjs';
3
+ import { U as UnresolvedContext, C as Context } from '../runtime-DsoL32bv.cjs';
4
4
  import { EnvPluginResolvedConfig, EnvType, EnvPluginContext } from '../types/plugin.cjs';
5
5
  import '@stryke/env/get-env-paths';
6
+ import '@stryke/types/base';
6
7
  import '@stryke/types/package-json';
7
8
  import 'jiti';
8
9
  import 'oxc-parser';
@@ -12,7 +13,6 @@ import '@babel/core';
12
13
  import '@storm-software/build-tools/types';
13
14
  import '@storm-software/config-tools/types';
14
15
  import '@storm-software/config/types';
15
- import '@stryke/types/base';
16
16
  import '@stryke/types/file';
17
17
  import 'vite';
18
18
  import '@babel/helper-plugin-utils';
@@ -34,20 +34,20 @@ import '@stryke/env/types';
34
34
  * @param context - The plugin context.
35
35
  * @returns The runtime type definition file for the environment variables.
36
36
  */
37
- declare function resolveRuntimeTypeFile(context: Context<EnvPluginResolvedConfig>): Promise<string>;
37
+ declare function resolveRuntimeTypeFile(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<string>;
38
38
  /**
39
39
  * Gets the default type definition for the environment variables.
40
40
  *
41
41
  * @param context - The plugin context.
42
42
  * @returns The default type definition for the environment variables.
43
43
  */
44
- declare function getEnvDefaultTypeDefinition(context: Context<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
44
+ declare function getEnvDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
45
45
  /** Gets the default type definition for the environment secrets.
46
46
  *
47
47
  * @param context - The plugin context.
48
48
  * @returns The default type definition for the environment secrets.
49
49
  */
50
- declare function getSecretsDefaultTypeDefinition(context: Context<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
50
+ declare function getSecretsDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
51
51
  /**
52
52
  * Gets the path to the environment type reflections.
53
53
  *
@@ -1,8 +1,9 @@
1
1
  import { ReflectionClass } from '@deepkit/type';
2
2
  import { TypeDefinition } from '@stryke/types/configuration';
3
- import { C as Context } from '../runtime-nCpMYmRi.js';
3
+ import { U as UnresolvedContext, C as Context } from '../runtime-DEVUXRrw.js';
4
4
  import { EnvPluginResolvedConfig, EnvType, EnvPluginContext } from '../types/plugin.js';
5
5
  import '@stryke/env/get-env-paths';
6
+ import '@stryke/types/base';
6
7
  import '@stryke/types/package-json';
7
8
  import 'jiti';
8
9
  import 'oxc-parser';
@@ -12,7 +13,6 @@ import '@babel/core';
12
13
  import '@storm-software/build-tools/types';
13
14
  import '@storm-software/config-tools/types';
14
15
  import '@storm-software/config/types';
15
- import '@stryke/types/base';
16
16
  import '@stryke/types/file';
17
17
  import 'vite';
18
18
  import '@babel/helper-plugin-utils';
@@ -34,20 +34,20 @@ import '@stryke/env/types';
34
34
  * @param context - The plugin context.
35
35
  * @returns The runtime type definition file for the environment variables.
36
36
  */
37
- declare function resolveRuntimeTypeFile(context: Context<EnvPluginResolvedConfig>): Promise<string>;
37
+ declare function resolveRuntimeTypeFile(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<string>;
38
38
  /**
39
39
  * Gets the default type definition for the environment variables.
40
40
  *
41
41
  * @param context - The plugin context.
42
42
  * @returns The default type definition for the environment variables.
43
43
  */
44
- declare function getEnvDefaultTypeDefinition(context: Context<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
44
+ declare function getEnvDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
45
45
  /** Gets the default type definition for the environment secrets.
46
46
  *
47
47
  * @param context - The plugin context.
48
48
  * @returns The default type definition for the environment secrets.
49
49
  */
50
- declare function getSecretsDefaultTypeDefinition(context: Context<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
50
+ declare function getSecretsDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
51
51
  /**
52
52
  * Gets the path to the environment type reflections.
53
53
  *
@@ -4,4 +4,4 @@ import {a}from'../chunk-UCUR73HG.js';import {convertFromCapnp,convertToCapnp}fro
4
4
  *
5
5
  *****************************************/
6
6
 
7
- async function b(e){return resolvePackage("@powerlines/plugin-env/types/runtime",{paths:[e.workspaceConfig.workspaceRoot,joinPaths(e.workspaceConfig.workspaceRoot,e.config.projectRoot)]})}a(b,"resolveRuntimeTypeFile");async function x(e){return {file:await b(e),name:"EnvInterface"}}a(x,"getEnvDefaultTypeDefinition");async function ee(e){return {file:await b(e),name:"SecretsInterface"}}a(ee,"getSecretsDefaultTypeDefinition");function B(e,n="env"){return joinPaths(getReflectionsPath(e),"env",`${n}-types.bin`)}a(B,"getEnvTypeReflectionsPath");async function M(e,n="env"){const t=B(e,n);if(!existsSync(t)){if(!e.env.types.env||isEmptyObject(e.env.types.env)){const f=createEnvReflection(e),P=new v.Message;f.messageRoot=P.initRoot(SerializedTypes),f.dataBuffer=P.toArrayBuffer(),e.env.types.env=f,await z(e,e.env.types.env,n);}return e.env.types.env}const o=await readFileBuffer(t),i=new v.Message(o,false).getRoot(SerializedTypes),r=resolveClassType(deserializeType(convertFromCapnp(i.types)));return e.env.types[n]=r,e.env.types[n].messageRoot=i,e.env.types[n].dataBuffer=o,r}a(M,"readEnvTypeReflection");async function z(e,n,t="env"){const o=n.serializeType(),s=new v.Message,i=s.initRoot(SerializedTypes);convertToCapnp(o,i._initTypes(o.length)),await e.fs.writeFile(B(e,t),Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}a(z,"writeEnvTypeReflection");function l(e,n){return joinPaths(getReflectionsPath(e),"env",`${n}.bin`)}a(l,"getEnvReflectionsPath");async function ne(e){const n=l(e,"env");if(!existsSync(n)){if(e.env.types.env||(e.env.types.env=await M(e,"env")),!e.env.used.env||isEmptyObject(e.env.used.env)){const r=createEnvReflection(e,{type:{kind:ReflectionKind.objectLiteral,typeName:"Env",description:`An object containing the environment configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:"application"}.`,types:[]},superReflection:e.env.types.env});r.name="Env";const f=new v.Message;r.messageRoot=f.initRoot(SerializedTypes),r.dataBuffer=f.toArrayBuffer(),e.env.used.env=r,await S(e,e.env.used.env,"env");}return e.env.used.env}const t=await readFileBuffer(n),s=new v.Message(t,false).getRoot(SerializedTypes),i=resolveClassType(deserializeType(convertFromCapnp(s.types)));return e.env.used.env=i,e.env.used.env.messageRoot=s,e.env.used.env.dataBuffer=t,i}a(ne,"readEnvReflection");async function se(e){const n=l(e,"secrets");if(!existsSync(n)){if(e.env.types.secrets||(e.env.types.secrets=await M(e,"secrets")),!e.env.used.secrets||isEmptyObject(e.env.used.secrets)){const r=createEnvReflection(e,{type:{kind:ReflectionKind.objectLiteral,typeName:"Secrets",description:`An object containing the secret configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:"application"}.`,types:[]},superReflection:e.env.types.secrets});r.name="Secrets";const f=new v.Message;r.messageRoot=f.initRoot(SerializedTypes),r.dataBuffer=f.toArrayBuffer(),e.env.used.secrets=r,await S(e,e.env.used.secrets,"secrets");}return e.env.used.secrets}const t=await readFileBuffer(n),s=new v.Message(t,false).getRoot(SerializedTypes),i=resolveClassType(deserializeType(convertFromCapnp(s.types)));return e.env.used.secrets=i,e.env.used.secrets.messageRoot=s,e.env.used.secrets.dataBuffer=t,i}a(se,"readSecretsReflection");async function S(e,n,t="env"){const o=n.serializeType(),s=new v.Message,i=s.initRoot(SerializedTypes);convertToCapnp(o,i._initTypes(o.length)),await e.fs.writeFile(l(e,t),Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}a(S,"writeEnvReflection");function te(e,n,t="env"){const o=n.serializeType(),s=new v.Message,i=s.initRoot(SerializedTypes);convertToCapnp(o,i._initTypes(o.length)),e.fs.writeFileSync(l(e,t),Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}a(te,"writeEnvReflectionSync");export{x as getEnvDefaultTypeDefinition,l as getEnvReflectionsPath,B as getEnvTypeReflectionsPath,ee as getSecretsDefaultTypeDefinition,ne as readEnvReflection,M as readEnvTypeReflection,se as readSecretsReflection,b as resolveRuntimeTypeFile,S as writeEnvReflection,te as writeEnvReflectionSync,z as writeEnvTypeReflection};
7
+ async function b(e){return resolvePackage("@powerlines/plugin-env/types/runtime",{paths:[e.workspaceConfig.workspaceRoot,joinPaths(e.workspaceConfig.workspaceRoot,e.config.projectRoot)]})}a(b,"resolveRuntimeTypeFile");async function ee(e){return {file:await b(e),name:"EnvInterface"}}a(ee,"getEnvDefaultTypeDefinition");async function ne(e){return {file:await b(e),name:"SecretsInterface"}}a(ne,"getSecretsDefaultTypeDefinition");function B(e,n="env"){return joinPaths(getReflectionsPath(e),"env",`${n}-types.bin`)}a(B,"getEnvTypeReflectionsPath");async function M(e,n="env"){const t=B(e,n);if(!existsSync(t)){if(!e.env.types.env||isEmptyObject(e.env.types.env)){const f=createEnvReflection(e),P=new v.Message;f.messageRoot=P.initRoot(SerializedTypes),f.dataBuffer=P.toArrayBuffer(),e.env.types.env=f,await z(e,e.env.types.env,n);}return e.env.types.env}const o=await readFileBuffer(t),i=new v.Message(o,false).getRoot(SerializedTypes),r=resolveClassType(deserializeType(convertFromCapnp(i.types)));return e.env.types[n]=r,e.env.types[n].messageRoot=i,e.env.types[n].dataBuffer=o,r}a(M,"readEnvTypeReflection");async function z(e,n,t="env"){const o=n.serializeType(),s=new v.Message,i=s.initRoot(SerializedTypes);convertToCapnp(o,i._initTypes(o.length)),await e.fs.writeFile(B(e,t),Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}a(z,"writeEnvTypeReflection");function l(e,n){return joinPaths(getReflectionsPath(e),"env",`${n}.bin`)}a(l,"getEnvReflectionsPath");async function se(e){const n=l(e,"env");if(!existsSync(n)){if(e.env.types.env||(e.env.types.env=await M(e,"env")),!e.env.used.env||isEmptyObject(e.env.used.env)){const r=createEnvReflection(e,{type:{kind:ReflectionKind.objectLiteral,typeName:"Env",description:`An object containing the environment configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:"application"}.`,types:[]},superReflection:e.env.types.env});r.name="Env";const f=new v.Message;r.messageRoot=f.initRoot(SerializedTypes),r.dataBuffer=f.toArrayBuffer(),e.env.used.env=r,await S(e,e.env.used.env,"env");}return e.env.used.env}const t=await readFileBuffer(n),s=new v.Message(t,false).getRoot(SerializedTypes),i=resolveClassType(deserializeType(convertFromCapnp(s.types)));return e.env.used.env=i,e.env.used.env.messageRoot=s,e.env.used.env.dataBuffer=t,i}a(se,"readEnvReflection");async function te(e){const n=l(e,"secrets");if(!existsSync(n)){if(e.env.types.secrets||(e.env.types.secrets=await M(e,"secrets")),!e.env.used.secrets||isEmptyObject(e.env.used.secrets)){const r=createEnvReflection(e,{type:{kind:ReflectionKind.objectLiteral,typeName:"Secrets",description:`An object containing the secret configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:"application"}.`,types:[]},superReflection:e.env.types.secrets});r.name="Secrets";const f=new v.Message;r.messageRoot=f.initRoot(SerializedTypes),r.dataBuffer=f.toArrayBuffer(),e.env.used.secrets=r,await S(e,e.env.used.secrets,"secrets");}return e.env.used.secrets}const t=await readFileBuffer(n),s=new v.Message(t,false).getRoot(SerializedTypes),i=resolveClassType(deserializeType(convertFromCapnp(s.types)));return e.env.used.secrets=i,e.env.used.secrets.messageRoot=s,e.env.used.secrets.dataBuffer=t,i}a(te,"readSecretsReflection");async function S(e,n,t="env"){const o=n.serializeType(),s=new v.Message,i=s.initRoot(SerializedTypes);convertToCapnp(o,i._initTypes(o.length)),await e.fs.writeFile(l(e,t),Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}a(S,"writeEnvReflection");function ie(e,n,t="env"){const o=n.serializeType(),s=new v.Message,i=s.initRoot(SerializedTypes);convertToCapnp(o,i._initTypes(o.length)),e.fs.writeFileSync(l(e,t),Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}a(ie,"writeEnvReflectionSync");export{ee as getEnvDefaultTypeDefinition,l as getEnvReflectionsPath,B as getEnvTypeReflectionsPath,ne as getSecretsDefaultTypeDefinition,se as readEnvReflection,M as readEnvTypeReflection,te as readSecretsReflection,b as resolveRuntimeTypeFile,S as writeEnvReflection,ie as writeEnvReflectionSync,z as writeEnvTypeReflection};
@@ -1,11 +1,12 @@
1
1
  import { ReflectionClass, TypeObjectLiteral, TypeClass } from '@deepkit/type';
2
2
  import { EnvPluginContext } from '../types/plugin.cjs';
3
- import { E as EnvInterface, S as SecretsInterface } from '../runtime-BRVCxO4z.cjs';
3
+ import { E as EnvInterface, S as SecretsInterface } from '../runtime-DsoL32bv.cjs';
4
4
  import '@alloy-js/core/jsx-runtime';
5
5
  import '@stryke/capnp';
6
6
  import '@stryke/env/types';
7
7
  import '@stryke/types/configuration';
8
8
  import '@stryke/env/get-env-paths';
9
+ import '@stryke/types/base';
9
10
  import '@stryke/types/package-json';
10
11
  import 'jiti';
11
12
  import 'oxc-parser';
@@ -15,7 +16,6 @@ import '@babel/core';
15
16
  import '@storm-software/build-tools/types';
16
17
  import '@storm-software/config-tools/types';
17
18
  import '@storm-software/config/types';
18
- import '@stryke/types/base';
19
19
  import '@stryke/types/file';
20
20
  import 'vite';
21
21
  import '@babel/helper-plugin-utils';
@@ -1,11 +1,12 @@
1
1
  import { ReflectionClass, TypeObjectLiteral, TypeClass } from '@deepkit/type';
2
2
  import { EnvPluginContext } from '../types/plugin.js';
3
- import { E as EnvInterface, S as SecretsInterface } from '../runtime-nCpMYmRi.js';
3
+ import { E as EnvInterface, S as SecretsInterface } from '../runtime-DEVUXRrw.js';
4
4
  import '@alloy-js/core/jsx-runtime';
5
5
  import '@stryke/capnp';
6
6
  import '@stryke/env/types';
7
7
  import '@stryke/types/configuration';
8
8
  import '@stryke/env/get-env-paths';
9
+ import '@stryke/types/base';
9
10
  import '@stryke/types/package-json';
10
11
  import 'jiti';
11
12
  import 'oxc-parser';
@@ -15,7 +16,6 @@ import '@babel/core';
15
16
  import '@storm-software/build-tools/types';
16
17
  import '@storm-software/config-tools/types';
17
18
  import '@storm-software/config/types';
18
- import '@stryke/types/base';
19
19
  import '@stryke/types/file';
20
20
  import 'vite';
21
21
  import '@babel/helper-plugin-utils';
@@ -2,8 +2,9 @@ import { ReflectionClass } from '@deepkit/type';
2
2
  import { EnvPluginContext, EnvType } from '../types/plugin.cjs';
3
3
  import '@alloy-js/core/jsx-runtime';
4
4
  import '@stryke/capnp';
5
- import '../runtime-BRVCxO4z.cjs';
5
+ import '../runtime-DsoL32bv.cjs';
6
6
  import '@stryke/env/get-env-paths';
7
+ import '@stryke/types/base';
7
8
  import '@stryke/types/package-json';
8
9
  import 'jiti';
9
10
  import 'oxc-parser';
@@ -13,7 +14,6 @@ import '@babel/core';
13
14
  import '@storm-software/build-tools/types';
14
15
  import '@storm-software/config-tools/types';
15
16
  import '@storm-software/config/types';
16
- import '@stryke/types/base';
17
17
  import '@stryke/types/configuration';
18
18
  import '@stryke/types/file';
19
19
  import 'vite';
@@ -2,8 +2,9 @@ import { ReflectionClass } from '@deepkit/type';
2
2
  import { EnvPluginContext, EnvType } from '../types/plugin.js';
3
3
  import '@alloy-js/core/jsx-runtime';
4
4
  import '@stryke/capnp';
5
- import '../runtime-nCpMYmRi.js';
5
+ import '../runtime-DEVUXRrw.js';
6
6
  import '@stryke/env/get-env-paths';
7
+ import '@stryke/types/base';
7
8
  import '@stryke/types/package-json';
8
9
  import 'jiti';
9
10
  import 'oxc-parser';
@@ -13,7 +14,6 @@ import '@babel/core';
13
14
  import '@storm-software/build-tools/types';
14
15
  import '@storm-software/config-tools/types';
15
16
  import '@storm-software/config/types';
16
- import '@stryke/types/base';
17
17
  import '@stryke/types/configuration';
18
18
  import '@stryke/types/file';
19
19
  import 'vite';
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PluginContext, b as Plugin } from './runtime-BRVCxO4z.cjs';
2
- export { E as EnvInterface, S as SecretsInterface } from './runtime-BRVCxO4z.cjs';
1
+ import { P as PluginContext, b as Plugin } from './runtime-DsoL32bv.cjs';
2
+ export { E as EnvInterface, S as SecretsInterface } from './runtime-DsoL32bv.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';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PluginContext, b as Plugin } from './runtime-nCpMYmRi.js';
2
- export { E as EnvInterface, S as SecretsInterface } from './runtime-nCpMYmRi.js';
1
+ import { P as PluginContext, b as Plugin } from './runtime-DEVUXRrw.js';
2
+ export { E as EnvInterface, S as SecretsInterface } from './runtime-DEVUXRrw.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';
@@ -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, UnpluginBuildContext, UnpluginMessage } from 'unplugin';
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';
@@ -45,6 +45,73 @@ interface BuildConfig {
45
45
  * @defaultValue "neutral"
46
46
  */
47
47
  platform?: "node" | "browser" | "neutral";
48
+ /**
49
+ * 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.
50
+ *
51
+ * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
52
+ */
53
+ mainFields?: string[];
54
+ /**
55
+ * Array of strings indicating what conditions should be used for module resolution.
56
+ */
57
+ conditions?: string[];
58
+ /**
59
+ * Array of strings indicating what file extensions should be used for module resolution.
60
+ *
61
+ * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
62
+ */
63
+ extensions?: string[];
64
+ /**
65
+ * Array of strings indicating what modules should be deduplicated to a single version in the build.
66
+ *
67
+ * @remarks
68
+ * 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.
69
+ */
70
+ dedupe?: string[];
71
+ /**
72
+ * Array of strings or regular expressions that indicate what modules are builtin for the environment.
73
+ */
74
+ builtins?: (string | RegExp)[];
75
+ /**
76
+ * Define global variable replacements.
77
+ *
78
+ * @remarks
79
+ * 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.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * {
84
+ * define: {
85
+ * __VERSION__: '"1.0.0"',
86
+ * __DEV__: 'process.env.NODE_ENV !== "production"'
87
+ * }
88
+ * }
89
+ * ```
90
+ *
91
+ * @see https://esbuild.github.io/api/#define
92
+ * @see https://vitejs.dev/config/build-options.html#define
93
+ * @see https://github.com/rollup/plugins/tree/master/packages/replace
94
+ */
95
+ define?: Record<string, any>;
96
+ /**
97
+ * Global variables that will have import statements injected where necessary
98
+ *
99
+ * @remarks
100
+ * 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.
101
+ *
102
+ * @example
103
+ * ```ts
104
+ * {
105
+ * inject: {
106
+ * process: 'process/browser',
107
+ * Buffer: ['buffer', 'Buffer'],
108
+ * }
109
+ * }
110
+ * ```
111
+ *
112
+ * @see https://github.com/rollup/plugins/tree/master/packages/inject
113
+ */
114
+ inject?: Record<string, string | string[]>;
48
115
  /**
49
116
  * The alias mappings to use for module resolution during the build process.
50
117
  *
@@ -60,6 +127,8 @@ interface BuildConfig {
60
127
  * }
61
128
  * }
62
129
  * ```
130
+ *
131
+ * @see https://github.com/rollup/plugins/tree/master/packages/alias
63
132
  */
64
133
  alias?: Record<string, string>;
65
134
  /**
@@ -78,13 +147,14 @@ interface BuildConfig {
78
147
  */
79
148
  skipNodeModulesBundle?: boolean;
80
149
  /**
81
- * Should the Powerlines processes skip the `"prepare"` task prior to building?
150
+ * An optional set of override options to apply to the selected build variant.
82
151
  *
83
- * @defaultValue false
152
+ * @remarks
153
+ * 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
154
  */
85
- skipPrepare?: boolean;
155
+ override?: Record<string, any>;
86
156
  }
87
- type BuildResolvedConfig = BuildConfig;
157
+ type BuildResolvedConfig = Omit<BuildConfig, "override">;
88
158
 
89
159
  declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "release", "finalize"];
90
160
  type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
@@ -100,7 +170,7 @@ interface ResolvedEntryTypeDefinition extends TypeDefinition {
100
170
  output?: string;
101
171
  }
102
172
  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">> & {
173
+ type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "mode" | "ssr">> & {
104
174
  /**
105
175
  * The name of the environment
106
176
  */
@@ -117,7 +187,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
117
187
  /**
118
188
  * The resolved options for the Powerlines project configuration.
119
189
  */
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">> & {
190
+ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "framework">> & {
121
191
  /**
122
192
  * The configuration options that were provided inline to the Powerlines CLI.
123
193
  */
@@ -148,6 +218,13 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
148
218
  * The output configuration options to use for the build process
149
219
  */
150
220
  output: OutputResolvedConfig;
221
+ /**
222
+ * Configuration provided to build processes
223
+ *
224
+ * @remarks
225
+ * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
226
+ */
227
+ build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
151
228
  /**
152
229
  * The log level to use for the Powerlines processes.
153
230
  *
@@ -178,6 +255,10 @@ interface GenerateTypesResult {
178
255
  directives?: string[];
179
256
  code: string;
180
257
  }
258
+ type DeepPartial<T> = {
259
+ [K in keyof T]?: DeepPartial<T[K]>;
260
+ };
261
+ type ConfigResult<TContext extends PluginContext = PluginContext> = DeepPartial<TContext["config"]> & Record<string, any>;
181
262
  interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext> extends Record<CommandType, (this: TContext) => MaybePromise<void>> {
182
263
  /**
183
264
  * A function that returns configuration options to be merged with the build context's options.
@@ -193,7 +274,7 @@ interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext
193
274
  * @param config - The partial configuration object to be modified.
194
275
  * @returns A promise that resolves to a partial configuration object.
195
276
  */
196
- config: (this: Context<TContext["config"]>) => MaybePromise<Partial<TContext["config"]["userConfig"]>>;
277
+ config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>;
197
278
  /**
198
279
  * 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
280
  *
@@ -296,7 +377,7 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
296
377
  * @param config - The partial configuration object to be modified.
297
378
  * @returns A promise that resolves to a partial configuration object.
298
379
  */
299
- config: PluginHook<(this: Context<TContext["config"]>) => MaybePromise<Partial<TContext["config"]["userConfig"]>>> | Partial<TContext["config"]["userConfig"]>;
380
+ config: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>> | ConfigResult<TContext>;
300
381
  /**
301
382
  * A hook that is called to transform the source code.
302
383
  *
@@ -572,24 +653,33 @@ interface BaseConfig {
572
653
  * The entry point(s) for the application
573
654
  */
574
655
  entry?: TypeDefinitionParameter | TypeDefinitionParameter[];
656
+ /**
657
+ * Configuration for the output of the build process
658
+ */
659
+ output?: OutputConfig;
575
660
  /**
576
661
  * Configuration for linting the source code
662
+ *
663
+ * @remarks
664
+ * If set to `false`, linting will be disabled.
577
665
  */
578
666
  lint?: Record<string, any> | false;
579
667
  /**
580
668
  * Configuration for testing the source code
669
+ *
670
+ * @remarks
671
+ * If set to `false`, testing will be disabled.
581
672
  */
582
673
  test?: Record<string, any> | false;
583
- /**
584
- * Configuration for the output of the build process
585
- */
586
- output?: OutputConfig;
587
674
  /**
588
675
  * Configuration for the transformation of the source code
589
676
  */
590
677
  transform?: Record<string, any>;
591
678
  /**
592
- * Options to to provide to the build process
679
+ * Configuration provided to build processes
680
+ *
681
+ * @remarks
682
+ * 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
683
  */
594
684
  build?: BuildConfig;
595
685
  /**
@@ -619,37 +709,6 @@ interface BaseConfig {
619
709
  tsconfigRaw?: TSConfig;
620
710
  }
621
711
  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
712
  /**
654
713
  * Configuration options for the preview server
655
714
  */
@@ -722,14 +781,26 @@ interface CommonUserConfig extends BaseConfig {
722
781
  */
723
782
  framework?: string;
724
783
  }
725
- type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = CommonUserConfig & {
726
- build?: TBuildConfig & {
784
+ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = Omit<CommonUserConfig, "build"> & {
785
+ /**
786
+ * Configuration provided to build processes
787
+ *
788
+ * @remarks
789
+ * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
790
+ */
791
+ build: Omit<TBuildConfig, "override"> & {
727
792
  /**
728
793
  * The build variant being used by the Powerlines engine.
729
794
  */
730
795
  variant?: TBuildVariant;
796
+ /**
797
+ * An optional set of override options to apply to the selected build variant.
798
+ *
799
+ * @remarks
800
+ * 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.
801
+ */
802
+ override?: Partial<TBuildResolvedConfig>;
731
803
  };
732
- override?: Partial<TBuildResolvedConfig>;
733
804
  };
734
805
  type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "release" | "clean";
735
806
  /**
@@ -798,7 +869,13 @@ interface InitContextOptions {
798
869
  */
799
870
  isHighPriority: boolean;
800
871
  }
801
- interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
872
+ /**
873
+ * The unresolved Powerlines context.
874
+ *
875
+ * @remarks
876
+ * This context is used before the user configuration has been fully resolved after the `config`.
877
+ */
878
+ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
802
879
  /**
803
880
  * The Storm workspace configuration
804
881
  */
@@ -806,7 +883,10 @@ interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
806
883
  /**
807
884
  * An object containing the options provided to Powerlines
808
885
  */
809
- config: TResolvedConfig;
886
+ config: Omit<TResolvedConfig["userConfig"], "build" | "output"> & Required<Pick<TResolvedConfig["userConfig"], "build" | "output">> & {
887
+ projectRoot: NonUndefined<TResolvedConfig["userConfig"]["root"]>;
888
+ output: TResolvedConfig["output"];
889
+ };
810
890
  /**
811
891
  * A logging function for the Powerlines engine
812
892
  */
@@ -963,6 +1043,12 @@ interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
963
1043
  */
964
1044
  extendLog: (name: string) => LogFn;
965
1045
  }
1046
+ type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = Omit<UnresolvedContext<TResolvedConfig>, "config"> & {
1047
+ /**
1048
+ * The fully resolved Powerlines configuration
1049
+ */
1050
+ config: TResolvedConfig;
1051
+ };
966
1052
  interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig>, UnpluginContext {
967
1053
  /**
968
1054
  * The environment specific resolved configuration
@@ -1774,4 +1860,4 @@ interface SecretsInterface {
1774
1860
  ENCRYPTION_KEY: string;
1775
1861
  }
1776
1862
 
1777
- 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 };
1863
+ 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 };
@@ -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, UnpluginBuildContext, UnpluginMessage } from 'unplugin';
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';
@@ -45,6 +45,73 @@ interface BuildConfig {
45
45
  * @defaultValue "neutral"
46
46
  */
47
47
  platform?: "node" | "browser" | "neutral";
48
+ /**
49
+ * 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.
50
+ *
51
+ * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
52
+ */
53
+ mainFields?: string[];
54
+ /**
55
+ * Array of strings indicating what conditions should be used for module resolution.
56
+ */
57
+ conditions?: string[];
58
+ /**
59
+ * Array of strings indicating what file extensions should be used for module resolution.
60
+ *
61
+ * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
62
+ */
63
+ extensions?: string[];
64
+ /**
65
+ * Array of strings indicating what modules should be deduplicated to a single version in the build.
66
+ *
67
+ * @remarks
68
+ * 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.
69
+ */
70
+ dedupe?: string[];
71
+ /**
72
+ * Array of strings or regular expressions that indicate what modules are builtin for the environment.
73
+ */
74
+ builtins?: (string | RegExp)[];
75
+ /**
76
+ * Define global variable replacements.
77
+ *
78
+ * @remarks
79
+ * 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.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * {
84
+ * define: {
85
+ * __VERSION__: '"1.0.0"',
86
+ * __DEV__: 'process.env.NODE_ENV !== "production"'
87
+ * }
88
+ * }
89
+ * ```
90
+ *
91
+ * @see https://esbuild.github.io/api/#define
92
+ * @see https://vitejs.dev/config/build-options.html#define
93
+ * @see https://github.com/rollup/plugins/tree/master/packages/replace
94
+ */
95
+ define?: Record<string, any>;
96
+ /**
97
+ * Global variables that will have import statements injected where necessary
98
+ *
99
+ * @remarks
100
+ * 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.
101
+ *
102
+ * @example
103
+ * ```ts
104
+ * {
105
+ * inject: {
106
+ * process: 'process/browser',
107
+ * Buffer: ['buffer', 'Buffer'],
108
+ * }
109
+ * }
110
+ * ```
111
+ *
112
+ * @see https://github.com/rollup/plugins/tree/master/packages/inject
113
+ */
114
+ inject?: Record<string, string | string[]>;
48
115
  /**
49
116
  * The alias mappings to use for module resolution during the build process.
50
117
  *
@@ -60,6 +127,8 @@ interface BuildConfig {
60
127
  * }
61
128
  * }
62
129
  * ```
130
+ *
131
+ * @see https://github.com/rollup/plugins/tree/master/packages/alias
63
132
  */
64
133
  alias?: Record<string, string>;
65
134
  /**
@@ -78,13 +147,14 @@ interface BuildConfig {
78
147
  */
79
148
  skipNodeModulesBundle?: boolean;
80
149
  /**
81
- * Should the Powerlines processes skip the `"prepare"` task prior to building?
150
+ * An optional set of override options to apply to the selected build variant.
82
151
  *
83
- * @defaultValue false
152
+ * @remarks
153
+ * 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
154
  */
85
- skipPrepare?: boolean;
155
+ override?: Record<string, any>;
86
156
  }
87
- type BuildResolvedConfig = BuildConfig;
157
+ type BuildResolvedConfig = Omit<BuildConfig, "override">;
88
158
 
89
159
  declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "release", "finalize"];
90
160
  type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
@@ -100,7 +170,7 @@ interface ResolvedEntryTypeDefinition extends TypeDefinition {
100
170
  output?: string;
101
171
  }
102
172
  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">> & {
173
+ type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "mode" | "ssr">> & {
104
174
  /**
105
175
  * The name of the environment
106
176
  */
@@ -117,7 +187,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
117
187
  /**
118
188
  * The resolved options for the Powerlines project configuration.
119
189
  */
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">> & {
190
+ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "framework">> & {
121
191
  /**
122
192
  * The configuration options that were provided inline to the Powerlines CLI.
123
193
  */
@@ -148,6 +218,13 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
148
218
  * The output configuration options to use for the build process
149
219
  */
150
220
  output: OutputResolvedConfig;
221
+ /**
222
+ * Configuration provided to build processes
223
+ *
224
+ * @remarks
225
+ * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
226
+ */
227
+ build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
151
228
  /**
152
229
  * The log level to use for the Powerlines processes.
153
230
  *
@@ -178,6 +255,10 @@ interface GenerateTypesResult {
178
255
  directives?: string[];
179
256
  code: string;
180
257
  }
258
+ type DeepPartial<T> = {
259
+ [K in keyof T]?: DeepPartial<T[K]>;
260
+ };
261
+ type ConfigResult<TContext extends PluginContext = PluginContext> = DeepPartial<TContext["config"]> & Record<string, any>;
181
262
  interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext> extends Record<CommandType, (this: TContext) => MaybePromise<void>> {
182
263
  /**
183
264
  * A function that returns configuration options to be merged with the build context's options.
@@ -193,7 +274,7 @@ interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext
193
274
  * @param config - The partial configuration object to be modified.
194
275
  * @returns A promise that resolves to a partial configuration object.
195
276
  */
196
- config: (this: Context<TContext["config"]>) => MaybePromise<Partial<TContext["config"]["userConfig"]>>;
277
+ config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>;
197
278
  /**
198
279
  * 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
280
  *
@@ -296,7 +377,7 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
296
377
  * @param config - The partial configuration object to be modified.
297
378
  * @returns A promise that resolves to a partial configuration object.
298
379
  */
299
- config: PluginHook<(this: Context<TContext["config"]>) => MaybePromise<Partial<TContext["config"]["userConfig"]>>> | Partial<TContext["config"]["userConfig"]>;
380
+ config: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>> | ConfigResult<TContext>;
300
381
  /**
301
382
  * A hook that is called to transform the source code.
302
383
  *
@@ -572,24 +653,33 @@ interface BaseConfig {
572
653
  * The entry point(s) for the application
573
654
  */
574
655
  entry?: TypeDefinitionParameter | TypeDefinitionParameter[];
656
+ /**
657
+ * Configuration for the output of the build process
658
+ */
659
+ output?: OutputConfig;
575
660
  /**
576
661
  * Configuration for linting the source code
662
+ *
663
+ * @remarks
664
+ * If set to `false`, linting will be disabled.
577
665
  */
578
666
  lint?: Record<string, any> | false;
579
667
  /**
580
668
  * Configuration for testing the source code
669
+ *
670
+ * @remarks
671
+ * If set to `false`, testing will be disabled.
581
672
  */
582
673
  test?: Record<string, any> | false;
583
- /**
584
- * Configuration for the output of the build process
585
- */
586
- output?: OutputConfig;
587
674
  /**
588
675
  * Configuration for the transformation of the source code
589
676
  */
590
677
  transform?: Record<string, any>;
591
678
  /**
592
- * Options to to provide to the build process
679
+ * Configuration provided to build processes
680
+ *
681
+ * @remarks
682
+ * 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
683
  */
594
684
  build?: BuildConfig;
595
685
  /**
@@ -619,37 +709,6 @@ interface BaseConfig {
619
709
  tsconfigRaw?: TSConfig;
620
710
  }
621
711
  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
712
  /**
654
713
  * Configuration options for the preview server
655
714
  */
@@ -722,14 +781,26 @@ interface CommonUserConfig extends BaseConfig {
722
781
  */
723
782
  framework?: string;
724
783
  }
725
- type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = CommonUserConfig & {
726
- build?: TBuildConfig & {
784
+ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = Omit<CommonUserConfig, "build"> & {
785
+ /**
786
+ * Configuration provided to build processes
787
+ *
788
+ * @remarks
789
+ * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
790
+ */
791
+ build: Omit<TBuildConfig, "override"> & {
727
792
  /**
728
793
  * The build variant being used by the Powerlines engine.
729
794
  */
730
795
  variant?: TBuildVariant;
796
+ /**
797
+ * An optional set of override options to apply to the selected build variant.
798
+ *
799
+ * @remarks
800
+ * 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.
801
+ */
802
+ override?: Partial<TBuildResolvedConfig>;
731
803
  };
732
- override?: Partial<TBuildResolvedConfig>;
733
804
  };
734
805
  type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "release" | "clean";
735
806
  /**
@@ -798,7 +869,13 @@ interface InitContextOptions {
798
869
  */
799
870
  isHighPriority: boolean;
800
871
  }
801
- interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
872
+ /**
873
+ * The unresolved Powerlines context.
874
+ *
875
+ * @remarks
876
+ * This context is used before the user configuration has been fully resolved after the `config`.
877
+ */
878
+ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
802
879
  /**
803
880
  * The Storm workspace configuration
804
881
  */
@@ -806,7 +883,10 @@ interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
806
883
  /**
807
884
  * An object containing the options provided to Powerlines
808
885
  */
809
- config: TResolvedConfig;
886
+ config: Omit<TResolvedConfig["userConfig"], "build" | "output"> & Required<Pick<TResolvedConfig["userConfig"], "build" | "output">> & {
887
+ projectRoot: NonUndefined<TResolvedConfig["userConfig"]["root"]>;
888
+ output: TResolvedConfig["output"];
889
+ };
810
890
  /**
811
891
  * A logging function for the Powerlines engine
812
892
  */
@@ -963,6 +1043,12 @@ interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
963
1043
  */
964
1044
  extendLog: (name: string) => LogFn;
965
1045
  }
1046
+ type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = Omit<UnresolvedContext<TResolvedConfig>, "config"> & {
1047
+ /**
1048
+ * The fully resolved Powerlines configuration
1049
+ */
1050
+ config: TResolvedConfig;
1051
+ };
966
1052
  interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig>, UnpluginContext {
967
1053
  /**
968
1054
  * The environment specific resolved configuration
@@ -1774,4 +1860,4 @@ interface SecretsInterface {
1774
1860
  ENCRYPTION_KEY: string;
1775
1861
  }
1776
1862
 
1777
- 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 };
1863
+ 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 };
@@ -1,11 +1,12 @@
1
1
  export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType } from './plugin.cjs';
2
- export { E as EnvInterface, S as SecretsInterface } from '../runtime-BRVCxO4z.cjs';
2
+ export { E as EnvInterface, S as SecretsInterface } from '../runtime-DsoL32bv.cjs';
3
3
  import '@alloy-js/core/jsx-runtime';
4
4
  import '@deepkit/type';
5
5
  import '@stryke/capnp';
6
6
  import '@stryke/env/types';
7
7
  import '@stryke/types/configuration';
8
8
  import '@stryke/env/get-env-paths';
9
+ import '@stryke/types/base';
9
10
  import '@stryke/types/package-json';
10
11
  import 'jiti';
11
12
  import 'oxc-parser';
@@ -15,7 +16,6 @@ import '@babel/core';
15
16
  import '@storm-software/build-tools/types';
16
17
  import '@storm-software/config-tools/types';
17
18
  import '@storm-software/config/types';
18
- import '@stryke/types/base';
19
19
  import '@stryke/types/file';
20
20
  import 'vite';
21
21
  import '@babel/helper-plugin-utils';
@@ -1,11 +1,12 @@
1
1
  export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType } from './plugin.js';
2
- export { E as EnvInterface, S as SecretsInterface } from '../runtime-nCpMYmRi.js';
2
+ export { E as EnvInterface, S as SecretsInterface } from '../runtime-DEVUXRrw.js';
3
3
  import '@alloy-js/core/jsx-runtime';
4
4
  import '@deepkit/type';
5
5
  import '@stryke/capnp';
6
6
  import '@stryke/env/types';
7
7
  import '@stryke/types/configuration';
8
8
  import '@stryke/env/get-env-paths';
9
+ import '@stryke/types/base';
9
10
  import '@stryke/types/package-json';
10
11
  import 'jiti';
11
12
  import 'oxc-parser';
@@ -15,7 +16,6 @@ import '@babel/core';
15
16
  import '@storm-software/build-tools/types';
16
17
  import '@storm-software/config-tools/types';
17
18
  import '@storm-software/config/types';
18
- import '@stryke/types/base';
19
19
  import '@stryke/types/file';
20
20
  import 'vite';
21
21
  import '@babel/helper-plugin-utils';
@@ -1,10 +1,11 @@
1
1
  import { Children } from '@alloy-js/core/jsx-runtime';
2
2
  import { ReflectionClass } from '@deepkit/type';
3
3
  import * as $ from '@stryke/capnp';
4
- import { B as BabelUserConfig, U as UserConfig, R as ResolvedConfig, c as BabelResolvedConfig, P as PluginContext, E as EnvInterface, S as SecretsInterface } from '../runtime-BRVCxO4z.cjs';
4
+ import { B as BabelUserConfig, c as UserConfig, R as ResolvedConfig, d as BabelResolvedConfig, P as PluginContext, E as EnvInterface, S as SecretsInterface } from '../runtime-DsoL32bv.cjs';
5
5
  import { DotenvParseOutput } from '@stryke/env/types';
6
6
  import { DotenvConfiguration, TypeDefinitionParameter, TypeDefinition } from '@stryke/types/configuration';
7
7
  import '@stryke/env/get-env-paths';
8
+ import '@stryke/types/base';
8
9
  import '@stryke/types/package-json';
9
10
  import 'jiti';
10
11
  import 'oxc-parser';
@@ -14,7 +15,6 @@ import '@babel/core';
14
15
  import '@storm-software/build-tools/types';
15
16
  import '@storm-software/config-tools/types';
16
17
  import '@storm-software/config/types';
17
- import '@stryke/types/base';
18
18
  import '@stryke/types/file';
19
19
  import 'vite';
20
20
  import '@babel/helper-plugin-utils';
@@ -1,10 +1,11 @@
1
1
  import { Children } from '@alloy-js/core/jsx-runtime';
2
2
  import { ReflectionClass } from '@deepkit/type';
3
3
  import * as $ from '@stryke/capnp';
4
- import { B as BabelUserConfig, U as UserConfig, R as ResolvedConfig, c as BabelResolvedConfig, P as PluginContext, E as EnvInterface, S as SecretsInterface } from '../runtime-nCpMYmRi.js';
4
+ import { B as BabelUserConfig, c as UserConfig, R as ResolvedConfig, d as BabelResolvedConfig, P as PluginContext, E as EnvInterface, S as SecretsInterface } from '../runtime-DEVUXRrw.js';
5
5
  import { DotenvParseOutput } from '@stryke/env/types';
6
6
  import { DotenvConfiguration, TypeDefinitionParameter, TypeDefinition } from '@stryke/types/configuration';
7
7
  import '@stryke/env/get-env-paths';
8
+ import '@stryke/types/base';
8
9
  import '@stryke/types/package-json';
9
10
  import 'jiti';
10
11
  import 'oxc-parser';
@@ -14,7 +15,6 @@ import '@babel/core';
14
15
  import '@storm-software/build-tools/types';
15
16
  import '@storm-software/config-tools/types';
16
17
  import '@storm-software/config/types';
17
- import '@stryke/types/base';
18
18
  import '@stryke/types/file';
19
19
  import 'vite';
20
20
  import '@babel/helper-plugin-utils';
@@ -1,5 +1,6 @@
1
- export { E as EnvInterface, S as SecretsInterface } from '../runtime-BRVCxO4z.cjs';
1
+ export { E as EnvInterface, S as SecretsInterface } from '../runtime-DsoL32bv.cjs';
2
2
  import '@stryke/env/get-env-paths';
3
+ import '@stryke/types/base';
3
4
  import '@stryke/types/package-json';
4
5
  import 'jiti';
5
6
  import 'oxc-parser';
@@ -9,7 +10,6 @@ import '@babel/core';
9
10
  import '@storm-software/build-tools/types';
10
11
  import '@storm-software/config-tools/types';
11
12
  import '@storm-software/config/types';
12
- import '@stryke/types/base';
13
13
  import '@stryke/types/configuration';
14
14
  import '@stryke/types/file';
15
15
  import 'vite';
@@ -1,5 +1,6 @@
1
- export { E as EnvInterface, S as SecretsInterface } from '../runtime-nCpMYmRi.js';
1
+ export { E as EnvInterface, S as SecretsInterface } from '../runtime-DEVUXRrw.js';
2
2
  import '@stryke/env/get-env-paths';
3
+ import '@stryke/types/base';
3
4
  import '@stryke/types/package-json';
4
5
  import 'jiti';
5
6
  import 'oxc-parser';
@@ -9,7 +10,6 @@ import '@babel/core';
9
10
  import '@storm-software/build-tools/types';
10
11
  import '@storm-software/config-tools/types';
11
12
  import '@storm-software/config/types';
12
- import '@stryke/types/base';
13
13
  import '@stryke/types/configuration';
14
14
  import '@stryke/types/file';
15
15
  import 'vite';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-env",
3
- "version": "0.13.14",
3
+ "version": "0.13.16",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
6
6
  "repository": {
@@ -179,10 +179,10 @@
179
179
  "@alloy-js/typescript": "^0.20.0",
180
180
  "@babel/core": "^7.28.5",
181
181
  "@babel/types": "^7.28.5",
182
- "@powerlines/alloy": "^0.11.17",
183
- "@powerlines/plugin-babel": "^0.12.17",
184
- "@powerlines/plugin-plugin": "^0.11.16",
185
- "@storm-software/config-tools": "^1.188.38",
182
+ "@powerlines/alloy": "^0.11.19",
183
+ "@powerlines/plugin-babel": "^0.12.19",
184
+ "@powerlines/plugin-plugin": "^0.11.18",
185
+ "@storm-software/config-tools": "^1.188.40",
186
186
  "@stryke/capnp": "^0.12.21",
187
187
  "@stryke/env": "^0.20.14",
188
188
  "@stryke/fs": "^0.32.13",
@@ -190,18 +190,18 @@
190
190
  "@stryke/string-format": "^0.12.2",
191
191
  "@stryke/type-checks": "^0.3.12",
192
192
  "@stryke/types": "^0.10.2",
193
- "powerlines": "^0.19.4"
193
+ "powerlines": "^0.20.0"
194
194
  },
195
195
  "devDependencies": {
196
196
  "@alloy-js/babel-preset": "^0.2.1",
197
197
  "@babel/preset-typescript": "^7.28.5",
198
- "@powerlines/nx": "^0.10.8",
199
- "@storm-software/tsup": "^0.2.36",
198
+ "@powerlines/nx": "^0.10.10",
199
+ "@storm-software/tsup": "^0.2.38",
200
200
  "@types/node": "^22.19.1",
201
201
  "tsup": "8.4.0",
202
202
  "typescript": "^5.9.3",
203
203
  "vite": "^7.2.2"
204
204
  },
205
205
  "publishConfig": { "access": "public" },
206
- "gitHead": "ab4911e45335c3ac4d162831f770181585c0d26f"
206
+ "gitHead": "e33924ab31dbf508b8983523edbaecffeebbee4f"
207
207
  }