@powerlines/plugin-env 0.16.254 → 0.16.255
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 +10 -10
- package/dist/babel/plugin.d.cts.map +1 -1
- package/dist/babel/plugin.d.mts.map +1 -1
- package/dist/babel/plugin.mjs +11 -11
- package/dist/babel/plugin.mjs.map +1 -1
- package/dist/components/docs.cjs +6 -23
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +9 -26
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/env-builtin.cjs +6 -6
- package/dist/components/env-builtin.mjs +6 -6
- package/dist/components/env-builtin.mjs.map +1 -1
- package/dist/helpers/index.cjs +4 -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.cjs +1 -1
- package/dist/helpers/load.mjs +1 -1
- package/dist/helpers/load.mjs.map +1 -1
- package/dist/helpers/schema.cjs +99 -10
- package/dist/helpers/schema.d.cts +16 -1
- package/dist/helpers/schema.d.cts.map +1 -1
- package/dist/helpers/schema.d.mts +16 -1
- package/dist/helpers/schema.d.mts.map +1 -1
- package/dist/helpers/schema.mjs +98 -12
- package/dist/helpers/schema.mjs.map +1 -1
- package/dist/index.cjs +6 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +8 -9
- 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 +9 -7
- package/dist/types/plugin.d.cts +11 -11
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +11 -11
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/plugin.mjs +9 -7
- package/dist/types/plugin.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -7,18 +7,17 @@ const require_helpers_automd_generator = require('./helpers/automd-generator.cjs
|
|
|
7
7
|
const require_components_docs = require('./components/docs.cjs');
|
|
8
8
|
const require_components_env_builtin = require('./components/env-builtin.cjs');
|
|
9
9
|
const require_babel_plugin = require('./babel/plugin.cjs');
|
|
10
|
+
let _stryke_path_join = require("@stryke/path/join");
|
|
10
11
|
let defu = require("defu");
|
|
11
12
|
defu = require_runtime.__toESM(defu);
|
|
12
13
|
let powerlines_plugin_utils = require("powerlines/plugin-utils");
|
|
13
14
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
14
|
-
let _stryke_path_join = require("@stryke/path/join");
|
|
15
15
|
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
16
16
|
let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
17
17
|
let _powerlines_plugin_automd = require("@powerlines/plugin-automd");
|
|
18
18
|
_powerlines_plugin_automd = require_runtime.__toESM(_powerlines_plugin_automd);
|
|
19
19
|
let _powerlines_plugin_babel = require("@powerlines/plugin-babel");
|
|
20
20
|
_powerlines_plugin_babel = require_runtime.__toESM(_powerlines_plugin_babel);
|
|
21
|
-
let _powerlines_schema_persistence = require("@powerlines/schema/persistence");
|
|
22
21
|
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
23
22
|
let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
|
|
24
23
|
|
|
@@ -49,9 +48,9 @@ const plugin = __assignType((options = {}) => {
|
|
|
49
48
|
plugins: [require_babel_plugin.envBabelPlugin]
|
|
50
49
|
}
|
|
51
50
|
};
|
|
52
|
-
if (!config.env.
|
|
53
|
-
this.warn("The `env.
|
|
54
|
-
config.env.
|
|
51
|
+
if (!config.env.config) {
|
|
52
|
+
this.warn("The `env.config` configuration parameter was not provided. Please ensure this is expected.");
|
|
53
|
+
config.env.config = await require_helpers_schema.getDefaultVarsTypeDefinition(this);
|
|
55
54
|
}
|
|
56
55
|
if (!config.env.secrets) config.env.secrets = await require_helpers_schema.getDefaultSecretsTypeDefinition(this);
|
|
57
56
|
config.env.prefix = (0, _stryke_convert_to_array.toArray)(config.env.prefix ?? []).reduce(__assignType((ret, prefix) => {
|
|
@@ -92,7 +91,7 @@ const plugin = __assignType((options = {}) => {
|
|
|
92
91
|
}, ["docs", "P\"/!"]),
|
|
93
92
|
buildEnd: __assignType(async function buildEnd() {
|
|
94
93
|
this.debug("Writing active environment variables to disk.");
|
|
95
|
-
await
|
|
94
|
+
await require_helpers_schema.writeEnv(this);
|
|
96
95
|
}, ["buildEnd", "P\"/!"])
|
|
97
96
|
},
|
|
98
97
|
{
|
|
@@ -123,12 +122,12 @@ const plugin = __assignType((options = {}) => {
|
|
|
123
122
|
]);
|
|
124
123
|
|
|
125
124
|
//#endregion
|
|
126
|
-
exports.__ΩEnv = require_types_plugin.__ΩEnv;
|
|
127
125
|
exports.__ΩEnvInterface = require_types_env.__ΩEnvInterface;
|
|
128
126
|
exports.__ΩEnvPluginContext = require_types_plugin.__ΩEnvPluginContext;
|
|
129
127
|
exports.__ΩEnvPluginOptions = require_types_plugin.__ΩEnvPluginOptions;
|
|
130
128
|
exports.__ΩEnvPluginResolvedConfig = require_types_plugin.__ΩEnvPluginResolvedConfig;
|
|
131
129
|
exports.__ΩEnvPluginUserConfig = require_types_plugin.__ΩEnvPluginUserConfig;
|
|
130
|
+
exports.__ΩEnvSchema = require_types_plugin.__ΩEnvSchema;
|
|
132
131
|
exports.__ΩEnvType = require_types_plugin.__ΩEnvType;
|
|
133
132
|
exports.__ΩSecretsInterface = require_types_env.__ΩSecretsInterface;
|
|
134
133
|
exports.default = plugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvSchema, EnvType } from "./types/plugin.cjs";
|
|
2
2
|
import { EnvInterface, SecretsInterface } from "./types/env.cjs";
|
|
3
3
|
import { Plugin } from "powerlines";
|
|
4
4
|
|
|
@@ -13,5 +13,5 @@ declare module "powerlines" {
|
|
|
13
13
|
*/
|
|
14
14
|
declare const plugin: <TContext extends EnvPluginContext = EnvPluginContext>(options?: EnvPluginOptions) => Plugin<TContext>[];
|
|
15
15
|
//#endregion
|
|
16
|
-
export {
|
|
16
|
+
export { EnvInterface, EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvSchema, EnvType, SecretsInterface, plugin as default, plugin };
|
|
17
17
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvSchema, EnvType } from "./types/plugin.mjs";
|
|
2
2
|
import { EnvInterface, SecretsInterface } from "./types/env.mjs";
|
|
3
3
|
import { Plugin } from "powerlines";
|
|
4
4
|
|
|
@@ -13,5 +13,5 @@ declare module "powerlines" {
|
|
|
13
13
|
*/
|
|
14
14
|
declare const plugin: <TContext extends EnvPluginContext = EnvPluginContext>(options?: EnvPluginOptions) => Plugin<TContext>[];
|
|
15
15
|
//#endregion
|
|
16
|
-
export {
|
|
16
|
+
export { EnvInterface, EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvSchema, EnvType, SecretsInterface, plugin as default, plugin };
|
|
17
17
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { __Ω
|
|
1
|
+
import { __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvSchema, __ΩEnvType } from "./types/plugin.mjs";
|
|
2
2
|
import { __ΩEnvInterface, __ΩSecretsInterface } from "./types/env.mjs";
|
|
3
|
-
import { extractEnv, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition } from "./helpers/schema.mjs";
|
|
3
|
+
import { extractEnv, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, writeEnv } from "./helpers/schema.mjs";
|
|
4
4
|
import { env } from "./helpers/automd-generator.mjs";
|
|
5
5
|
import { EnvDocsFile } from "./components/docs.mjs";
|
|
6
6
|
import { EnvBuiltin } from "./components/env-builtin.mjs";
|
|
7
7
|
import { envBabelPlugin } from "./babel/plugin.mjs";
|
|
8
|
+
import { joinPaths } from "@stryke/path/join";
|
|
8
9
|
import defu from "defu";
|
|
9
10
|
import { getDocsOutputPath } from "powerlines/plugin-utils";
|
|
10
11
|
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
11
|
-
import { joinPaths } from "@stryke/path/join";
|
|
12
12
|
import { getUnique } from "@stryke/helpers/get-unique";
|
|
13
13
|
import { render } from "@powerlines/plugin-alloy/render";
|
|
14
14
|
import automd from "@powerlines/plugin-automd";
|
|
15
15
|
import babel from "@powerlines/plugin-babel";
|
|
16
|
-
import { writeSchema } from "@powerlines/schema/persistence";
|
|
17
16
|
import { toArray } from "@stryke/convert/to-array";
|
|
18
17
|
import { constantCase } from "@stryke/string-format/constant-case";
|
|
19
18
|
|
|
@@ -44,9 +43,9 @@ const plugin = __assignType((options = {}) => {
|
|
|
44
43
|
plugins: [envBabelPlugin]
|
|
45
44
|
}
|
|
46
45
|
};
|
|
47
|
-
if (!config.env.
|
|
48
|
-
this.warn("The `env.
|
|
49
|
-
config.env.
|
|
46
|
+
if (!config.env.config) {
|
|
47
|
+
this.warn("The `env.config` configuration parameter was not provided. Please ensure this is expected.");
|
|
48
|
+
config.env.config = await getDefaultVarsTypeDefinition(this);
|
|
50
49
|
}
|
|
51
50
|
if (!config.env.secrets) config.env.secrets = await getDefaultSecretsTypeDefinition(this);
|
|
52
51
|
config.env.prefix = toArray(config.env.prefix ?? []).reduce(__assignType((ret, prefix) => {
|
|
@@ -87,7 +86,7 @@ const plugin = __assignType((options = {}) => {
|
|
|
87
86
|
}, ["docs", "P\"/!"]),
|
|
88
87
|
buildEnd: __assignType(async function buildEnd() {
|
|
89
88
|
this.debug("Writing active environment variables to disk.");
|
|
90
|
-
await
|
|
89
|
+
await writeEnv(this);
|
|
91
90
|
}, ["buildEnd", "P\"/!"])
|
|
92
91
|
},
|
|
93
92
|
{
|
|
@@ -118,5 +117,5 @@ const plugin = __assignType((options = {}) => {
|
|
|
118
117
|
]);
|
|
119
118
|
|
|
120
119
|
//#endregion
|
|
121
|
-
export { __Ω
|
|
120
|
+
export { __ΩEnvInterface, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvSchema, __ΩEnvType, __ΩSecretsInterface, plugin as default, plugin };
|
|
122
121
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"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 { render } from \"@powerlines/plugin-alloy/render\";\nimport automd from \"@powerlines/plugin-automd\";\nimport babel from \"@powerlines/plugin-babel\";\nimport {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"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 { render } from \"@powerlines/plugin-alloy/render\";\nimport automd from \"@powerlines/plugin-automd\";\nimport babel from \"@powerlines/plugin-babel\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport defu from \"defu\";\nimport type { Plugin, UnresolvedContext } from \"powerlines\";\nimport { getDocsOutputPath } from \"powerlines/plugin-utils\";\nimport type { UserConfig as ViteUserConfig } from \"vite\";\nimport { envBabelPlugin } from \"./babel/plugin\";\nimport { EnvDocsFile } from \"./components/docs\";\nimport { EnvBuiltin } from \"./components/env-builtin\";\nimport { env } from \"./helpers/automd-generator\";\nimport {\n extractEnv,\n getDefaultVarsTypeDefinition as getDefaultConfigTypeDefinition,\n getDefaultSecretsTypeDefinition,\n writeEnv\n} from \"./helpers/schema\";\nimport type { EnvPluginContext, EnvPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n env?: EnvPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to inject environment variables into the source code.\n */\nexport const plugin = <TContext extends EnvPluginContext = EnvPluginContext>(\n options: EnvPluginOptions = {}\n) => {\n return [\n babel(options.babel),\n {\n name: \"env\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `env` build plugin.\"\n );\n\n const config = {\n env: defu(options, {\n validate: false,\n inject: false,\n prefix: []\n }),\n babel: {\n ...options.babel,\n skipTransform: !options.inject,\n plugins: [envBabelPlugin]\n }\n };\n\n if (!config.env.config) {\n this.warn(\n \"The `env.config` configuration parameter was not provided. Please ensure this is expected.\"\n );\n\n config.env.config = await getDefaultConfigTypeDefinition(\n this as UnresolvedContext\n );\n }\n\n if (!config.env.secrets) {\n config.env.secrets = await getDefaultSecretsTypeDefinition(\n this as UnresolvedContext\n );\n }\n\n config.env.prefix = toArray(\n (config.env.prefix ?? []) as string[]\n ).reduce(\n (ret: string[], prefix: string) => {\n const formattedPrefix = constantCase(prefix);\n if (!ret.includes(formattedPrefix)) {\n ret.push(formattedPrefix);\n }\n\n return ret;\n },\n [\n \"POWERLINES_\",\n this.config.framework?.name &&\n this.config.framework?.name !== \"powerlines\" &&\n `${constantCase(this.config.framework?.name)}_`\n ].filter(Boolean) as string[]\n );\n\n config.env.prefix = getUnique(\n toArray(config.env.prefix).reduce((ret, prefix) => {\n if (!ret.includes(prefix.replace(/_$/g, \"\"))) {\n ret.push(prefix.replace(/_$/g, \"\"));\n }\n return ret;\n }, [] as string[])\n );\n\n return config;\n },\n async configResolved() {\n this.debug(\n `Environment plugin configuration has been resolved for the Powerlines project.`\n );\n\n await extractEnv(this);\n },\n async prepare() {\n this.debug(\n `Preparing the Environment runtime artifacts for the Powerlines project.`\n );\n\n return render(\n this,\n <EnvBuiltin defaultConfig={this.config.env.defaultConfig} />\n );\n },\n async docs() {\n this.debug(\n `Documenting environment variables configuration values in \"${joinPaths(\n getDocsOutputPath(this.config.root),\n \"env.md\"\n )}\"`\n );\n\n return render(this, <EnvDocsFile levelOffset={0} />);\n },\n async buildEnd() {\n this.debug(\"Writing active environment variables to disk.\");\n\n await writeEnv(this);\n }\n },\n {\n name: \"env:automd-generator\",\n configResolved() {\n return {\n automd: defu(options.automd ?? {}, {\n generators: {\n env: env(this)\n }\n })\n };\n }\n },\n {\n name: \"env:vite\",\n vite: {\n configResolved(this: TContext) {\n return {\n envPrefix: this.config?.env?.prefix\n } as ViteUserConfig;\n }\n }\n },\n automd(options.automd)\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;CAEE,GAAG,SAAS;;AAEd;;;;;CAqCA,OAAS;EAAA,MAAO,QAAO,KAAA;EAAA;;GAEvB,MAAQ,SAAQ;IACd,KAAS,MAAC,wEAAO;IACf,MAAM,SAAA;KACR,KAAA,KAAA,SAAA;MACF,UAAA;;MAEE,QAAA,CAAA;KACG,CAAA;KACH,OAAA;MACK,GAAM,QAAQ;MACX,eAAC,CAAA,QAAoB;MAC1B,SAAA,CAAA,cAAA;KACG;IACJ;IACA,IAAA,CAAA,OAAA,IAAA,QAAA;KACE,KAAO,KAAI,4FAAA;KACX,OAAM,IAAO,SAAE,MAAA,6BAAA,IAAA;IACf;IACA,IAAI,CAAC,OAAA,IAAU,SACb,OAAC,IAAA,UAAA,MAAA,gCAAA,IAAA;IAEH,OAAO,IAAC,SAAS,QAAA,OAAA,IAAA,UAAA,CAAA,CAAA,EAAA,OAAA,cAAA,KAAA,WAAA;KACf,MAAM,kBAAe,aAAA,MAAA;KACrB,IAAI,CAAA,IAAA,SAAU,eAAK,GACjB,IAAE,KAAO,eAAM;KAEjB,OAAI;IACN,GAAG;KAAC;KAAO;KAAA;KAAA;IAAA,CAAA,GAAA,CAAA,eAAA,KAAA,OAAA,WAAA,QAAA,KAAA,OAAA,WAAA,SAAA,gBAAA,GAAA,aAAA,KAAA,OAAA,WAAA,IAAA,EAAA,EAAA,EAAA,OAAA,OAAA,CAAA;IACX,OAAO,IAAE,SAAQ,UAAK,QAAA,OAAA,IAAA,MAAA,EAAA,OAAA,cAAA,KAAA,WAAA;KACpB,IAAI,CAAA,IAAA,SAAc,OAAE,QAAQ,OAAM,EAAA,CAAA,GAChC,IAAE,KAAO,OAAG,QAAA,OAAc,EAAA,CAAA;KAE5B,OAAC;;;;;;;IAEH,OAAO;GACT;GACA,gBAAc,aAAY,eAAc,iBAAkB;IACxD,KAAK,MAAA,gFAAA;;GAEP,GAAG,CAAC,kBAAa,OAAS,CAAA;GAC1B,SAAQ,aAAQ,eAAA,UAAA;IACd,MAAK,SAAA;IACL,KAAE,MAAA,yEAAA;sDAEA,IAAI,gBAAY;KACd,OAAO,OAAI,OAAU,IAAA;IACvB,EACF,CAAC,CAAC;GACJ,GAAG,CAAC,WAAA,OAAA,CAAA;;IAEF,KAAE,MAAO,8DAAoB,UAAA,kBAAA,KAAA,OAAA,IAAA,GAAA,QAAA,EAAA,EAAA;IAC7B,OAAK,OAAO,MAAI,gBAAiB,aAAO,EACtC,aAAQ,EACV,CAAC,CAAC;GACJ,GAAG,CAAC,QAAI,OAAM,CAAA;GACd,UAAU,aAAO,eAAS,WAAkB;IAC1C,KAAK,MAAM,+CAAsB;IACjC,MAAM,SAAA,IAAA;;EAEV;EAAG;GACD,MAAM;GACN,gBAAM,aAAA,SAAA,iBAAA;IACJ,OAAO,EACL,QAAQ,KAAC,QAAO,UAAe,CAAC,GAAC,EAC/B,YAAS,EACP,KAAK,IAAA,IAAA,EACP,EACF,CAAC;GAEL,GAAG,CAAC,kBAAkB,OAAE,CAAA;EAC1B;EAAG;GACD,MAAM;GACN,MAAM,EACJ,gBAAM,aAAA,SAAA,iBAAA;IACJ,OAAI,EACF,WAAS,KAAO,QAAC,KAAA,OACnB;;;;;;MAEJ;EACF;EAAG,OAAE,QAAA,MAAA;CAAA;AACP,GAAG;CAAC;CAAQ;QAAiB,CAAA;CAAA;CAAA;AAAA,CAAA"}
|
package/dist/types/index.cjs
CHANGED
|
@@ -2,11 +2,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
const require_types_plugin = require('./plugin.cjs');
|
|
3
3
|
const require_types_env = require('./env.cjs');
|
|
4
4
|
|
|
5
|
-
exports.__ΩEnv = require_types_plugin.__ΩEnv;
|
|
6
5
|
exports.__ΩEnvInterface = require_types_env.__ΩEnvInterface;
|
|
7
6
|
exports.__ΩEnvPluginContext = require_types_plugin.__ΩEnvPluginContext;
|
|
8
7
|
exports.__ΩEnvPluginOptions = require_types_plugin.__ΩEnvPluginOptions;
|
|
9
8
|
exports.__ΩEnvPluginResolvedConfig = require_types_plugin.__ΩEnvPluginResolvedConfig;
|
|
10
9
|
exports.__ΩEnvPluginUserConfig = require_types_plugin.__ΩEnvPluginUserConfig;
|
|
10
|
+
exports.__ΩEnvSchema = require_types_plugin.__ΩEnvSchema;
|
|
11
11
|
exports.__ΩEnvType = require_types_plugin.__ΩEnvType;
|
|
12
12
|
exports.__ΩSecretsInterface = require_types_env.__ΩSecretsInterface;
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvSchema, EnvType } from "./plugin.cjs";
|
|
2
2
|
import { EnvInterface, SecretsInterface } from "./env.cjs";
|
|
3
|
-
export {
|
|
3
|
+
export { EnvInterface, EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvSchema, EnvType, SecretsInterface };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvSchema, EnvType } from "./plugin.mjs";
|
|
2
2
|
import { EnvInterface, SecretsInterface } from "./env.mjs";
|
|
3
|
-
export {
|
|
3
|
+
export { EnvInterface, EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvSchema, EnvType, SecretsInterface };
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __Ω
|
|
1
|
+
import { __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvSchema, __ΩEnvType } from "./plugin.mjs";
|
|
2
2
|
import { __ΩEnvInterface, __ΩSecretsInterface } from "./env.mjs";
|
|
3
3
|
|
|
4
|
-
export { __Ω
|
|
4
|
+
export { __ΩEnvInterface, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvSchema, __ΩEnvType, __ΩSecretsInterface };
|
package/dist/types/plugin.cjs
CHANGED
|
@@ -35,7 +35,7 @@ const __ΩEnvType = [
|
|
|
35
35
|
const __ΩEnvPluginOptions = [
|
|
36
36
|
() => __ΩOmit,
|
|
37
37
|
"types",
|
|
38
|
-
"
|
|
38
|
+
"config",
|
|
39
39
|
"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\"`.",
|
|
40
40
|
"secrets",
|
|
41
41
|
"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\"`.",
|
|
@@ -76,17 +76,19 @@ const __ΩEnvPluginResolvedConfig = [
|
|
|
76
76
|
"EnvPluginResolvedConfig",
|
|
77
77
|
"P!PP!.#o\"#o!\"!P)4$?%)4&?'&F4(?)MK4*MKw+y"
|
|
78
78
|
];
|
|
79
|
-
const __Ω
|
|
79
|
+
const __ΩEnvSchema = [
|
|
80
80
|
"active",
|
|
81
|
-
"
|
|
82
|
-
"
|
|
81
|
+
"The list of active environment variables or secrets that should be injected into the source code when the {@link EnvPluginOptions.inject} option is enabled. This list is determined by filtering the properties defined in the schema based on the provided prefix and any additional filtering criteria defined in the type definition, such as an `active` property.",
|
|
82
|
+
"EnvSchema",
|
|
83
83
|
"P!P&F4!?\"MKw#y"
|
|
84
84
|
];
|
|
85
85
|
const __ΩEnvPluginContext = [
|
|
86
86
|
() => __ΩEnvPluginResolvedConfig,
|
|
87
87
|
"TResolvedConfig",
|
|
88
|
-
|
|
88
|
+
() => __ΩEnvSchema,
|
|
89
|
+
"config",
|
|
89
90
|
"The type definition for the expected env variable parameters",
|
|
91
|
+
() => __ΩEnvSchema,
|
|
90
92
|
"secrets",
|
|
91
93
|
"The type definition for the expected env secret parameters",
|
|
92
94
|
"parsed",
|
|
@@ -95,13 +97,13 @@ const __ΩEnvPluginContext = [
|
|
|
95
97
|
"The injected environment variables and secrets reflection",
|
|
96
98
|
"env",
|
|
97
99
|
"EnvPluginContext",
|
|
98
|
-
"n!c\"P!
|
|
100
|
+
"n!c\"P!Pn#4$?%n&4'?(!4)?*&F4+?,M4-Mw.y"
|
|
99
101
|
];
|
|
100
102
|
|
|
101
103
|
//#endregion
|
|
102
|
-
exports.__ΩEnv = __ΩEnv;
|
|
103
104
|
exports.__ΩEnvPluginContext = __ΩEnvPluginContext;
|
|
104
105
|
exports.__ΩEnvPluginOptions = __ΩEnvPluginOptions;
|
|
105
106
|
exports.__ΩEnvPluginResolvedConfig = __ΩEnvPluginResolvedConfig;
|
|
106
107
|
exports.__ΩEnvPluginUserConfig = __ΩEnvPluginUserConfig;
|
|
108
|
+
exports.__ΩEnvSchema = __ΩEnvSchema;
|
|
107
109
|
exports.__ΩEnvType = __ΩEnvType;
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Children } from "@alloy-js/core";
|
|
2
2
|
import { AutoMDPluginOptions } from "@powerlines/plugin-automd/types/plugin";
|
|
3
3
|
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types";
|
|
4
|
-
import {
|
|
4
|
+
import { Schema, SchemaInput } from "@powerlines/schema";
|
|
5
5
|
import { DotenvParseOutput } from "@stryke/env/types";
|
|
6
6
|
import { RequiredKeys } from "@stryke/types";
|
|
7
7
|
import { DotenvConfiguration } from "@stryke/types/configuration";
|
|
@@ -12,7 +12,7 @@ type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
|
|
|
12
12
|
/**
|
|
13
13
|
* 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"`.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
config?: SchemaInput;
|
|
16
16
|
/**
|
|
17
17
|
* 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"`.
|
|
18
18
|
*/
|
|
@@ -62,7 +62,7 @@ type EnvPluginUserConfig = BabelPluginUserConfig & {
|
|
|
62
62
|
env: EnvPluginOptions;
|
|
63
63
|
};
|
|
64
64
|
type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
|
|
65
|
-
env: Required<Pick<DotenvConfiguration, "additionalFiles">> & RequiredKeys<EnvPluginOptions, "
|
|
65
|
+
env: Required<Pick<DotenvConfiguration, "additionalFiles">> & RequiredKeys<EnvPluginOptions, "config" | "secrets" | "defaultConfig"> & {
|
|
66
66
|
/**
|
|
67
67
|
* Should the plugin inject the env variables in the source code with their values?
|
|
68
68
|
*
|
|
@@ -90,14 +90,14 @@ type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
|
|
|
90
90
|
* The schema for environment variables and secrets used by the plugin.
|
|
91
91
|
*
|
|
92
92
|
* @remarks
|
|
93
|
-
* This schema is the result of parsing the type definitions provided in the {@link EnvPluginOptions.
|
|
93
|
+
* This schema is the result of parsing the type definitions provided in the {@link EnvPluginOptions.config} and {@link EnvPluginOptions.secrets} options, and is used to validate the loaded environment variables and secrets, as well as to determine which variables should be injected into the source code when the {@link EnvPluginOptions.inject} option is enabled.
|
|
94
94
|
*/
|
|
95
|
-
type
|
|
95
|
+
type EnvSchema = Schema<Record<string, any>> & {
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
97
|
+
* The list of active environment variables or secrets that should be injected into the source code when the {@link EnvPluginOptions.inject} option is enabled. This list is determined by filtering the properties defined in the schema based on the provided prefix and any additional filtering criteria defined in the type definition, such as an `active` property.
|
|
98
98
|
*
|
|
99
99
|
* @remarks
|
|
100
|
-
*
|
|
100
|
+
* If the type definition includes an `active` property for each environment variable or secret, this list will be determined by including only the variables or secrets that have `active` set to `true`. If the type definition does not include an `active` property, all variables or secrets defined in the schema that match the provided prefix will be included in this list.
|
|
101
101
|
*/
|
|
102
102
|
active: string[];
|
|
103
103
|
};
|
|
@@ -107,16 +107,16 @@ interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = Env
|
|
|
107
107
|
* The type definition for the expected env variable parameters
|
|
108
108
|
*
|
|
109
109
|
* @remarks
|
|
110
|
-
* This value is parsed from the {@link EnvPluginOptions.
|
|
110
|
+
* This value is parsed from the {@link EnvPluginOptions.config} option.
|
|
111
111
|
*/
|
|
112
|
-
|
|
112
|
+
config: EnvSchema;
|
|
113
113
|
/**
|
|
114
114
|
* The type definition for the expected env secret parameters
|
|
115
115
|
*
|
|
116
116
|
* @remarks
|
|
117
117
|
* This value is parsed from the {@link EnvPluginOptions.secrets} option.
|
|
118
118
|
*/
|
|
119
|
-
secrets:
|
|
119
|
+
secrets: EnvSchema;
|
|
120
120
|
/**
|
|
121
121
|
* The parsed .env configuration object
|
|
122
122
|
*
|
|
@@ -134,5 +134,5 @@ interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = Env
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
//#endregion
|
|
137
|
-
export {
|
|
137
|
+
export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvSchema, EnvType };
|
|
138
138
|
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;KA+BY,OAAA;AAAA,KAEA,gBAAA,GAAmB,IAAA,CAAK,mBAAA;EAFxB;;;EAMV,
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;KA+BY,OAAA;AAAA,KAEA,gBAAA,GAAmB,IAAA,CAAK,mBAAA;EAFxB;;;EAMV,MAAA,GAAS,WAAA;EANQ;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;AAUZ;IAlBM,QAAA;IAkByB;;;;;;IAVzB,MAAA;EAAA;AAAA;;;;;;;KAUM,SAAA,GAAY,MAAM,CAAC,MAAA;EAYrB;;;;;;EALR,MAAA;AAAA;AAAA,UAGe,gBAAA,yBACS,uBAAA,GAA0B,uBAAA,UAC1C,kBAAA,CAAmB,eAAA;EAC3B,GAAA;IAOU;;;;;;IAAR,MAAA,EAAQ,SAAA;IAwBA;;;;;;IAhBR,OAAA,EAAS,SAAA;;;;;;;IAQT,MAAA,EAAQ,iBAAA;;;;;;;IAQR,QAAA;EAAA;AAAA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DotenvParseOutput } from "@stryke/env/types";
|
|
2
|
+
import { Schema, SchemaInput } from "@powerlines/schema";
|
|
2
3
|
import { Children } from "@alloy-js/core";
|
|
3
|
-
import { JsonSchema, Schema, SchemaInput } from "@powerlines/schema";
|
|
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";
|
|
@@ -12,7 +12,7 @@ type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
|
|
|
12
12
|
/**
|
|
13
13
|
* 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"`.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
config?: SchemaInput;
|
|
16
16
|
/**
|
|
17
17
|
* 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"`.
|
|
18
18
|
*/
|
|
@@ -62,7 +62,7 @@ type EnvPluginUserConfig = BabelPluginUserConfig & {
|
|
|
62
62
|
env: EnvPluginOptions;
|
|
63
63
|
};
|
|
64
64
|
type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
|
|
65
|
-
env: Required<Pick<DotenvConfiguration, "additionalFiles">> & RequiredKeys<EnvPluginOptions, "
|
|
65
|
+
env: Required<Pick<DotenvConfiguration, "additionalFiles">> & RequiredKeys<EnvPluginOptions, "config" | "secrets" | "defaultConfig"> & {
|
|
66
66
|
/**
|
|
67
67
|
* Should the plugin inject the env variables in the source code with their values?
|
|
68
68
|
*
|
|
@@ -90,14 +90,14 @@ type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
|
|
|
90
90
|
* The schema for environment variables and secrets used by the plugin.
|
|
91
91
|
*
|
|
92
92
|
* @remarks
|
|
93
|
-
* This schema is the result of parsing the type definitions provided in the {@link EnvPluginOptions.
|
|
93
|
+
* This schema is the result of parsing the type definitions provided in the {@link EnvPluginOptions.config} and {@link EnvPluginOptions.secrets} options, and is used to validate the loaded environment variables and secrets, as well as to determine which variables should be injected into the source code when the {@link EnvPluginOptions.inject} option is enabled.
|
|
94
94
|
*/
|
|
95
|
-
type
|
|
95
|
+
type EnvSchema = Schema<Record<string, any>> & {
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
97
|
+
* The list of active environment variables or secrets that should be injected into the source code when the {@link EnvPluginOptions.inject} option is enabled. This list is determined by filtering the properties defined in the schema based on the provided prefix and any additional filtering criteria defined in the type definition, such as an `active` property.
|
|
98
98
|
*
|
|
99
99
|
* @remarks
|
|
100
|
-
*
|
|
100
|
+
* If the type definition includes an `active` property for each environment variable or secret, this list will be determined by including only the variables or secrets that have `active` set to `true`. If the type definition does not include an `active` property, all variables or secrets defined in the schema that match the provided prefix will be included in this list.
|
|
101
101
|
*/
|
|
102
102
|
active: string[];
|
|
103
103
|
};
|
|
@@ -107,16 +107,16 @@ interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = Env
|
|
|
107
107
|
* The type definition for the expected env variable parameters
|
|
108
108
|
*
|
|
109
109
|
* @remarks
|
|
110
|
-
* This value is parsed from the {@link EnvPluginOptions.
|
|
110
|
+
* This value is parsed from the {@link EnvPluginOptions.config} option.
|
|
111
111
|
*/
|
|
112
|
-
|
|
112
|
+
config: EnvSchema;
|
|
113
113
|
/**
|
|
114
114
|
* The type definition for the expected env secret parameters
|
|
115
115
|
*
|
|
116
116
|
* @remarks
|
|
117
117
|
* This value is parsed from the {@link EnvPluginOptions.secrets} option.
|
|
118
118
|
*/
|
|
119
|
-
secrets:
|
|
119
|
+
secrets: EnvSchema;
|
|
120
120
|
/**
|
|
121
121
|
* The parsed .env configuration object
|
|
122
122
|
*
|
|
@@ -134,5 +134,5 @@ interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = Env
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
//#endregion
|
|
137
|
-
export {
|
|
137
|
+
export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvSchema, EnvType };
|
|
138
138
|
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;KA+BY,OAAA;AAAA,KAEA,gBAAA,GAAmB,IAAA,CAAK,mBAAA;EAFxB;;;EAMV,
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;KA+BY,OAAA;AAAA,KAEA,gBAAA,GAAmB,IAAA,CAAK,mBAAA;EAFxB;;;EAMV,MAAA,GAAS,WAAA;EANQ;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;AAUZ;IAlBM,QAAA;IAkByB;;;;;;IAVzB,MAAA;EAAA;AAAA;;;;;;;KAUM,SAAA,GAAY,MAAM,CAAC,MAAA;EAYrB;;;;;;EALR,MAAA;AAAA;AAAA,UAGe,gBAAA,yBACS,uBAAA,GAA0B,uBAAA,UAC1C,kBAAA,CAAmB,eAAA;EAC3B,GAAA;IAOU;;;;;;IAAR,MAAA,EAAQ,SAAA;IAwBA;;;;;;IAhBR,OAAA,EAAS,SAAA;;;;;;;IAQT,MAAA,EAAQ,iBAAA;;;;;;;IAQR,QAAA;EAAA;AAAA"}
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -33,7 +33,7 @@ const __ΩEnvType = [
|
|
|
33
33
|
const __ΩEnvPluginOptions = [
|
|
34
34
|
() => __ΩOmit,
|
|
35
35
|
"types",
|
|
36
|
-
"
|
|
36
|
+
"config",
|
|
37
37
|
"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\"`.",
|
|
38
38
|
"secrets",
|
|
39
39
|
"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\"`.",
|
|
@@ -74,17 +74,19 @@ const __ΩEnvPluginResolvedConfig = [
|
|
|
74
74
|
"EnvPluginResolvedConfig",
|
|
75
75
|
"P!PP!.#o\"#o!\"!P)4$?%)4&?'&F4(?)MK4*MKw+y"
|
|
76
76
|
];
|
|
77
|
-
const __Ω
|
|
77
|
+
const __ΩEnvSchema = [
|
|
78
78
|
"active",
|
|
79
|
-
"
|
|
80
|
-
"
|
|
79
|
+
"The list of active environment variables or secrets that should be injected into the source code when the {@link EnvPluginOptions.inject} option is enabled. This list is determined by filtering the properties defined in the schema based on the provided prefix and any additional filtering criteria defined in the type definition, such as an `active` property.",
|
|
80
|
+
"EnvSchema",
|
|
81
81
|
"P!P&F4!?\"MKw#y"
|
|
82
82
|
];
|
|
83
83
|
const __ΩEnvPluginContext = [
|
|
84
84
|
() => __ΩEnvPluginResolvedConfig,
|
|
85
85
|
"TResolvedConfig",
|
|
86
|
-
|
|
86
|
+
() => __ΩEnvSchema,
|
|
87
|
+
"config",
|
|
87
88
|
"The type definition for the expected env variable parameters",
|
|
89
|
+
() => __ΩEnvSchema,
|
|
88
90
|
"secrets",
|
|
89
91
|
"The type definition for the expected env secret parameters",
|
|
90
92
|
"parsed",
|
|
@@ -93,9 +95,9 @@ const __ΩEnvPluginContext = [
|
|
|
93
95
|
"The injected environment variables and secrets reflection",
|
|
94
96
|
"env",
|
|
95
97
|
"EnvPluginContext",
|
|
96
|
-
"n!c\"P!
|
|
98
|
+
"n!c\"P!Pn#4$?%n&4'?(!4)?*&F4+?,M4-Mw.y"
|
|
97
99
|
];
|
|
98
100
|
|
|
99
101
|
//#endregion
|
|
100
|
-
export { __Ω
|
|
102
|
+
export { __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvSchema, __ΩEnvType };
|
|
101
103
|
//# 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 {
|
|
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 { Schema, SchemaInput } 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 config?: 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, \"config\" | \"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 environment variables and secrets used by the plugin.\n *\n * @remarks\n * This schema is the result of parsing the type definitions provided in the {@link EnvPluginOptions.config} and {@link EnvPluginOptions.secrets} options, and is used to validate the loaded environment variables and secrets, as well as to determine which variables should be injected into the source code when the {@link EnvPluginOptions.inject} option is enabled.\n */\nexport type EnvSchema = Schema<Record<string, any>> & {\n /**\n * The list of active environment variables or secrets that should be injected into the source code when the {@link EnvPluginOptions.inject} option is enabled. This list is determined by filtering the properties defined in the schema based on the provided prefix and any additional filtering criteria defined in the type definition, such as an `active` property.\n *\n * @remarks\n * If the type definition includes an `active` property for each environment variable or secret, this list will be determined by including only the variables or secrets that have `active` set to `true`. If the type definition does not include an `active` property, all variables or secrets defined in the schema that match the provided prefix will be included in this list.\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.config} option.\n */\n config: 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;CAAY;CAAW;CAAW;AAAU;AAE3D,MAAM,sBAAmB;OAAQ;CAAS;CAAK;CAAa;CAAO;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAAA;;;;;;;AAInE,MAAC,6BAAkC;OAAO;OAAmB;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAAA;AAE7D,MAAC,eAAoB;CAAC;CAAU;CAAqB;CAAA;AAAA;AAErD,MAAM,sBAAqB;OAAQ;CAAC;OAAA;CAAA;CAAA;OAAA;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.255",
|
|
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.48.4",
|
|
111
|
-
"@powerlines/plugin-alloy": "0.26.145",
|
|
112
|
-
"@powerlines/plugin-automd": "0.1.521",
|
|
113
|
-
"@powerlines/plugin-babel": "0.13.56",
|
|
114
|
-
"@powerlines/plugin-plugin": "0.12.472",
|
|
115
|
-
"@powerlines/schema": "0.11.40",
|
|
110
|
+
"@powerlines/core": "^0.48.4",
|
|
111
|
+
"@powerlines/plugin-alloy": "^0.26.145",
|
|
112
|
+
"@powerlines/plugin-automd": "^0.1.521",
|
|
113
|
+
"@powerlines/plugin-babel": "^0.13.56",
|
|
114
|
+
"@powerlines/plugin-plugin": "^0.12.472",
|
|
115
|
+
"@powerlines/schema": "^0.11.40",
|
|
116
116
|
"@storm-software/config-tools": "^1.190.27",
|
|
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.60"
|
|
130
|
+
"powerlines": "^0.47.60"
|
|
131
131
|
},
|
|
132
132
|
"devDependencies": { "@types/node": "^25.9.1", "vite": "^8.0.14" },
|
|
133
133
|
"publishConfig": { "access": "public" },
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "1add836051e1df29707bfb90a9bc4813309062d5"
|
|
135
135
|
}
|