@powerlines/plugin-env 0.16.237 → 0.16.240
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/plugin.cjs +1 -1
- package/dist/babel/plugin.mjs +1 -1
- package/dist/components/docs.cjs +2 -2
- package/dist/components/docs.mjs +3 -3
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/env-builtin.cjs +14 -18
- package/dist/components/env-builtin.d.cts +1 -1
- package/dist/components/env-builtin.d.mts +1 -1
- package/dist/components/env-builtin.mjs +12 -16
- package/dist/components/env-builtin.mjs.map +1 -1
- package/dist/helpers/index.cjs +3 -1
- package/dist/helpers/index.d.cts +2 -2
- package/dist/helpers/index.d.mts +2 -2
- package/dist/helpers/index.mjs +2 -2
- package/dist/helpers/load.d.cts +2 -2
- package/dist/helpers/load.d.mts +2 -2
- package/dist/helpers/schema.cjs +48 -9
- package/dist/helpers/schema.d.cts +17 -4
- package/dist/helpers/schema.d.cts.map +1 -1
- package/dist/helpers/schema.d.mts +17 -4
- package/dist/helpers/schema.d.mts.map +1 -1
- package/dist/helpers/schema.mjs +48 -11
- package/dist/helpers/schema.mjs.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +2 -2
- package/dist/types/plugin.cjs +15 -5
- package/dist/types/plugin.d.cts +7 -4
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +8 -5
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/plugin.mjs +15 -5
- package/dist/types/plugin.mjs.map +1 -1
- package/package.json +9 -9
package/dist/types/plugin.d.cts
CHANGED
|
@@ -86,7 +86,10 @@ type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
|
|
|
86
86
|
prefix: string[];
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
-
|
|
89
|
+
/**
|
|
90
|
+
* The schema for the environment variables or secrets used by the project and expected to be injected into the source code (if {@link EnvPluginOptions.inject} is true). This schema extends the base {@link ObjectSchema} with additional metadata specific to environment variables, including an `active` property that lists the environment variables or secrets that are currently active and should be injected during the build process.
|
|
91
|
+
*/
|
|
92
|
+
interface EnvSchema<TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>> extends ObjectSchema<TMetadata> {
|
|
90
93
|
/**
|
|
91
94
|
* The active environment variables or secrets that are used by the project and are expected to be injected into the source code (if {@link EnvPluginOptions.inject} is true).
|
|
92
95
|
*/
|
|
@@ -100,14 +103,14 @@ interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = Env
|
|
|
100
103
|
* @remarks
|
|
101
104
|
* This value is parsed from the {@link EnvPluginOptions.vars} option.
|
|
102
105
|
*/
|
|
103
|
-
vars:
|
|
106
|
+
vars: EnvSchema;
|
|
104
107
|
/**
|
|
105
108
|
* The type definition for the expected env secret parameters
|
|
106
109
|
*
|
|
107
110
|
* @remarks
|
|
108
111
|
* This value is parsed from the {@link EnvPluginOptions.secrets} option.
|
|
109
112
|
*/
|
|
110
|
-
secrets:
|
|
113
|
+
secrets: EnvSchema;
|
|
111
114
|
/**
|
|
112
115
|
* The parsed .env configuration object
|
|
113
116
|
*
|
|
@@ -125,5 +128,5 @@ interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = Env
|
|
|
125
128
|
};
|
|
126
129
|
}
|
|
127
130
|
//#endregion
|
|
128
|
-
export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig,
|
|
131
|
+
export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvSchema, EnvType };
|
|
129
132
|
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;KAmCY,OAAA;AAAA,KAEA,gBAAA,GAAmB,IAAA,CAAK,mBAAA;EAFxB;;;EAMV,IAAA,GAAO,WAAA;EANU;AAEnB;;EASE,OAAA,GAAU,WAAA;EATwB;;;;;;EAiBlC,MAAA;EAsC4B;;;;;EA/B5B,MAAA;EAfA;;;;;EAsBA,QAAA;EAQgB;;;;;;EAAhB,aAAA,GAAgB,QAAA;EAmBN;;;;;;EAXV,KAAA,GAAQ,kBAAA;EAYa;AAAA;AAGvB;;;;EAPE,MAAA,GAAS,mBAAA;AAAA;AAAA,KAGC,mBAAA,GAAsB,qBAAA;EAChC,GAAA,EAAK,gBAAgB;AAAA;AAAA,KAGX,uBAAA,GAA0B,yBAAA;EACpC,GAAA,EAAK,QAAA,CAAS,IAAA,CAAK,mBAAA,wBACjB,YAAA,CAAa,gBAAA;IAFqB;;;;;;IAShC,MAAA;IAAA;;;;AAgBM;
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;KAmCY,OAAA;AAAA,KAEA,gBAAA,GAAmB,IAAA,CAAK,mBAAA;EAFxB;;;EAMV,IAAA,GAAO,WAAA;EANU;AAEnB;;EASE,OAAA,GAAU,WAAA;EATwB;;;;;;EAiBlC,MAAA;EAsC4B;;;;;EA/B5B,MAAA;EAfA;;;;;EAsBA,QAAA;EAQgB;;;;;;EAAhB,aAAA,GAAgB,QAAA;EAmBN;;;;;;EAXV,KAAA,GAAQ,kBAAA;EAYa;AAAA;AAGvB;;;;EAPE,MAAA,GAAS,mBAAA;AAAA;AAAA,KAGC,mBAAA,GAAsB,qBAAA;EAChC,GAAA,EAAK,gBAAgB;AAAA;AAAA,KAGX,uBAAA,GAA0B,yBAAA;EACpC,GAAA,EAAK,QAAA,CAAS,IAAA,CAAK,mBAAA,wBACjB,YAAA,CAAa,gBAAA;IAFqB;;;;;;IAShC,MAAA;IAAA;;;;AAgBM;AAOZ;IAfM,QAAA;IAeoB;;;;;;IAPpB,MAAA;EAAA;AAAA;;;;UAOW,SAAA,mBACG,OAAA,CAAQ,cAAA,IAAkB,OAAA,CAAQ,cAAA,WAC5C,YAAA,CAAa,SAAA;EAD+B;;;EAKpD,MAAA;AAAA;AAAA,UAGe,gBAAA,yBACS,uBAAA,GAA0B,uBAAA,UAC1C,kBAAA,CAAmB,eAAA;EAC3B,GAAA;IAH+B;;;;;;IAU7B,IAAA,EAAM,SAAA;IAgBE;;;;;;IARR,OAAA,EAAS,SAAA;IAhBH;;;;;;IAwBN,MAAA,EAAQ,iBAAA;IAAR;;;;AAQQ;;IAAR,QAAA;EAAA;AAAA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DotenvParseOutput } from "@stryke/env/types";
|
|
2
|
-
import { Children } from "@alloy-js/core";
|
|
3
2
|
import { ObjectSchema, SchemaInput, SchemaMetadata } from "@powerlines/schema";
|
|
3
|
+
import { Children } from "@alloy-js/core";
|
|
4
4
|
import { AutoMDPluginOptions } from "@powerlines/plugin-automd/types/plugin";
|
|
5
5
|
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types";
|
|
6
6
|
import { RequiredKeys } from "@stryke/types";
|
|
@@ -86,7 +86,10 @@ type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
|
|
|
86
86
|
prefix: string[];
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
-
|
|
89
|
+
/**
|
|
90
|
+
* The schema for the environment variables or secrets used by the project and expected to be injected into the source code (if {@link EnvPluginOptions.inject} is true). This schema extends the base {@link ObjectSchema} with additional metadata specific to environment variables, including an `active` property that lists the environment variables or secrets that are currently active and should be injected during the build process.
|
|
91
|
+
*/
|
|
92
|
+
interface EnvSchema<TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>> extends ObjectSchema<TMetadata> {
|
|
90
93
|
/**
|
|
91
94
|
* The active environment variables or secrets that are used by the project and are expected to be injected into the source code (if {@link EnvPluginOptions.inject} is true).
|
|
92
95
|
*/
|
|
@@ -100,14 +103,14 @@ interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = Env
|
|
|
100
103
|
* @remarks
|
|
101
104
|
* This value is parsed from the {@link EnvPluginOptions.vars} option.
|
|
102
105
|
*/
|
|
103
|
-
vars:
|
|
106
|
+
vars: EnvSchema;
|
|
104
107
|
/**
|
|
105
108
|
* The type definition for the expected env secret parameters
|
|
106
109
|
*
|
|
107
110
|
* @remarks
|
|
108
111
|
* This value is parsed from the {@link EnvPluginOptions.secrets} option.
|
|
109
112
|
*/
|
|
110
|
-
secrets:
|
|
113
|
+
secrets: EnvSchema;
|
|
111
114
|
/**
|
|
112
115
|
* The parsed .env configuration object
|
|
113
116
|
*
|
|
@@ -125,5 +128,5 @@ interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = Env
|
|
|
125
128
|
};
|
|
126
129
|
}
|
|
127
130
|
//#endregion
|
|
128
|
-
export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig,
|
|
131
|
+
export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvSchema, EnvType };
|
|
129
132
|
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;KAmCY,OAAA;AAAA,KAEA,gBAAA,GAAmB,IAAA,CAAK,mBAAA;EAFxB;;;EAMV,IAAA,GAAO,WAAA;EANU;AAEnB;;EASE,OAAA,GAAU,WAAA;EATwB;;;;;;EAiBlC,MAAA;EAsC4B;;;;;EA/B5B,MAAA;EAfA;;;;;EAsBA,QAAA;EAQgB;;;;;;EAAhB,aAAA,GAAgB,QAAA;EAmBN;;;;;;EAXV,KAAA,GAAQ,kBAAA;EAYa;AAAA;AAGvB;;;;EAPE,MAAA,GAAS,mBAAA;AAAA;AAAA,KAGC,mBAAA,GAAsB,qBAAA;EAChC,GAAA,EAAK,gBAAgB;AAAA;AAAA,KAGX,uBAAA,GAA0B,yBAAA;EACpC,GAAA,EAAK,QAAA,CAAS,IAAA,CAAK,mBAAA,wBACjB,YAAA,CAAa,gBAAA;IAFqB;;;;;;IAShC,MAAA;IAAA;;;;AAgBM;
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;KAmCY,OAAA;AAAA,KAEA,gBAAA,GAAmB,IAAA,CAAK,mBAAA;EAFxB;;;EAMV,IAAA,GAAO,WAAA;EANU;AAEnB;;EASE,OAAA,GAAU,WAAA;EATwB;;;;;;EAiBlC,MAAA;EAsC4B;;;;;EA/B5B,MAAA;EAfA;;;;;EAsBA,QAAA;EAQgB;;;;;;EAAhB,aAAA,GAAgB,QAAA;EAmBN;;;;;;EAXV,KAAA,GAAQ,kBAAA;EAYa;AAAA;AAGvB;;;;EAPE,MAAA,GAAS,mBAAA;AAAA;AAAA,KAGC,mBAAA,GAAsB,qBAAA;EAChC,GAAA,EAAK,gBAAgB;AAAA;AAAA,KAGX,uBAAA,GAA0B,yBAAA;EACpC,GAAA,EAAK,QAAA,CAAS,IAAA,CAAK,mBAAA,wBACjB,YAAA,CAAa,gBAAA;IAFqB;;;;;;IAShC,MAAA;IAAA;;;;AAgBM;AAOZ;IAfM,QAAA;IAeoB;;;;;;IAPpB,MAAA;EAAA;AAAA;;;;UAOW,SAAA,mBACG,OAAA,CAAQ,cAAA,IAAkB,OAAA,CAAQ,cAAA,WAC5C,YAAA,CAAa,SAAA;EAD+B;;;EAKpD,MAAA;AAAA;AAAA,UAGe,gBAAA,yBACS,uBAAA,GAA0B,uBAAA,UAC1C,kBAAA,CAAmB,eAAA;EAC3B,GAAA;IAH+B;;;;;;IAU7B,IAAA,EAAM,SAAA;IAgBE;;;;;;IARR,OAAA,EAAS,SAAA;IAhBH;;;;;;IAwBN,MAAA,EAAQ,iBAAA;IAAR;;;;AAQQ;;IAAR,QAAA;EAAA;AAAA"}
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -18,6 +18,11 @@ const __ΩPick = [
|
|
|
18
18
|
"Pick",
|
|
19
19
|
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
20
20
|
];
|
|
21
|
+
const __ΩPartial = [
|
|
22
|
+
"T",
|
|
23
|
+
"Partial",
|
|
24
|
+
"l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
|
|
25
|
+
];
|
|
21
26
|
const __ΩExclude = [
|
|
22
27
|
"T",
|
|
23
28
|
"U",
|
|
@@ -74,17 +79,22 @@ const __ΩEnvPluginResolvedConfig = [
|
|
|
74
79
|
"EnvPluginResolvedConfig",
|
|
75
80
|
"P!PP!.#o\"#o!\"!P)4$?%)4&?'&F4(?)MK4*MKw+y"
|
|
76
81
|
];
|
|
77
|
-
const __Ω
|
|
82
|
+
const __ΩEnvSchema = [
|
|
83
|
+
() => __ΩPartial,
|
|
84
|
+
"TMetadata",
|
|
78
85
|
"active",
|
|
79
86
|
"The active environment variables or secrets that are used by the project and are expected to be injected into the source code (if {@link EnvPluginOptions.inject} is true).",
|
|
80
|
-
"
|
|
81
|
-
"
|
|
87
|
+
"The schema for the environment variables or secrets used by the project and expected to be injected into the source code (if {@link EnvPluginOptions.inject} is true). This schema extends the base {@link ObjectSchema} with additional metadata specific to environment variables, including an `active` property that lists the environment variables or secrets that are currently active and should be injected during the build process.",
|
|
88
|
+
"EnvSchema",
|
|
89
|
+
"!o!\"c\"P!&F4#?$M?%w&y"
|
|
82
90
|
];
|
|
83
91
|
const __ΩEnvPluginContext = [
|
|
84
92
|
() => __ΩEnvPluginResolvedConfig,
|
|
85
93
|
"TResolvedConfig",
|
|
94
|
+
() => __ΩEnvSchema,
|
|
86
95
|
"vars",
|
|
87
96
|
"The type definition for the expected env variable parameters",
|
|
97
|
+
() => __ΩEnvSchema,
|
|
88
98
|
"secrets",
|
|
89
99
|
"The type definition for the expected env secret parameters",
|
|
90
100
|
"parsed",
|
|
@@ -93,9 +103,9 @@ const __ΩEnvPluginContext = [
|
|
|
93
103
|
"The injected environment variables and secrets reflection",
|
|
94
104
|
"env",
|
|
95
105
|
"EnvPluginContext",
|
|
96
|
-
"n!c\"P!
|
|
106
|
+
"n!c\"P!Pn#4$?%n&4'?(!4)?*&F4+?,M4-Mw.y"
|
|
97
107
|
];
|
|
98
108
|
|
|
99
109
|
//#endregion
|
|
100
|
-
export { __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __Ω
|
|
110
|
+
export { __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvSchema, __ΩEnvType };
|
|
101
111
|
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Children } from \"@alloy-js/core\";\nimport { AutoMDPluginOptions } from \"@powerlines/plugin-automd/types/plugin\";\nimport {\n BabelPluginContext,\n BabelPluginOptions,\n BabelPluginResolvedConfig,\n BabelPluginUserConfig\n} from \"@powerlines/plugin-babel/types\";\nimport type {\n ObjectSchema,\n SchemaInput,\n SchemaMetadata\n} from \"@powerlines/schema\";\nimport type { DotenvParseOutput } from \"@stryke/env/types\";\nimport { RequiredKeys } from \"@stryke/types\";\nimport { DotenvConfiguration } from \"@stryke/types/configuration\";\n\nexport type EnvType = \"env\" | \"secrets\";\n\nexport type EnvPluginOptions = Omit<DotenvConfiguration, \"types\"> & {\n /**\n * A path to the type definition for the expected env configuration parameters. This value can include both a path to the typescript file and the name of the type definition to use separated by a `\":\"` or `\"#\"` character. For example: `\"./src/types/env.ts#ConfigConfiguration\"`.\n */\n vars?: SchemaInput;\n\n /**\n * A path to the type definition for the expected env secret parameters. This value can include both a path to the typescript file and the name of the type definition to use separated by a `\":\"` or `\"#\"` character. For example: `\"./src/types/env.ts#ConfigSecrets\"`.\n */\n secrets?: SchemaInput;\n\n /**\n * An additional prefix (or list of additional prefixes) to apply to the environment variables\n *\n * @remarks\n * By default, the plugin will use the `POWERLINES_` prefix. This option is useful for avoiding conflicts with other environment variables.\n */\n prefix?: string | string[];\n\n /**\n * Should the plugin inject the env variables in the source code with their values?\n *\n * @defaultValue false\n */\n inject?: boolean;\n\n /**\n * Should the plugin validate the loaded environment variables against the provided type definitions?\n *\n * @defaultValue false\n */\n validate?: boolean;\n\n /**\n * The default configuration to use when loading environment variables.\n *\n * @remarks\n * This configuration is used as the base configuration when loading environment variables, and will be overridden by any values found in the `.env` file or the process environment.\n */\n defaultConfig?: Children;\n\n /**\n * Babel configuration options to use when injecting environment variables into the source code.\n *\n * @remarks\n * This option allows you to customize the Babel transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Babel settings.\n */\n babel?: BabelPluginOptions;\n\n /**\n * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.\n *\n * @remarks\n * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.\n */\n automd?: AutoMDPluginOptions;\n};\n\nexport type EnvPluginUserConfig = BabelPluginUserConfig & {\n env: EnvPluginOptions;\n};\n\nexport type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {\n env: Required<Pick<DotenvConfiguration, \"additionalFiles\">> &\n RequiredKeys<EnvPluginOptions, \"vars\" | \"secrets\" | \"defaultConfig\"> & {\n /**\n * Should the plugin inject the env variables in the source code with their values?\n *\n * @remarks\n * This value is the result of reflecting the {@link EnvPluginOptions.inject} option.\n */\n inject: boolean;\n\n /**\n * Should the plugin validate the loaded environment variables against the provided type definitions?\n *\n * @remarks\n * This value is the result of reflecting the {@link EnvPluginOptions.validate} option.\n */\n validate: boolean;\n\n /**\n * The prefix used for environment variables\n *\n * @remarks\n * This value is used to filter environment variables that are loaded from the .env file and the process environment.\n */\n prefix: string[];\n };\n};\n\nexport interface
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Children } from \"@alloy-js/core\";\nimport { AutoMDPluginOptions } from \"@powerlines/plugin-automd/types/plugin\";\nimport {\n BabelPluginContext,\n BabelPluginOptions,\n BabelPluginResolvedConfig,\n BabelPluginUserConfig\n} from \"@powerlines/plugin-babel/types\";\nimport type {\n ObjectSchema,\n SchemaInput,\n SchemaMetadata\n} from \"@powerlines/schema\";\nimport type { DotenvParseOutput } from \"@stryke/env/types\";\nimport { RequiredKeys } from \"@stryke/types\";\nimport { DotenvConfiguration } from \"@stryke/types/configuration\";\n\nexport type EnvType = \"env\" | \"secrets\";\n\nexport type EnvPluginOptions = Omit<DotenvConfiguration, \"types\"> & {\n /**\n * A path to the type definition for the expected env configuration parameters. This value can include both a path to the typescript file and the name of the type definition to use separated by a `\":\"` or `\"#\"` character. For example: `\"./src/types/env.ts#ConfigConfiguration\"`.\n */\n vars?: SchemaInput;\n\n /**\n * A path to the type definition for the expected env secret parameters. This value can include both a path to the typescript file and the name of the type definition to use separated by a `\":\"` or `\"#\"` character. For example: `\"./src/types/env.ts#ConfigSecrets\"`.\n */\n secrets?: SchemaInput;\n\n /**\n * An additional prefix (or list of additional prefixes) to apply to the environment variables\n *\n * @remarks\n * By default, the plugin will use the `POWERLINES_` prefix. This option is useful for avoiding conflicts with other environment variables.\n */\n prefix?: string | string[];\n\n /**\n * Should the plugin inject the env variables in the source code with their values?\n *\n * @defaultValue false\n */\n inject?: boolean;\n\n /**\n * Should the plugin validate the loaded environment variables against the provided type definitions?\n *\n * @defaultValue false\n */\n validate?: boolean;\n\n /**\n * The default configuration to use when loading environment variables.\n *\n * @remarks\n * This configuration is used as the base configuration when loading environment variables, and will be overridden by any values found in the `.env` file or the process environment.\n */\n defaultConfig?: Children;\n\n /**\n * Babel configuration options to use when injecting environment variables into the source code.\n *\n * @remarks\n * This option allows you to customize the Babel transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Babel settings.\n */\n babel?: BabelPluginOptions;\n\n /**\n * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.\n *\n * @remarks\n * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.\n */\n automd?: AutoMDPluginOptions;\n};\n\nexport type EnvPluginUserConfig = BabelPluginUserConfig & {\n env: EnvPluginOptions;\n};\n\nexport type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {\n env: Required<Pick<DotenvConfiguration, \"additionalFiles\">> &\n RequiredKeys<EnvPluginOptions, \"vars\" | \"secrets\" | \"defaultConfig\"> & {\n /**\n * Should the plugin inject the env variables in the source code with their values?\n *\n * @remarks\n * This value is the result of reflecting the {@link EnvPluginOptions.inject} option.\n */\n inject: boolean;\n\n /**\n * Should the plugin validate the loaded environment variables against the provided type definitions?\n *\n * @remarks\n * This value is the result of reflecting the {@link EnvPluginOptions.validate} option.\n */\n validate: boolean;\n\n /**\n * The prefix used for environment variables\n *\n * @remarks\n * This value is used to filter environment variables that are loaded from the .env file and the process environment.\n */\n prefix: string[];\n };\n};\n\n/**\n * The schema for the environment variables or secrets used by the project and expected to be injected into the source code (if {@link EnvPluginOptions.inject} is true). This schema extends the base {@link ObjectSchema} with additional metadata specific to environment variables, including an `active` property that lists the environment variables or secrets that are currently active and should be injected during the build process.\n */\nexport interface EnvSchema<\n TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>\n> extends ObjectSchema<TMetadata> {\n /**\n * The active environment variables or secrets that are used by the project and are expected to be injected into the source code (if {@link EnvPluginOptions.inject} is true).\n */\n active: string[];\n}\n\nexport interface EnvPluginContext<\n TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig\n> extends BabelPluginContext<TResolvedConfig> {\n env: {\n /**\n * The type definition for the expected env variable parameters\n *\n * @remarks\n * This value is parsed from the {@link EnvPluginOptions.vars} option.\n */\n vars: EnvSchema;\n\n /**\n * The type definition for the expected env secret parameters\n *\n * @remarks\n * This value is parsed from the {@link EnvPluginOptions.secrets} option.\n */\n secrets: EnvSchema;\n\n /**\n * The parsed .env configuration object\n *\n * @remarks\n * This value is the result of loading the .env configuration file found in the project root directory and merging it with the values provided at {@link EnvPluginOptions.values}\n */\n parsed: DotenvParseOutput;\n\n /**\n * The injected environment variables and secrets reflection\n *\n * @remarks\n * This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.\n */\n injected: string[];\n };\n}\n"],"mappings":";AAAA,MAAM,UAAU;CAAC;CAAK;OAAW;OAAe;CAAY;CAAQ;AAAC;;;;;;AAErE,MAAM,UAAU;CAAC;CAAI;CAAM;CAAQ;AAAG;;;;;;AAEtC,MAAM,aAAS;CAAA;CAAS;CAAG;CAAY;AAAoB;AAC3D,MAAI,aAAc;CAAA;CAAM;CAAc;CAAW;AAAK;AAEtD,MAAK,sBAAuB;OAAG;CAAa;CAAK;CAAS;CAAmB;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAAA;AAE7E,MAAC,yBAA0B;OAAQ;CAAc;CAAA;CAAA;AAAA;AAEjD,MAAC,6BAAkC;OAAK;OAAkB;CAAS;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-env",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.240",
|
|
4
4
|
"private": false,
|
|
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
|
"keywords": ["dotenv", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -107,12 +107,12 @@
|
|
|
107
107
|
"@alloy-js/typescript": "^0.23.0",
|
|
108
108
|
"@babel/core": "8.0.0-rc.5",
|
|
109
109
|
"@babel/types": "8.0.0-rc.5",
|
|
110
|
-
"@powerlines/core": "^0.15.
|
|
111
|
-
"@powerlines/plugin-alloy": "^0.26.
|
|
112
|
-
"@powerlines/plugin-automd": "^0.1.
|
|
113
|
-
"@powerlines/plugin-babel": "^0.13.
|
|
114
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
115
|
-
"@powerlines/schema": "^0.11.
|
|
110
|
+
"@powerlines/core": "^0.15.24",
|
|
111
|
+
"@powerlines/plugin-alloy": "^0.26.132",
|
|
112
|
+
"@powerlines/plugin-automd": "^0.1.508",
|
|
113
|
+
"@powerlines/plugin-babel": "^0.13.43",
|
|
114
|
+
"@powerlines/plugin-plugin": "^0.12.459",
|
|
115
|
+
"@powerlines/schema": "^0.11.27",
|
|
116
116
|
"@storm-software/config-tools": "^1.190.20",
|
|
117
117
|
"@stryke/capnp": "^0.12.102",
|
|
118
118
|
"@stryke/convert": "^0.7.7",
|
|
@@ -127,9 +127,9 @@
|
|
|
127
127
|
"automd": "^0.4.3",
|
|
128
128
|
"c12": "^3.3.4",
|
|
129
129
|
"defu": "^6.1.7",
|
|
130
|
-
"powerlines": "^0.47.
|
|
130
|
+
"powerlines": "^0.47.47"
|
|
131
131
|
},
|
|
132
132
|
"devDependencies": { "@types/node": "^25.9.0", "vite": "^8.0.13" },
|
|
133
133
|
"publishConfig": { "access": "public" },
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "fa8c4ae579471be5f678883ecb35d00ea17c29ba"
|
|
135
135
|
}
|