@powerlines/plugin-env 0.16.155 → 0.16.157
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/_virtual/_rolldown/runtime.cjs +1 -29
- package/dist/babel/index.cjs +1 -4
- package/dist/babel/index.mjs +1 -3
- package/dist/babel/plugin.cjs +4 -129
- package/dist/babel/plugin.mjs +4 -127
- package/dist/babel/plugin.mjs.map +1 -1
- package/dist/components/docs.cjs +1 -111
- package/dist/components/docs.mjs +1 -108
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/env-builtin.cjs +13 -730
- package/dist/components/env-builtin.mjs +11 -726
- package/dist/components/env-builtin.mjs.map +1 -1
- package/dist/components/index.cjs +1 -9
- package/dist/components/index.mjs +1 -4
- package/dist/helpers/automd-generator.cjs +1 -32
- package/dist/helpers/automd-generator.mjs +1 -30
- package/dist/helpers/automd-generator.mjs.map +1 -1
- package/dist/helpers/create-reflection-resource.cjs +1 -23
- package/dist/helpers/create-reflection-resource.mjs +1 -22
- package/dist/helpers/create-reflection-resource.mjs.map +1 -1
- package/dist/helpers/index.cjs +1 -34
- package/dist/helpers/index.mjs +1 -8
- package/dist/helpers/load.cjs +1 -139
- package/dist/helpers/load.mjs +1 -135
- package/dist/helpers/load.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +1 -308
- package/dist/helpers/persistence.mjs +1 -295
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/reflect.cjs +1 -290
- package/dist/helpers/reflect.mjs +1 -280
- package/dist/helpers/reflect.mjs.map +1 -1
- package/dist/helpers/source-file-env.cjs +1 -59
- package/dist/helpers/source-file-env.mjs +1 -56
- package/dist/helpers/source-file-env.mjs.map +1 -1
- package/dist/helpers/template-helpers.cjs +1 -70
- package/dist/helpers/template-helpers.mjs +1 -68
- package/dist/helpers/template-helpers.mjs.map +1 -1
- package/dist/index.cjs +1 -241
- package/dist/index.mjs +1 -234
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.cjs +1 -11
- package/dist/types/index.mjs +1 -4
- package/dist/types/plugin.cjs +1 -115
- package/dist/types/plugin.mjs +1 -109
- package/dist/types/plugin.mjs.map +1 -1
- package/dist/types/runtime.cjs +1 -535
- package/dist/types/runtime.mjs +1 -532
- package/dist/types/runtime.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -1,235 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { reflectEnv, reflectSecrets } from "./helpers/reflect.mjs";
|
|
3
|
-
import { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, writeEnvReflection, writeEnvTypeReflection } from "./helpers/persistence.mjs";
|
|
4
|
-
import { loadEnv } from "./helpers/load.mjs";
|
|
5
|
-
import { env } from "./helpers/automd-generator.mjs";
|
|
6
|
-
import { EnvDocsFile } from "./components/docs.mjs";
|
|
7
|
-
import { EnvBuiltin } from "./components/env-builtin.mjs";
|
|
8
|
-
import { envBabelPlugin } from "./babel/plugin.mjs";
|
|
9
|
-
import { ReflectionClass, ReflectionKind } from "@powerlines/deepkit/vendor/type";
|
|
10
|
-
import defu from "defu";
|
|
11
|
-
import { VIRTUAL_MODULE_PREFIX } from "powerlines/constants";
|
|
12
|
-
import { getDocsOutputPath } from "powerlines/plugin-utils";
|
|
13
|
-
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
14
|
-
import { joinPaths } from "@stryke/path/join";
|
|
15
|
-
import { getUnique } from "@stryke/helpers/get-unique";
|
|
16
|
-
import { render } from "@powerlines/plugin-alloy/render";
|
|
17
|
-
import automd from "@powerlines/plugin-automd";
|
|
18
|
-
import babel from "@powerlines/plugin-babel";
|
|
19
|
-
import deepkit from "@powerlines/plugin-deepkit";
|
|
20
|
-
import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
|
|
21
|
-
import { toArray } from "@stryke/convert/to-array";
|
|
22
|
-
import { existsSync } from "@stryke/fs/exists";
|
|
23
|
-
import { constantCase } from "@stryke/string-format/constant-case";
|
|
24
|
-
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
25
|
-
|
|
26
|
-
//#region src/index.tsx
|
|
27
|
-
function __assignType(fn, args) {
|
|
28
|
-
fn.__type = args;
|
|
29
|
-
return fn;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* A Powerlines plugin to inject environment variables into the source code.
|
|
33
|
-
*/
|
|
34
|
-
const plugin = __assignType((options = {}) => {
|
|
35
|
-
return [
|
|
36
|
-
deepkit(options.deepkit),
|
|
37
|
-
babel(options.babel),
|
|
38
|
-
{
|
|
39
|
-
name: "env:core",
|
|
40
|
-
async config() {
|
|
41
|
-
this.debug("Providing default configuration for the Powerlines `env` build plugin.");
|
|
42
|
-
const config = {
|
|
43
|
-
env: defu(options, {
|
|
44
|
-
types: {},
|
|
45
|
-
validate: false,
|
|
46
|
-
inject: false,
|
|
47
|
-
prefix: []
|
|
48
|
-
}),
|
|
49
|
-
babel: { plugins: [envBabelPlugin] },
|
|
50
|
-
deepkit: {
|
|
51
|
-
reflection: "default",
|
|
52
|
-
level: "all"
|
|
53
|
-
},
|
|
54
|
-
tsc: {}
|
|
55
|
-
};
|
|
56
|
-
if (isSetString(config.env.types) || config.env.types && isSetString(config.env.types.file)) {
|
|
57
|
-
config.env.types = parseTypeDefinition(config.env.types);
|
|
58
|
-
const file = await this.fs.resolve(config.env.types.file);
|
|
59
|
-
if (file) config.env.types.file = file;
|
|
60
|
-
} else {
|
|
61
|
-
this.warn("The `env.types` configuration parameter was not provided. Please ensure this is expected.");
|
|
62
|
-
const envDefaultTypeDefinition = await getEnvDefaultTypeDefinition(this);
|
|
63
|
-
const file = await this.fs.resolve(envDefaultTypeDefinition.file);
|
|
64
|
-
if (file) config.env.types = parseTypeDefinition(`${file}#${envDefaultTypeDefinition.name}`);
|
|
65
|
-
}
|
|
66
|
-
if (isSetString(config.env.secrets) || config.env.secrets && isSetString(config.env.secrets.file)) {
|
|
67
|
-
config.env.secrets = parseTypeDefinition(config.env.secrets);
|
|
68
|
-
const file = await this.fs.resolve(config.env.secrets.file);
|
|
69
|
-
if (file) config.env.secrets.file = file;
|
|
70
|
-
} else {
|
|
71
|
-
const secretsDefaultTypeDefinition = await getSecretsDefaultTypeDefinition(this);
|
|
72
|
-
const file = await this.fs.resolve(secretsDefaultTypeDefinition.file);
|
|
73
|
-
if (file) config.env.secrets = parseTypeDefinition(`${file}#${secretsDefaultTypeDefinition.name}`);
|
|
74
|
-
}
|
|
75
|
-
if (config.env.types || config.env.secrets) config.tsc.filter = { id: [new RegExp(`^(${VIRTUAL_MODULE_PREFIX})?${joinPaths(this.builtinsPath, "env.ts").replace(/\\/g, "\\\\").replace(/\//g, "\\/").replace(/\./g, "\\.").replace(/\$/g, "\\$")}$`)] };
|
|
76
|
-
config.env.prefix = toArray(config.env.prefix ?? []).reduce(__assignType((ret, prefix) => {
|
|
77
|
-
const formattedPrefix = constantCase(prefix);
|
|
78
|
-
if (!ret.includes(formattedPrefix)) ret.push(formattedPrefix);
|
|
79
|
-
return ret;
|
|
80
|
-
}, [
|
|
81
|
-
"ret",
|
|
82
|
-
"prefix",
|
|
83
|
-
"",
|
|
84
|
-
"P&F2!&2\"\"/#"
|
|
85
|
-
]), ["POWERLINES_", this.config.framework && this.config.framework !== "powerlines" && `${constantCase(this.config.framework)}_`].filter(Boolean));
|
|
86
|
-
config.env.prefix = getUnique(toArray(config.env.prefix).reduce(__assignType((ret, prefix) => {
|
|
87
|
-
if (!ret.includes(prefix.replace(/_$/g, ""))) ret.push(prefix.replace(/_$/g, ""));
|
|
88
|
-
return ret;
|
|
89
|
-
}, [
|
|
90
|
-
"ret",
|
|
91
|
-
"prefix",
|
|
92
|
-
"",
|
|
93
|
-
"P\"2!\"2\"\"/#"
|
|
94
|
-
]), []));
|
|
95
|
-
return config;
|
|
96
|
-
},
|
|
97
|
-
async configResolved() {
|
|
98
|
-
this.debug(`Environment plugin configuration has been resolved for the Powerlines project.`);
|
|
99
|
-
this.env = defu({ parsed: await loadEnv(this, this.config.env) }, this.env ?? {}, {
|
|
100
|
-
types: { env: {} },
|
|
101
|
-
used: {
|
|
102
|
-
env: {},
|
|
103
|
-
secrets: {}
|
|
104
|
-
},
|
|
105
|
-
parsed: {},
|
|
106
|
-
injected: {}
|
|
107
|
-
});
|
|
108
|
-
if (this.config.command !== "prepare" && !this.config.skipCache && this.persistedMeta?.checksum === this.meta.checksum && existsSync(getEnvTypeReflectionsPath(this, "env"))) {
|
|
109
|
-
this.debug(`Skipping reflection initialization as the meta checksum has not changed.`);
|
|
110
|
-
this.env.types.env = await readEnvTypeReflection(this, "env");
|
|
111
|
-
if (existsSync(getEnvReflectionsPath(this, "env"))) this.env.used.env = await readEnvReflection(this);
|
|
112
|
-
if (existsSync(getEnvTypeReflectionsPath(this, "secrets"))) this.env.types.secrets = await readEnvTypeReflection(this, "secrets");
|
|
113
|
-
if (existsSync(getEnvReflectionsPath(this, "secrets"))) this.env.used.secrets = await readSecretsReflection(this);
|
|
114
|
-
} else {
|
|
115
|
-
this.debug(`Starting environment configuration reflection initialization.`);
|
|
116
|
-
this.env.types.env = await reflectEnv(this, this.config.env.types?.file, this.config.env.types?.name);
|
|
117
|
-
if (!this.env.types.env) throw new Error("Failed to find the environment configuration type reflection in the context.");
|
|
118
|
-
await writeEnvTypeReflection(this, this.env.types.env, "env");
|
|
119
|
-
this.env.types.secrets = await reflectSecrets(this, this.config.env.secrets?.file, this.config.env.secrets?.name);
|
|
120
|
-
if (!this.env.types.secrets) throw new Error("Failed to find the secrets configuration type reflection in the context.");
|
|
121
|
-
await writeEnvTypeReflection(this, this.env.types.secrets, "secrets");
|
|
122
|
-
this.debug(`Resolved ${this.env.types.env.getProperties().length ?? 0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length ?? 0} secret configuration parameters`);
|
|
123
|
-
const envWithAlias = this.env.types.env.getProperties().filter(__assignType((prop) => prop.getAlias().length > 0, [
|
|
124
|
-
"prop",
|
|
125
|
-
"",
|
|
126
|
-
"P\"2!\"/\""
|
|
127
|
-
]));
|
|
128
|
-
Object.entries(await loadEnv(this, this.config.env)).forEach(__assignType(([key, value]) => {
|
|
129
|
-
const unprefixedKey = this.config.env.prefix.reduce(__assignType((ret, prefix) => {
|
|
130
|
-
if (key.replace(/_$/g, "").startsWith(prefix)) return key.replace(/_$/g, "").slice(prefix.length);
|
|
131
|
-
return ret;
|
|
132
|
-
}, [
|
|
133
|
-
"ret",
|
|
134
|
-
"prefix",
|
|
135
|
-
"",
|
|
136
|
-
"P\"2!\"2\"\"/#"
|
|
137
|
-
]), key);
|
|
138
|
-
const aliasKey = envWithAlias.find(__assignType((prop) => prop?.getAlias().reverse().includes(unprefixedKey), [
|
|
139
|
-
"prop",
|
|
140
|
-
"",
|
|
141
|
-
"P\"2!\"/\""
|
|
142
|
-
]));
|
|
143
|
-
if (this.env.types.env?.hasProperty(unprefixedKey) || aliasKey) this.env.types.env.getProperty(unprefixedKey).setDefaultValue(value);
|
|
144
|
-
}, [
|
|
145
|
-
"param0",
|
|
146
|
-
"",
|
|
147
|
-
"P\"2!\"/\""
|
|
148
|
-
]));
|
|
149
|
-
this.env.used.env = new ReflectionClass({
|
|
150
|
-
kind: ReflectionKind.objectLiteral,
|
|
151
|
-
typeName: "Env",
|
|
152
|
-
description: `An object containing the environment configuration parameters used by the ${this.config.name ? `${this.config.name} application` : "application"}.`,
|
|
153
|
-
types: []
|
|
154
|
-
}, this.env.types.env);
|
|
155
|
-
await writeEnvReflection(this, this.env.used.env, "env");
|
|
156
|
-
if (this.env.types.secrets) {
|
|
157
|
-
await writeEnvTypeReflection(this, this.env.types.secrets, "secrets");
|
|
158
|
-
this.env.used.secrets = new ReflectionClass({
|
|
159
|
-
kind: ReflectionKind.objectLiteral,
|
|
160
|
-
typeName: "Secrets",
|
|
161
|
-
description: `An object containing the secret configuration parameters used by the ${this.config.name ? `${this.config.name} application` : "application"}.`,
|
|
162
|
-
types: []
|
|
163
|
-
}, this.env.types.secrets);
|
|
164
|
-
await writeEnvReflection(this, this.env.used.secrets, "secrets");
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
prepare: __assignType(async function prepare() {
|
|
169
|
-
const _self$ = this;
|
|
170
|
-
this.debug(`Preparing the Environment runtime artifacts for the Powerlines project.`);
|
|
171
|
-
const result = await readEnvTypeReflection(this, "env");
|
|
172
|
-
return render(this, createComponent(EnvBuiltin, {
|
|
173
|
-
get defaultConfig() {
|
|
174
|
-
return _self$.config.env.defaultConfig;
|
|
175
|
-
},
|
|
176
|
-
reflection: result
|
|
177
|
-
}));
|
|
178
|
-
}, ["prepare", "P\"/!"]),
|
|
179
|
-
transform: {
|
|
180
|
-
order: "post",
|
|
181
|
-
handler: __assignType(async function handler() {
|
|
182
|
-
if (this.env.used.env.getProperties().length > 0) {
|
|
183
|
-
this.trace(`Persisting used environment configuration reflections to ${getEnvReflectionsPath(this, "env")}.`);
|
|
184
|
-
await writeEnvReflection(this, this.env.used.env, "env");
|
|
185
|
-
}
|
|
186
|
-
if (this.env.used.secrets.getProperties().length > 0) {
|
|
187
|
-
this.trace(`Persisting used secret configuration reflections to ${getEnvReflectionsPath(this, "secrets")}.`);
|
|
188
|
-
await writeEnvReflection(this, this.env.used.secrets, "secrets");
|
|
189
|
-
}
|
|
190
|
-
}, ["handler", "P\"/!"])
|
|
191
|
-
},
|
|
192
|
-
docs: __assignType(async function docs() {
|
|
193
|
-
this.debug(`Documenting environment variables configuration values in "${joinPaths(getDocsOutputPath(this.config.root), "env.md")}"`);
|
|
194
|
-
const result = await readEnvTypeReflection(this, "env");
|
|
195
|
-
return render(this, createComponent(EnvDocsFile, {
|
|
196
|
-
levelOffset: 0,
|
|
197
|
-
reflection: result
|
|
198
|
-
}));
|
|
199
|
-
}, ["docs", "P\"/!"]),
|
|
200
|
-
buildEnd: __assignType(async function buildEnd() {
|
|
201
|
-
const reflectionPath = getEnvReflectionsPath(this, "env");
|
|
202
|
-
this.debug(`Writing env reflection types to ${reflectionPath}.`);
|
|
203
|
-
await writeEnvReflection(this, this.env.used.env, "env");
|
|
204
|
-
}, ["buildEnd", "P\"/!"])
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
name: "env:automd-generator",
|
|
208
|
-
config: __assignType(function config() {
|
|
209
|
-
return { automd: defu(options.automd ?? {}, { generators: { env: env(this) } }) };
|
|
210
|
-
}, ["config", "P\"/!"])
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
name: "env:vite",
|
|
214
|
-
vite: { configResolved: __assignType(function configResolved() {
|
|
215
|
-
return { envPrefix: this.config?.env?.prefix };
|
|
216
|
-
}, [
|
|
217
|
-
() => __ΩEnvPluginContext,
|
|
218
|
-
"this",
|
|
219
|
-
"configResolved",
|
|
220
|
-
"Pn!2\"\"/#"
|
|
221
|
-
]) }
|
|
222
|
-
},
|
|
223
|
-
automd(options.automd)
|
|
224
|
-
];
|
|
225
|
-
}, [
|
|
226
|
-
() => __ΩEnvPluginOptions,
|
|
227
|
-
"options",
|
|
228
|
-
() => ({}),
|
|
229
|
-
"",
|
|
230
|
-
"Pn!2\">#\"/$"
|
|
231
|
-
]);
|
|
232
|
-
|
|
233
|
-
//#endregion
|
|
234
|
-
export { plugin as default, plugin };
|
|
1
|
+
import{__ΩEnvPluginContext as e,__ΩEnvPluginOptions as t}from"./types/plugin.mjs";import{reflectEnv as n,reflectSecrets as r}from"./helpers/reflect.mjs";import{getEnvDefaultTypeDefinition as i,getEnvReflectionsPath as a,getEnvTypeReflectionsPath as o,getSecretsDefaultTypeDefinition as s,readEnvReflection as c,readEnvTypeReflection as l,readSecretsReflection as u,writeEnvReflection as d,writeEnvTypeReflection as f}from"./helpers/persistence.mjs";import{loadEnv as p}from"./helpers/load.mjs";import{env as m}from"./helpers/automd-generator.mjs";import{EnvDocsFile as h}from"./components/docs.mjs";import{EnvBuiltin as g}from"./components/env-builtin.mjs";import{envBabelPlugin as _}from"./babel/plugin.mjs";import{ReflectionClass as v,ReflectionKind as y}from"@powerlines/deepkit/vendor/type";import b from"defu";import{VIRTUAL_MODULE_PREFIX as x}from"powerlines/constants";import{getDocsOutputPath as S}from"powerlines/plugin-utils";import{createComponent as C}from"@alloy-js/core/jsx-runtime";import{joinPaths as w}from"@stryke/path/join";import{getUnique as T}from"@stryke/helpers/get-unique";import{render as E}from"@powerlines/plugin-alloy/render";import D from"@powerlines/plugin-automd";import O from"@powerlines/plugin-babel";import k from"@powerlines/plugin-deepkit";import{parseTypeDefinition as A}from"@stryke/convert/parse-type-definition";import{toArray as j}from"@stryke/convert/to-array";import{existsSync as M}from"@stryke/fs/exists";import{constantCase as N}from"@stryke/string-format/constant-case";import{isSetString as P}from"@stryke/type-checks/is-set-string";function F(e,t){return e.__type=t,e}const I=F((t={})=>[k(t.deepkit),O(t.babel),{name:`env:core`,async config(){this.debug("Providing default configuration for the Powerlines `env` build plugin.");let e={env:b(t,{types:{},validate:!1,inject:!1,prefix:[]}),babel:{plugins:[_]},deepkit:{reflection:`default`,level:`all`},tsc:{}};if(P(e.env.types)||e.env.types&&P(e.env.types.file)){e.env.types=A(e.env.types);let t=await this.fs.resolve(e.env.types.file);t&&(e.env.types.file=t)}else{this.warn("The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await i(this),n=await this.fs.resolve(t.file);n&&(e.env.types=A(`${n}#${t.name}`))}if(P(e.env.secrets)||e.env.secrets&&P(e.env.secrets.file)){e.env.secrets=A(e.env.secrets);let t=await this.fs.resolve(e.env.secrets.file);t&&(e.env.secrets.file=t)}else{let t=await s(this),n=await this.fs.resolve(t.file);n&&(e.env.secrets=A(`${n}#${t.name}`))}return(e.env.types||e.env.secrets)&&(e.tsc.filter={id:[RegExp(`^(${x})?${w(this.builtinsPath,`env.ts`).replace(/\\/g,`\\\\`).replace(/\//g,`\\/`).replace(/\./g,`\\.`).replace(/\$/g,`\\$`)}$`)]}),e.env.prefix=j(e.env.prefix??[]).reduce(F((e,t)=>{let n=N(t);return e.includes(n)||e.push(n),e},[`ret`,`prefix`,``,`P&F2!&2""/#`]),[`POWERLINES_`,this.config.framework&&this.config.framework!==`powerlines`&&`${N(this.config.framework)}_`].filter(Boolean)),e.env.prefix=T(j(e.env.prefix).reduce(F((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[`ret`,`prefix`,``,`P"2!"2""/#`]),[])),e},async configResolved(){if(this.debug(`Environment plugin configuration has been resolved for the Powerlines project.`),this.env=b({parsed:await p(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&!this.config.skipCache&&this.persistedMeta?.checksum===this.meta.checksum&&M(o(this,`env`)))this.debug(`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await l(this,`env`),M(a(this,`env`))&&(this.env.used.env=await c(this)),M(o(this,`secrets`))&&(this.env.types.secrets=await l(this,`secrets`)),M(a(this,`secrets`))&&(this.env.used.secrets=await u(this));else{if(this.debug(`Starting environment configuration reflection initialization.`),this.env.types.env=await n(this,this.config.env.types?.file,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await f(this,this.env.types.env,`env`),this.env.types.secrets=await r(this,this.config.env.secrets?.file,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await f(this,this.env.types.secrets,`secrets`),this.debug(`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let e=this.env.types.env.getProperties().filter(F(e=>e.getAlias().length>0,[`prop`,``,`P"2!"/"`]));Object.entries(await p(this,this.config.env)).forEach(F(([t,n])=>{let r=this.config.env.prefix.reduce(F((e,n)=>t.replace(/_$/g,``).startsWith(n)?t.replace(/_$/g,``).slice(n.length):e,[`ret`,`prefix`,``,`P"2!"2""/#`]),t),i=e.find(F(e=>e?.getAlias().reverse().includes(r),[`prop`,``,`P"2!"/"`]));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(n)},[`param0`,``,`P"2!"/"`])),this.env.used.env=new v({kind:y.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await d(this,this.env.used.env,`env`),this.env.types.secrets&&(await f(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new v({kind:y.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await d(this,this.env.used.secrets,`secrets`))}},prepare:F(async function(){let e=this;this.debug(`Preparing the Environment runtime artifacts for the Powerlines project.`);let t=await l(this,`env`);return E(this,C(g,{get defaultConfig(){return e.config.env.defaultConfig},reflection:t}))},[`prepare`,`P"/!`]),transform:{order:`post`,handler:F(async function(){this.env.used.env.getProperties().length>0&&(this.trace(`Persisting used environment configuration reflections to ${a(this,`env`)}.`),await d(this,this.env.used.env,`env`)),this.env.used.secrets.getProperties().length>0&&(this.trace(`Persisting used secret configuration reflections to ${a(this,`secrets`)}.`),await d(this,this.env.used.secrets,`secrets`))},[`handler`,`P"/!`])},docs:F(async function(){this.debug(`Documenting environment variables configuration values in "${w(S(this.config.root),`env.md`)}"`);let e=await l(this,`env`);return E(this,C(h,{levelOffset:0,reflection:e}))},[`docs`,`P"/!`]),buildEnd:F(async function(){let e=a(this,`env`);this.debug(`Writing env reflection types to ${e}.`),await d(this,this.env.used.env,`env`)},[`buildEnd`,`P"/!`])},{name:`env:automd-generator`,config:F(function(){return{automd:b(t.automd??{},{generators:{env:m(this)}})}},[`config`,`P"/!`])},{name:`env:vite`,vite:{configResolved:F(function(){return{envPrefix:this.config?.env?.prefix}},[()=>e,`this`,`configResolved`,`Pn!2""/#`])}},D(t.automd)],[()=>t,`options`,()=>({}),``,`Pn!2">#"/$`]);export{I as default,I as plugin};
|
|
235
2
|
//# 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 {\n ReflectionClass,\n ReflectionKind\n} from \"@powerlines/deepkit/vendor/type\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport automd from \"@powerlines/plugin-automd\";\nimport babel from \"@powerlines/plugin-babel\";\nimport deepkit from \"@powerlines/plugin-deepkit\";\nimport { TypeScriptCompilerPluginUserConfig } from \"@powerlines/plugin-tsc\";\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { VIRTUAL_MODULE_PREFIX } from \"powerlines/constants\";\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 { loadEnv } from \"./helpers/load\";\nimport {\n getEnvDefaultTypeDefinition,\n getEnvReflectionsPath,\n getEnvTypeReflectionsPath,\n getSecretsDefaultTypeDefinition,\n readEnvReflection,\n readEnvTypeReflection,\n readSecretsReflection,\n writeEnvReflection,\n writeEnvTypeReflection\n} from \"./helpers/persistence\";\nimport { reflectEnv, reflectSecrets } from \"./helpers/reflect\";\nimport { EnvPluginContext, EnvPluginOptions } from \"./types/plugin\";\n\nexport type * 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 deepkit(options.deepkit),\n babel(options.babel),\n {\n name: \"env:core\",\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 types: {} as TypeDefinitionParameter,\n validate: false,\n inject: false,\n prefix: []\n }),\n babel: {\n plugins: [envBabelPlugin]\n },\n deepkit: {\n reflection: \"default\",\n level: \"all\"\n },\n tsc: {} as TypeScriptCompilerPluginUserConfig[\"tsc\"]\n };\n\n if (\n isSetString(config.env.types) ||\n (config.env.types && isSetString(config.env.types.file))\n ) {\n config.env.types = parseTypeDefinition(\n config.env.types\n ) as TypeDefinition;\n\n const file = await this.fs.resolve(config.env.types.file);\n if (file) {\n config.env.types.file = file;\n }\n } else {\n this.warn(\n \"The `env.types` configuration parameter was not provided. Please ensure this is expected.\"\n );\n\n const envDefaultTypeDefinition =\n await getEnvDefaultTypeDefinition(this);\n\n const file = await this.fs.resolve(envDefaultTypeDefinition.file);\n if (file) {\n config.env.types = parseTypeDefinition(\n `${file}#${envDefaultTypeDefinition.name}`\n ) as TypeDefinition;\n }\n }\n\n if (\n isSetString(config.env.secrets) ||\n (config.env.secrets && isSetString(config.env.secrets.file))\n ) {\n config.env.secrets = parseTypeDefinition(config.env.secrets);\n\n const file = await this.fs.resolve(config.env.secrets!.file);\n if (file) {\n config.env.secrets!.file = file;\n }\n } else {\n const secretsDefaultTypeDefinition =\n await getSecretsDefaultTypeDefinition(this);\n\n const file = await this.fs.resolve(secretsDefaultTypeDefinition.file);\n if (file) {\n config.env.secrets = parseTypeDefinition(\n `${file}#${secretsDefaultTypeDefinition.name}`\n );\n }\n }\n\n if (config.env.types || config.env.secrets) {\n config.tsc.filter = {\n id: [\n new RegExp(\n `^(${VIRTUAL_MODULE_PREFIX})?${joinPaths(\n this.builtinsPath,\n \"env.ts\"\n )\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\\//g, \"\\\\/\")\n .replace(/\\./g, \"\\\\.\")\n .replace(/\\$/g, \"\\\\$\")}$`\n )\n ]\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 &&\n this.config.framework !== \"powerlines\" &&\n `${constantCase(this.config.framework)}_`\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 this.env = defu(\n {\n parsed: await loadEnv(this, this.config.env)\n },\n this.env ?? {},\n {\n types: {\n env: {}\n },\n used: {\n env: {},\n secrets: {}\n },\n parsed: {},\n injected: {}\n }\n );\n\n if (\n this.config.command !== \"prepare\" &&\n !this.config.skipCache &&\n this.persistedMeta?.checksum === this.meta.checksum &&\n existsSync(getEnvTypeReflectionsPath(this, \"env\"))\n ) {\n this.debug(\n `Skipping reflection initialization as the meta checksum has not changed.`\n );\n\n this.env.types.env = await readEnvTypeReflection(this, \"env\");\n\n if (existsSync(getEnvReflectionsPath(this, \"env\"))) {\n this.env.used.env = await readEnvReflection(this);\n }\n\n if (existsSync(getEnvTypeReflectionsPath(this, \"secrets\"))) {\n this.env.types.secrets = await readEnvTypeReflection(\n this,\n \"secrets\"\n );\n }\n\n if (existsSync(getEnvReflectionsPath(this, \"secrets\"))) {\n this.env.used.secrets = await readSecretsReflection(this);\n }\n } else {\n this.debug(\n `Starting environment configuration reflection initialization.`\n );\n\n this.env.types.env = await reflectEnv(\n this,\n this.config.env.types?.file,\n this.config.env.types?.name\n );\n if (!this.env.types.env) {\n throw new Error(\n \"Failed to find the environment configuration type reflection in the context.\"\n );\n }\n\n await writeEnvTypeReflection(this, this.env.types.env, \"env\");\n\n this.env.types.secrets = await reflectSecrets(\n this,\n this.config.env.secrets?.file,\n this.config.env.secrets?.name\n );\n if (!this.env.types.secrets) {\n throw new Error(\n \"Failed to find the secrets configuration type reflection in the context.\"\n );\n }\n\n await writeEnvTypeReflection(this, this.env.types.secrets, \"secrets\");\n\n this.debug(\n `Resolved ${\n this.env.types.env.getProperties().length ?? 0\n } environment configuration parameters and ${\n this.env.types.secrets?.getProperties().length ?? 0\n } secret configuration parameters`\n );\n\n const envWithAlias = this.env.types.env\n .getProperties()\n .filter(prop => prop.getAlias().length > 0);\n\n Object.entries(await loadEnv(this, this.config.env)).forEach(\n ([key, value]) => {\n const unprefixedKey = this.config.env.prefix.reduce(\n (ret, prefix) => {\n if (key.replace(/_$/g, \"\").startsWith(prefix)) {\n return key.replace(/_$/g, \"\").slice(prefix.length);\n }\n return ret;\n },\n key\n );\n\n const aliasKey = envWithAlias.find(prop =>\n prop?.getAlias().reverse().includes(unprefixedKey)\n );\n if (this.env.types.env?.hasProperty(unprefixedKey) || aliasKey) {\n this.env.types.env\n .getProperty(unprefixedKey)\n .setDefaultValue(value);\n }\n }\n );\n\n this.env.used.env = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `An object containing the environment configuration parameters used by the ${\n this.config.name\n ? `${this.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n this.env.types.env\n );\n\n await writeEnvReflection(this, this.env.used.env, \"env\");\n\n if (this.env.types.secrets) {\n await writeEnvTypeReflection(\n this,\n this.env.types.secrets,\n \"secrets\"\n );\n\n this.env.used.secrets = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `An object containing the secret configuration parameters used by the ${\n this.config.name\n ? `${this.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n this.env.types.secrets\n );\n await writeEnvReflection(this, this.env.used.secrets, \"secrets\");\n }\n }\n },\n async prepare() {\n this.debug(\n `Preparing the Environment runtime artifacts for the Powerlines project.`\n );\n\n const result = await readEnvTypeReflection(this, \"env\");\n\n return render(\n this,\n <EnvBuiltin\n defaultConfig={this.config.env.defaultConfig}\n reflection={result}\n />\n );\n },\n transform: {\n order: \"post\",\n async handler() {\n if (this.env.used.env.getProperties().length > 0) {\n this.trace(\n `Persisting used environment configuration reflections to ${getEnvReflectionsPath(\n this,\n \"env\"\n )}.`\n );\n await writeEnvReflection(this, this.env.used.env, \"env\");\n }\n\n if (this.env.used.secrets.getProperties().length > 0) {\n this.trace(\n `Persisting used secret configuration reflections to ${getEnvReflectionsPath(\n this,\n \"secrets\"\n )}.`\n );\n await writeEnvReflection(this, this.env.used.secrets, \"secrets\");\n }\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 const result = await readEnvTypeReflection(this, \"env\");\n\n return render(\n this,\n <EnvDocsFile levelOffset={0} reflection={result} />\n );\n },\n async buildEnd() {\n const reflectionPath = getEnvReflectionsPath(this, \"env\");\n\n this.debug(`Writing env reflection types to ${reflectionPath}.`);\n\n await writeEnvReflection(this, this.env.used.env, \"env\");\n }\n },\n {\n name: \"env:automd-generator\",\n config() {\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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAI,aAAc,IAAM,MAAQ;AAC/B,IAAI,SAAK;AACT,QAAI;;;;;AA4CL,MAAE,SAAA,cAAyB,UAAA,EAAA,KAAA;AACzB,QAAA;EAAA,QAAA,QAAA,QAA+B;EAAA,MAAA,QAAA,MAAA;EAAA;GAC/B,MAAA;GACA,MAAA,SAAA;AACA,SAAA,MAAA,yEAAqB;IACrB,MAAA,SAAkB;KAClB,KAAA,KAAA,SAAA;MACQ,OAAO,EAAC;MACT,UAAW;MACX,QAAA;;MAEF,CAAA;cAEC,SAAQ,CAAA,eAAY,EAC1B;KACM,SAAE;MACR,YAAA;MACF,OAAA;;KAEE,KAAA,EAAA;KACG;AACH,QAAA,YAAA,OAAA,IAAA,MAAA,IAAA,OAAA,IAAA,SAAA,YAAA,OAAA,IAAA,MAAA,KAAA,EAAA;AACK,YAAM,IAAM,QAAI,oBAAiB,OAAA,IAAkB,MAAC;KACzD,MAAS,OAAA,MAAgB,KAAI,GAAA,QAAA,OAAA,IAAA,MAAA,KAAA;AAC1B,SAAA,KACI,QAAA,IAAA,MAAA,OAAA;WAEC;AACN,UAAA,KAAA,4FAAA;KACE,MAAO,2BAAS,MAAA,4BAAA,KAAA;KAChB,MAAM,OAAS,MAAA,KAAA,GAAA,QAAA,yBAAA,KAAA;AACb,SAAI,KACF,QAAC,IAAU,QAAQ,oBAAkB,GAAI,KAAA,GAAA,yBAA8B,OAAA;;AAG3E,QAAE,YAAc,OAAC,IAAA,QAAA,IAAA,OAAA,IAAA,WAAA,Y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;QAAA,EAAA;CAAA;CAAA;CAAA,CAAA"}
|
|
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 {\n ReflectionClass,\n ReflectionKind\n} from \"@powerlines/deepkit/vendor/type\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport automd from \"@powerlines/plugin-automd\";\nimport babel from \"@powerlines/plugin-babel\";\nimport deepkit from \"@powerlines/plugin-deepkit\";\nimport { TypeScriptCompilerPluginUserConfig } from \"@powerlines/plugin-tsc\";\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { VIRTUAL_MODULE_PREFIX } from \"powerlines/constants\";\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 { loadEnv } from \"./helpers/load\";\nimport {\n getEnvDefaultTypeDefinition,\n getEnvReflectionsPath,\n getEnvTypeReflectionsPath,\n getSecretsDefaultTypeDefinition,\n readEnvReflection,\n readEnvTypeReflection,\n readSecretsReflection,\n writeEnvReflection,\n writeEnvTypeReflection\n} from \"./helpers/persistence\";\nimport { reflectEnv, reflectSecrets } from \"./helpers/reflect\";\nimport { EnvPluginContext, EnvPluginOptions } from \"./types/plugin\";\n\nexport type * 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 deepkit(options.deepkit),\n babel(options.babel),\n {\n name: \"env:core\",\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 types: {} as TypeDefinitionParameter,\n validate: false,\n inject: false,\n prefix: []\n }),\n babel: {\n plugins: [envBabelPlugin]\n },\n deepkit: {\n reflection: \"default\",\n level: \"all\"\n },\n tsc: {} as TypeScriptCompilerPluginUserConfig[\"tsc\"]\n };\n\n if (\n isSetString(config.env.types) ||\n (config.env.types && isSetString(config.env.types.file))\n ) {\n config.env.types = parseTypeDefinition(\n config.env.types\n ) as TypeDefinition;\n\n const file = await this.fs.resolve(config.env.types.file);\n if (file) {\n config.env.types.file = file;\n }\n } else {\n this.warn(\n \"The `env.types` configuration parameter was not provided. Please ensure this is expected.\"\n );\n\n const envDefaultTypeDefinition =\n await getEnvDefaultTypeDefinition(this);\n\n const file = await this.fs.resolve(envDefaultTypeDefinition.file);\n if (file) {\n config.env.types = parseTypeDefinition(\n `${file}#${envDefaultTypeDefinition.name}`\n ) as TypeDefinition;\n }\n }\n\n if (\n isSetString(config.env.secrets) ||\n (config.env.secrets && isSetString(config.env.secrets.file))\n ) {\n config.env.secrets = parseTypeDefinition(config.env.secrets);\n\n const file = await this.fs.resolve(config.env.secrets!.file);\n if (file) {\n config.env.secrets!.file = file;\n }\n } else {\n const secretsDefaultTypeDefinition =\n await getSecretsDefaultTypeDefinition(this);\n\n const file = await this.fs.resolve(secretsDefaultTypeDefinition.file);\n if (file) {\n config.env.secrets = parseTypeDefinition(\n `${file}#${secretsDefaultTypeDefinition.name}`\n );\n }\n }\n\n if (config.env.types || config.env.secrets) {\n config.tsc.filter = {\n id: [\n new RegExp(\n `^(${VIRTUAL_MODULE_PREFIX})?${joinPaths(\n this.builtinsPath,\n \"env.ts\"\n )\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\\//g, \"\\\\/\")\n .replace(/\\./g, \"\\\\.\")\n .replace(/\\$/g, \"\\\\$\")}$`\n )\n ]\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 &&\n this.config.framework !== \"powerlines\" &&\n `${constantCase(this.config.framework)}_`\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 this.env = defu(\n {\n parsed: await loadEnv(this, this.config.env)\n },\n this.env ?? {},\n {\n types: {\n env: {}\n },\n used: {\n env: {},\n secrets: {}\n },\n parsed: {},\n injected: {}\n }\n );\n\n if (\n this.config.command !== \"prepare\" &&\n !this.config.skipCache &&\n this.persistedMeta?.checksum === this.meta.checksum &&\n existsSync(getEnvTypeReflectionsPath(this, \"env\"))\n ) {\n this.debug(\n `Skipping reflection initialization as the meta checksum has not changed.`\n );\n\n this.env.types.env = await readEnvTypeReflection(this, \"env\");\n\n if (existsSync(getEnvReflectionsPath(this, \"env\"))) {\n this.env.used.env = await readEnvReflection(this);\n }\n\n if (existsSync(getEnvTypeReflectionsPath(this, \"secrets\"))) {\n this.env.types.secrets = await readEnvTypeReflection(\n this,\n \"secrets\"\n );\n }\n\n if (existsSync(getEnvReflectionsPath(this, \"secrets\"))) {\n this.env.used.secrets = await readSecretsReflection(this);\n }\n } else {\n this.debug(\n `Starting environment configuration reflection initialization.`\n );\n\n this.env.types.env = await reflectEnv(\n this,\n this.config.env.types?.file,\n this.config.env.types?.name\n );\n if (!this.env.types.env) {\n throw new Error(\n \"Failed to find the environment configuration type reflection in the context.\"\n );\n }\n\n await writeEnvTypeReflection(this, this.env.types.env, \"env\");\n\n this.env.types.secrets = await reflectSecrets(\n this,\n this.config.env.secrets?.file,\n this.config.env.secrets?.name\n );\n if (!this.env.types.secrets) {\n throw new Error(\n \"Failed to find the secrets configuration type reflection in the context.\"\n );\n }\n\n await writeEnvTypeReflection(this, this.env.types.secrets, \"secrets\");\n\n this.debug(\n `Resolved ${\n this.env.types.env.getProperties().length ?? 0\n } environment configuration parameters and ${\n this.env.types.secrets?.getProperties().length ?? 0\n } secret configuration parameters`\n );\n\n const envWithAlias = this.env.types.env\n .getProperties()\n .filter(prop => prop.getAlias().length > 0);\n\n Object.entries(await loadEnv(this, this.config.env)).forEach(\n ([key, value]) => {\n const unprefixedKey = this.config.env.prefix.reduce(\n (ret, prefix) => {\n if (key.replace(/_$/g, \"\").startsWith(prefix)) {\n return key.replace(/_$/g, \"\").slice(prefix.length);\n }\n return ret;\n },\n key\n );\n\n const aliasKey = envWithAlias.find(prop =>\n prop?.getAlias().reverse().includes(unprefixedKey)\n );\n if (this.env.types.env?.hasProperty(unprefixedKey) || aliasKey) {\n this.env.types.env\n .getProperty(unprefixedKey)\n .setDefaultValue(value);\n }\n }\n );\n\n this.env.used.env = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `An object containing the environment configuration parameters used by the ${\n this.config.name\n ? `${this.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n this.env.types.env\n );\n\n await writeEnvReflection(this, this.env.used.env, \"env\");\n\n if (this.env.types.secrets) {\n await writeEnvTypeReflection(\n this,\n this.env.types.secrets,\n \"secrets\"\n );\n\n this.env.used.secrets = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `An object containing the secret configuration parameters used by the ${\n this.config.name\n ? `${this.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n this.env.types.secrets\n );\n await writeEnvReflection(this, this.env.used.secrets, \"secrets\");\n }\n }\n },\n async prepare() {\n this.debug(\n `Preparing the Environment runtime artifacts for the Powerlines project.`\n );\n\n const result = await readEnvTypeReflection(this, \"env\");\n\n return render(\n this,\n <EnvBuiltin\n defaultConfig={this.config.env.defaultConfig}\n reflection={result}\n />\n );\n },\n transform: {\n order: \"post\",\n async handler() {\n if (this.env.used.env.getProperties().length > 0) {\n this.trace(\n `Persisting used environment configuration reflections to ${getEnvReflectionsPath(\n this,\n \"env\"\n )}.`\n );\n await writeEnvReflection(this, this.env.used.env, \"env\");\n }\n\n if (this.env.used.secrets.getProperties().length > 0) {\n this.trace(\n `Persisting used secret configuration reflections to ${getEnvReflectionsPath(\n this,\n \"secrets\"\n )}.`\n );\n await writeEnvReflection(this, this.env.used.secrets, \"secrets\");\n }\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 const result = await readEnvTypeReflection(this, \"env\");\n\n return render(\n this,\n <EnvDocsFile levelOffset={0} reflection={result} />\n );\n },\n async buildEnd() {\n const reflectionPath = getEnvReflectionsPath(this, \"env\");\n\n this.debug(`Writing env reflection types to ${reflectionPath}.`);\n\n await writeEnvReflection(this, this.env.used.env, \"env\");\n }\n },\n {\n name: \"env:automd-generator\",\n config() {\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":"+iDAKA,SAAI,EAAc,EAAM,EAAQ,CAE/B,MADA,GAAI,OAAK,EACL,EA4CL,MAAE,EAAA,GAAyB,EAAA,EAAA,GACzB,CAAA,EAAA,EAAA,QAA+B,CAAA,EAAA,EAAA,MAAA,CAAA,CAC/B,KAAA,WACA,MAAA,QAAA,CACA,KAAA,MAAA,yEAAqB,CACrB,IAAA,EAAkB,CAClB,IAAA,EAAA,EAAA,CACQ,MAAO,EAAC,CACT,SAAW,GACX,OAAA,aAEF,CAAA,QAEC,QAAQ,CAAA,EAAY,CAC1B,CACM,QAAE,CACR,WAAA,UACF,MAAA,OAEE,IAAA,EAAA,CACG,CACH,GAAA,EAAA,EAAA,IAAA,MAAA,EAAA,EAAA,IAAA,OAAA,EAAA,EAAA,IAAA,MAAA,KAAA,CAAA,CACK,EAAM,IAAM,MAAI,EAAiB,EAAA,IAAkB,MAAC,CACzD,IAAS,EAAA,MAAgB,KAAI,GAAA,QAAA,EAAA,IAAA,MAAA,KAAA,CAC1B,IACI,EAAA,IAAA,MAAA,KAAA,OAEC,CACN,KAAA,KAAA,4FAAA,CACE,IAAO,EAAS,MAAA,EAAA,KAAA,CACV,EAAS,MAAA,KAAA,GAAA,QAAA,EAAA,KAAA,CACT,IACF,EAAC,IAAU,MAAQ,EAAkB,GAAI,EAAA,GAAA,EAA8B,OAAA,EAG3E,GAAE,EAAc,EAAC,IAAA,QAAA,EAAA,EAAA,IAAA,SAAA,EAAA,EAAA,IAAA,QAAA,KAAA,CAAA,CACf,EAAO,IAAI,QAAU,EAAA,EAAA,IAAA,QAAA,CACrB,IAAI,EAAS,MAAI,KAAA,GAAA,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s');
|
|
3
|
-
const require_types_plugin = require('./plugin.cjs');
|
|
4
|
-
|
|
5
|
-
exports.__ΩEnvInterface = require_types_runtime.__ΩEnvInterface;
|
|
6
|
-
exports.__ΩEnvPluginContext = require_types_plugin.__ΩEnvPluginContext;
|
|
7
|
-
exports.__ΩEnvPluginOptions = require_types_plugin.__ΩEnvPluginOptions;
|
|
8
|
-
exports.__ΩEnvPluginResolvedConfig = require_types_plugin.__ΩEnvPluginResolvedConfig;
|
|
9
|
-
exports.__ΩEnvPluginUserConfig = require_types_plugin.__ΩEnvPluginUserConfig;
|
|
10
|
-
exports.__ΩEnvType = require_types_plugin.__ΩEnvType;
|
|
11
|
-
exports.__ΩSecretsInterface = require_types_runtime.__ΩSecretsInterface;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./runtime.cjs`),t=require(`./plugin.cjs`);exports.__ΩEnvInterface=e.__ΩEnvInterface,exports.__ΩEnvPluginContext=t.__ΩEnvPluginContext,exports.__ΩEnvPluginOptions=t.__ΩEnvPluginOptions,exports.__ΩEnvPluginResolvedConfig=t.__ΩEnvPluginResolvedConfig,exports.__ΩEnvPluginUserConfig=t.__ΩEnvPluginUserConfig,exports.__ΩEnvType=t.__ΩEnvType,exports.__ΩSecretsInterface=e.__ΩSecretsInterface;
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType } from "./plugin.mjs";
|
|
3
|
-
|
|
4
|
-
export { __ΩEnvInterface, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType, __ΩSecretsInterface };
|
|
1
|
+
import{__ΩEnvInterface as e,__ΩSecretsInterface as t}from"./runtime.mjs";import{__ΩEnvPluginContext as n,__ΩEnvPluginOptions as r,__ΩEnvPluginResolvedConfig as i,__ΩEnvPluginUserConfig as a,__ΩEnvType as o}from"./plugin.mjs";export{e as __ΩEnvInterface,n as __ΩEnvPluginContext,r as __ΩEnvPluginOptions,i as __ΩEnvPluginResolvedConfig,a as __ΩEnvPluginUserConfig,o as __ΩEnvType,t as __ΩSecretsInterface};
|
package/dist/types/plugin.cjs
CHANGED
|
@@ -1,115 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
|
|
3
|
-
//#region src/types/plugin.ts
|
|
4
|
-
const __ΩOmit = [
|
|
5
|
-
"T",
|
|
6
|
-
"K",
|
|
7
|
-
() => __ΩPick,
|
|
8
|
-
() => __ΩExclude,
|
|
9
|
-
"Omit",
|
|
10
|
-
"b!b\"e!!e!!ge!\"o$#o##w%y"
|
|
11
|
-
];
|
|
12
|
-
const __ΩRequired = [
|
|
13
|
-
"T",
|
|
14
|
-
"Required",
|
|
15
|
-
"l+e#!e\"!fRb!Pde\"!gN##w\"y"
|
|
16
|
-
];
|
|
17
|
-
const __ΩPick = [
|
|
18
|
-
"T",
|
|
19
|
-
"K",
|
|
20
|
-
"Pick",
|
|
21
|
-
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
22
|
-
];
|
|
23
|
-
const __ΩExclude = [
|
|
24
|
-
"T",
|
|
25
|
-
"U",
|
|
26
|
-
"Exclude",
|
|
27
|
-
"l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
|
|
28
|
-
];
|
|
29
|
-
const __ΩEnvType = [
|
|
30
|
-
"env",
|
|
31
|
-
"secrets",
|
|
32
|
-
"EnvType",
|
|
33
|
-
"P.!.\"Jw#y"
|
|
34
|
-
];
|
|
35
|
-
const __ΩEnvPluginOptions = [
|
|
36
|
-
() => __ΩOmit,
|
|
37
|
-
"types",
|
|
38
|
-
"types",
|
|
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
|
-
"secrets",
|
|
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\"`.",
|
|
42
|
-
"prefix",
|
|
43
|
-
"An additional prefix (or list of additional prefixes) to apply to the environment variables",
|
|
44
|
-
"inject",
|
|
45
|
-
true,
|
|
46
|
-
"Should the plugin inject the env variables in the source code with their values?",
|
|
47
|
-
"validate",
|
|
48
|
-
"Should the plugin validate the loaded environment variables against the provided type definitions?",
|
|
49
|
-
"Children",
|
|
50
|
-
"defaultConfig",
|
|
51
|
-
"The default configuration to use when loading environment variables.",
|
|
52
|
-
"babel",
|
|
53
|
-
"Babel configuration options to use when injecting environment variables into the source code.",
|
|
54
|
-
"automd",
|
|
55
|
-
"AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.",
|
|
56
|
-
"deepkit",
|
|
57
|
-
"Alloy configuration options to use when injecting environment variables into the source code.",
|
|
58
|
-
"EnvPluginOptions",
|
|
59
|
-
"P!.\"o!#P!4#8?$!4%8?&P&&FJ4'8?()4)8>*?+)4,8>*?-\"w.4/8?0!418?2!438?4!458?6MKw7y"
|
|
60
|
-
];
|
|
61
|
-
const __ΩEnvPluginUserConfig = [
|
|
62
|
-
() => __ΩEnvPluginOptions,
|
|
63
|
-
"env",
|
|
64
|
-
"EnvPluginUserConfig",
|
|
65
|
-
"P!!Pn!4\"MKw#y"
|
|
66
|
-
];
|
|
67
|
-
const __ΩEnvPluginResolvedConfig = [
|
|
68
|
-
() => __ΩRequired,
|
|
69
|
-
() => __ΩPick,
|
|
70
|
-
"additionalFiles",
|
|
71
|
-
() => __ΩRequired,
|
|
72
|
-
() => __ΩPick,
|
|
73
|
-
() => __ΩEnvPluginOptions,
|
|
74
|
-
"defaultConfig",
|
|
75
|
-
"types",
|
|
76
|
-
"The type definition for the expected env variable parameters",
|
|
77
|
-
"secrets",
|
|
78
|
-
"The type definition for the expected env secret parameters",
|
|
79
|
-
"inject",
|
|
80
|
-
"Should the plugin inject the env variables in the source code with their values?",
|
|
81
|
-
"validate",
|
|
82
|
-
"Should the plugin validate the loaded environment variables against the provided type definitions?",
|
|
83
|
-
"prefix",
|
|
84
|
-
"The prefix used for environment variables",
|
|
85
|
-
"env",
|
|
86
|
-
"EnvPluginResolvedConfig",
|
|
87
|
-
"P!!PP!.#o\"#o!\"n&.'o%#o$\"P!4(?)!4*?+)4,?-)4.?/&F40?1MK42MKw3y"
|
|
88
|
-
];
|
|
89
|
-
const __ΩEnvPluginContext = [
|
|
90
|
-
() => __ΩEnvPluginResolvedConfig,
|
|
91
|
-
"TResolvedConfig",
|
|
92
|
-
"env",
|
|
93
|
-
"The type definitions for the expected env variables",
|
|
94
|
-
"secrets",
|
|
95
|
-
"The type definitions for the expected env secrets",
|
|
96
|
-
"The type definitions reflection for the env variables and secrets",
|
|
97
|
-
"types",
|
|
98
|
-
"The current env variables reflection",
|
|
99
|
-
"The current env secrets reflection",
|
|
100
|
-
"The current **used** environment variables and secrets reflection",
|
|
101
|
-
"used",
|
|
102
|
-
"parsed",
|
|
103
|
-
"The parsed .env configuration object",
|
|
104
|
-
"injected",
|
|
105
|
-
"The injected environment variables and secrets reflection",
|
|
106
|
-
"EnvPluginContext",
|
|
107
|
-
"n!c\"P!!PP!4#?$!4%?&M?'4(?'P!4#?)!4%?*M?+4,?+!4-?.!4/?0M4#Mw1y"
|
|
108
|
-
];
|
|
109
|
-
|
|
110
|
-
//#endregion
|
|
111
|
-
exports.__ΩEnvPluginContext = __ΩEnvPluginContext;
|
|
112
|
-
exports.__ΩEnvPluginOptions = __ΩEnvPluginOptions;
|
|
113
|
-
exports.__ΩEnvPluginResolvedConfig = __ΩEnvPluginResolvedConfig;
|
|
114
|
-
exports.__ΩEnvPluginUserConfig = __ΩEnvPluginUserConfig;
|
|
115
|
-
exports.__ΩEnvType = __ΩEnvType;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=[`T`,`K`,()=>n,()=>r,`Omit`,`b!b"e!!e!!ge!"o$#o##w%y`],t=[`T`,`Required`,`l+e#!e"!fRb!Pde"!gN##w"y`],n=[`T`,`K`,`Pick`,`l+e#!e"!fRb!b"Pde""N#!w#y`],r=[`T`,`U`,`Exclude`,`l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)w#y`],i=[`env`,`secrets`,`EnvType`,`P.!."Jw#y`],a=[()=>e,`types`,`types`,'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"`.',`secrets`,'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"`.',`prefix`,`An additional prefix (or list of additional prefixes) to apply to the environment variables`,`inject`,!0,`Should the plugin inject the env variables in the source code with their values?`,`validate`,`Should the plugin validate the loaded environment variables against the provided type definitions?`,`Children`,`defaultConfig`,`The default configuration to use when loading environment variables.`,`babel`,`Babel configuration options to use when injecting environment variables into the source code.`,`automd`,`AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.`,`deepkit`,`Alloy configuration options to use when injecting environment variables into the source code.`,`EnvPluginOptions`,`P!."o!#P!4#8?$!4%8?&P&&FJ4'8?()4)8>*?+)4,8>*?-"w.4/8?0!418?2!438?4!458?6MKw7y`],o=[()=>a,`env`,`EnvPluginUserConfig`,`P!!Pn!4"MKw#y`],s=[()=>t,()=>n,`additionalFiles`,()=>t,()=>n,()=>a,`defaultConfig`,`types`,`The type definition for the expected env variable parameters`,`secrets`,`The type definition for the expected env secret parameters`,`inject`,`Should the plugin inject the env variables in the source code with their values?`,`validate`,`Should the plugin validate the loaded environment variables against the provided type definitions?`,`prefix`,`The prefix used for environment variables`,`env`,`EnvPluginResolvedConfig`,`P!!PP!.#o"#o!"n&.'o%#o$"P!4(?)!4*?+)4,?-)4.?/&F40?1MK42MKw3y`],c=[()=>s,`TResolvedConfig`,`env`,`The type definitions for the expected env variables`,`secrets`,`The type definitions for the expected env secrets`,`The type definitions reflection for the env variables and secrets`,`types`,`The current env variables reflection`,`The current env secrets reflection`,`The current **used** environment variables and secrets reflection`,`used`,`parsed`,`The parsed .env configuration object`,`injected`,`The injected environment variables and secrets reflection`,`EnvPluginContext`,`n!c"P!!PP!4#?$!4%?&M?'4(?'P!4#?)!4%?*M?+4,?+!4-?.!4/?0M4#Mw1y`];exports.__ΩEnvPluginContext=c,exports.__ΩEnvPluginOptions=a,exports.__ΩEnvPluginResolvedConfig=s,exports.__ΩEnvPluginUserConfig=o,exports.__ΩEnvType=i;
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -1,110 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const __ΩOmit = [
|
|
3
|
-
"T",
|
|
4
|
-
"K",
|
|
5
|
-
() => __ΩPick,
|
|
6
|
-
() => __ΩExclude,
|
|
7
|
-
"Omit",
|
|
8
|
-
"b!b\"e!!e!!ge!\"o$#o##w%y"
|
|
9
|
-
];
|
|
10
|
-
const __ΩRequired = [
|
|
11
|
-
"T",
|
|
12
|
-
"Required",
|
|
13
|
-
"l+e#!e\"!fRb!Pde\"!gN##w\"y"
|
|
14
|
-
];
|
|
15
|
-
const __ΩPick = [
|
|
16
|
-
"T",
|
|
17
|
-
"K",
|
|
18
|
-
"Pick",
|
|
19
|
-
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
20
|
-
];
|
|
21
|
-
const __ΩExclude = [
|
|
22
|
-
"T",
|
|
23
|
-
"U",
|
|
24
|
-
"Exclude",
|
|
25
|
-
"l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
|
|
26
|
-
];
|
|
27
|
-
const __ΩEnvType = [
|
|
28
|
-
"env",
|
|
29
|
-
"secrets",
|
|
30
|
-
"EnvType",
|
|
31
|
-
"P.!.\"Jw#y"
|
|
32
|
-
];
|
|
33
|
-
const __ΩEnvPluginOptions = [
|
|
34
|
-
() => __ΩOmit,
|
|
35
|
-
"types",
|
|
36
|
-
"types",
|
|
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
|
-
"secrets",
|
|
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\"`.",
|
|
40
|
-
"prefix",
|
|
41
|
-
"An additional prefix (or list of additional prefixes) to apply to the environment variables",
|
|
42
|
-
"inject",
|
|
43
|
-
true,
|
|
44
|
-
"Should the plugin inject the env variables in the source code with their values?",
|
|
45
|
-
"validate",
|
|
46
|
-
"Should the plugin validate the loaded environment variables against the provided type definitions?",
|
|
47
|
-
"Children",
|
|
48
|
-
"defaultConfig",
|
|
49
|
-
"The default configuration to use when loading environment variables.",
|
|
50
|
-
"babel",
|
|
51
|
-
"Babel configuration options to use when injecting environment variables into the source code.",
|
|
52
|
-
"automd",
|
|
53
|
-
"AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.",
|
|
54
|
-
"deepkit",
|
|
55
|
-
"Alloy configuration options to use when injecting environment variables into the source code.",
|
|
56
|
-
"EnvPluginOptions",
|
|
57
|
-
"P!.\"o!#P!4#8?$!4%8?&P&&FJ4'8?()4)8>*?+)4,8>*?-\"w.4/8?0!418?2!438?4!458?6MKw7y"
|
|
58
|
-
];
|
|
59
|
-
const __ΩEnvPluginUserConfig = [
|
|
60
|
-
() => __ΩEnvPluginOptions,
|
|
61
|
-
"env",
|
|
62
|
-
"EnvPluginUserConfig",
|
|
63
|
-
"P!!Pn!4\"MKw#y"
|
|
64
|
-
];
|
|
65
|
-
const __ΩEnvPluginResolvedConfig = [
|
|
66
|
-
() => __ΩRequired,
|
|
67
|
-
() => __ΩPick,
|
|
68
|
-
"additionalFiles",
|
|
69
|
-
() => __ΩRequired,
|
|
70
|
-
() => __ΩPick,
|
|
71
|
-
() => __ΩEnvPluginOptions,
|
|
72
|
-
"defaultConfig",
|
|
73
|
-
"types",
|
|
74
|
-
"The type definition for the expected env variable parameters",
|
|
75
|
-
"secrets",
|
|
76
|
-
"The type definition for the expected env secret parameters",
|
|
77
|
-
"inject",
|
|
78
|
-
"Should the plugin inject the env variables in the source code with their values?",
|
|
79
|
-
"validate",
|
|
80
|
-
"Should the plugin validate the loaded environment variables against the provided type definitions?",
|
|
81
|
-
"prefix",
|
|
82
|
-
"The prefix used for environment variables",
|
|
83
|
-
"env",
|
|
84
|
-
"EnvPluginResolvedConfig",
|
|
85
|
-
"P!!PP!.#o\"#o!\"n&.'o%#o$\"P!4(?)!4*?+)4,?-)4.?/&F40?1MK42MKw3y"
|
|
86
|
-
];
|
|
87
|
-
const __ΩEnvPluginContext = [
|
|
88
|
-
() => __ΩEnvPluginResolvedConfig,
|
|
89
|
-
"TResolvedConfig",
|
|
90
|
-
"env",
|
|
91
|
-
"The type definitions for the expected env variables",
|
|
92
|
-
"secrets",
|
|
93
|
-
"The type definitions for the expected env secrets",
|
|
94
|
-
"The type definitions reflection for the env variables and secrets",
|
|
95
|
-
"types",
|
|
96
|
-
"The current env variables reflection",
|
|
97
|
-
"The current env secrets reflection",
|
|
98
|
-
"The current **used** environment variables and secrets reflection",
|
|
99
|
-
"used",
|
|
100
|
-
"parsed",
|
|
101
|
-
"The parsed .env configuration object",
|
|
102
|
-
"injected",
|
|
103
|
-
"The injected environment variables and secrets reflection",
|
|
104
|
-
"EnvPluginContext",
|
|
105
|
-
"n!c\"P!!PP!4#?$!4%?&M?'4(?'P!4#?)!4%?*M?+4,?+!4-?.!4/?0M4#Mw1y"
|
|
106
|
-
];
|
|
107
|
-
|
|
108
|
-
//#endregion
|
|
109
|
-
export { __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType };
|
|
1
|
+
const e=[`T`,`K`,()=>n,()=>r,`Omit`,`b!b"e!!e!!ge!"o$#o##w%y`],t=[`T`,`Required`,`l+e#!e"!fRb!Pde"!gN##w"y`],n=[`T`,`K`,`Pick`,`l+e#!e"!fRb!b"Pde""N#!w#y`],r=[`T`,`U`,`Exclude`,`l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)w#y`],i=[`env`,`secrets`,`EnvType`,`P.!."Jw#y`],a=[()=>e,`types`,`types`,'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"`.',`secrets`,'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"`.',`prefix`,`An additional prefix (or list of additional prefixes) to apply to the environment variables`,`inject`,!0,`Should the plugin inject the env variables in the source code with their values?`,`validate`,`Should the plugin validate the loaded environment variables against the provided type definitions?`,`Children`,`defaultConfig`,`The default configuration to use when loading environment variables.`,`babel`,`Babel configuration options to use when injecting environment variables into the source code.`,`automd`,`AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.`,`deepkit`,`Alloy configuration options to use when injecting environment variables into the source code.`,`EnvPluginOptions`,`P!."o!#P!4#8?$!4%8?&P&&FJ4'8?()4)8>*?+)4,8>*?-"w.4/8?0!418?2!438?4!458?6MKw7y`],o=[()=>a,`env`,`EnvPluginUserConfig`,`P!!Pn!4"MKw#y`],s=[()=>t,()=>n,`additionalFiles`,()=>t,()=>n,()=>a,`defaultConfig`,`types`,`The type definition for the expected env variable parameters`,`secrets`,`The type definition for the expected env secret parameters`,`inject`,`Should the plugin inject the env variables in the source code with their values?`,`validate`,`Should the plugin validate the loaded environment variables against the provided type definitions?`,`prefix`,`The prefix used for environment variables`,`env`,`EnvPluginResolvedConfig`,`P!!PP!.#o"#o!"n&.'o%#o$"P!4(?)!4*?+)4,?-)4.?/&F40?1MK42MKw3y`],c=[()=>s,`TResolvedConfig`,`env`,`The type definitions for the expected env variables`,`secrets`,`The type definitions for the expected env secrets`,`The type definitions reflection for the env variables and secrets`,`types`,`The current env variables reflection`,`The current env secrets reflection`,`The current **used** environment variables and secrets reflection`,`used`,`parsed`,`The parsed .env configuration object`,`injected`,`The injected environment variables and secrets reflection`,`EnvPluginContext`,`n!c"P!!PP!4#?$!4%?&M?'4(?'P!4#?)!4%?*M?+4,?+!4-?.!4/?0M4#Mw1y`];export{c as __ΩEnvPluginContext,a as __ΩEnvPluginOptions,s as __ΩEnvPluginResolvedConfig,o as __ΩEnvPluginUserConfig,i as __ΩEnvType};
|
|
110
2
|
//# sourceMappingURL=plugin.mjs.map
|