@powerlines/plugin-env 0.15.141 → 0.15.142
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/automd-generator-BNg74tyV.cjs +37 -0
- package/dist/automd-generator-DoKLIMuw.mjs +32 -0
- package/dist/automd-generator-DoKLIMuw.mjs.map +1 -0
- package/dist/babel/index.cjs +5 -2
- package/dist/babel/index.d.cts +14 -1
- package/dist/babel/index.d.mts +14 -1
- package/dist/babel/index.mjs +4 -1
- package/dist/babel/plugin.cjs +4 -140
- package/dist/babel/plugin.d.cts +14 -7
- package/dist/babel/plugin.d.mts +14 -7
- package/dist/babel/plugin.mjs +3 -138
- package/dist/babel-BZqmdVF4.cjs +0 -0
- package/dist/babel-DgietUY3.mjs +1 -0
- package/dist/chunk-CNVrAnJR.cjs +48 -0
- package/dist/{_virtual/rolldown_runtime.cjs → chunk-CsF2CmBJ.mjs} +6 -2
- package/dist/components/docs.cjs +13 -69
- package/dist/components/docs.d.cts +1 -21
- package/dist/components/docs.d.mts +1 -21
- package/dist/components/docs.mjs +12 -67
- package/dist/components/env.cjs +13 -588
- package/dist/components/env.d.cts +1 -19
- package/dist/components/env.d.mts +1 -19
- package/dist/components/env.mjs +11 -584
- package/dist/components/index.cjs +17 -5
- package/dist/components/index.d.cts +3 -2
- package/dist/components/index.d.mts +3 -2
- package/dist/components/index.mjs +14 -2
- package/dist/components-BUo6Koax.cjs +0 -0
- package/dist/components-DDFmImcI.mjs +1 -0
- package/dist/confbox.DA7CpUDY-DShUZ_rW.mjs +23 -0
- package/dist/confbox.DA7CpUDY-DShUZ_rW.mjs.map +1 -0
- package/dist/confbox.DA7CpUDY-r6FXRsI6.cjs +28 -0
- package/dist/confbox.DnMsyigM-C13n3X-S.cjs +415 -0
- package/dist/confbox.DnMsyigM-V6Wj0LPC.mjs +405 -0
- package/dist/confbox.DnMsyigM-V6Wj0LPC.mjs.map +1 -0
- package/dist/create-reflection-resource-B3friIs9.mjs +98 -0
- package/dist/create-reflection-resource-B3friIs9.mjs.map +1 -0
- package/dist/create-reflection-resource-BJj83ii4.cjs +103 -0
- package/dist/create-reflection-resource-DSLbLsX2.d.cts +16 -0
- package/dist/create-reflection-resource-DSLbLsX2.d.cts.map +1 -0
- package/dist/create-reflection-resource-DwWJAo-G.d.mts +16 -0
- package/dist/create-reflection-resource-DwWJAo-G.d.mts.map +1 -0
- package/dist/defu-CrqNIh1A.cjs +227 -0
- package/dist/defu-DV5Grr85.mjs +180 -0
- package/dist/defu-DV5Grr85.mjs.map +1 -0
- package/dist/dist-BQc8ZRwl.cjs +13 -0
- package/dist/dist-C_a6goTt.cjs +15282 -0
- package/dist/dist-CjWvISyq.mjs +15271 -0
- package/dist/dist-CjWvISyq.mjs.map +1 -0
- package/dist/dist-mV5Swt78.mjs +13 -0
- package/dist/dist-mV5Swt78.mjs.map +1 -0
- package/dist/docs-B-SDRHeg.cjs +75 -0
- package/dist/docs-B0d8pdIg.d.mts +23 -0
- package/dist/docs-B0d8pdIg.d.mts.map +1 -0
- package/dist/docs-DMfzQuvP.d.cts +23 -0
- package/dist/docs-DMfzQuvP.d.cts.map +1 -0
- package/dist/docs-DbRoWmL_.mjs +70 -0
- package/dist/docs-DbRoWmL_.mjs.map +1 -0
- package/dist/docs-helper-2fe7M3Th.mjs +24 -0
- package/dist/docs-helper-2fe7M3Th.mjs.map +1 -0
- package/dist/docs-helper-4MoQ5-R3.cjs +28 -0
- package/dist/env-BIyd8CTA.d.cts +21 -0
- package/dist/env-BIyd8CTA.d.cts.map +1 -0
- package/dist/env-BKmI7DyR.d.mts +21 -0
- package/dist/env-BKmI7DyR.d.mts.map +1 -0
- package/dist/env-D9oCn-AS.mjs +587 -0
- package/dist/env-D9oCn-AS.mjs.map +1 -0
- package/dist/env-R63eR4RP.cjs +598 -0
- package/dist/helpers/automd-generator.cjs +3 -31
- package/dist/helpers/automd-generator.d.cts +2 -1
- package/dist/helpers/automd-generator.d.cts.map +1 -0
- package/dist/helpers/automd-generator.d.mts +2 -1
- package/dist/helpers/automd-generator.d.mts.map +1 -0
- package/dist/helpers/automd-generator.mjs +2 -29
- package/dist/helpers/create-reflection-resource.cjs +11 -97
- package/dist/helpers/create-reflection-resource.d.cts +3 -14
- package/dist/helpers/create-reflection-resource.d.mts +3 -14
- package/dist/helpers/create-reflection-resource.mjs +10 -95
- package/dist/helpers/docs-helper.cjs +5 -23
- package/dist/helpers/docs-helper.d.cts +4 -2
- package/dist/helpers/docs-helper.d.cts.map +1 -0
- package/dist/helpers/docs-helper.d.mts +4 -2
- package/dist/helpers/docs-helper.d.mts.map +1 -0
- package/dist/helpers/docs-helper.mjs +4 -21
- package/dist/helpers/index.cjs +38 -32
- package/dist/helpers/index.d.cts +9 -6
- package/dist/helpers/index.d.mts +9 -6
- package/dist/helpers/index.mjs +12 -6
- package/dist/helpers/load.cjs +10 -134
- package/dist/helpers/load.d.cts +3 -34
- package/dist/helpers/load.d.mts +3 -34
- package/dist/helpers/load.mjs +8 -130
- package/dist/helpers/persistence.cjs +15 -321
- package/dist/helpers/persistence.d.cts +3 -83
- package/dist/helpers/persistence.d.mts +3 -83
- package/dist/helpers/persistence.mjs +4 -308
- package/dist/helpers/reflect.cjs +13 -262
- package/dist/helpers/reflect.d.cts +3 -45
- package/dist/helpers/reflect.d.mts +3 -45
- package/dist/helpers/reflect.mjs +4 -252
- package/dist/helpers/source-file-env.cjs +3 -57
- package/dist/helpers/source-file-env.d.cts +1 -7
- package/dist/helpers/source-file-env.d.mts +1 -7
- package/dist/helpers/source-file-env.mjs +1 -54
- package/dist/helpers/template-helpers.cjs +6 -69
- package/dist/helpers/template-helpers.d.cts +3 -14
- package/dist/helpers/template-helpers.d.mts +3 -14
- package/dist/helpers/template-helpers.mjs +5 -67
- package/dist/helpers-45e1bvAO.mjs +1 -0
- package/dist/helpers-DgYP3uej.cjs +0 -0
- package/dist/index-BNRXMhlr.d.mts +1 -0
- package/dist/index-Bdi8CvaN.d.cts +16 -0
- package/dist/index-Bdi8CvaN.d.cts.map +1 -0
- package/dist/index-CEDY7cmG.d.cts +1 -0
- package/dist/index-CREkvfw9.d.mts +1 -0
- package/dist/index-DSiHnMH2.d.cts +1 -0
- package/dist/index-Drhzdkqe.d.mts +16 -0
- package/dist/index-Drhzdkqe.d.mts.map +1 -0
- package/dist/index-dhjtMp5F.d.mts +1 -0
- package/dist/index-uTS5iDq_.d.cts +1 -0
- package/dist/index.cjs +257 -98
- package/dist/index.d.cts +14 -23
- package/dist/index.d.mts +14 -23
- package/dist/index.mjs +184 -23
- package/dist/index.mjs.map +1 -0
- package/dist/join-paths-BMg51Ddi.mjs +148 -0
- package/dist/join-paths-BMg51Ddi.mjs.map +1 -0
- package/dist/join-paths-Bc4rM2TX.cjs +159 -0
- package/dist/json5-DEV_07Nb.cjs +786 -0
- package/dist/json5-jq90mF9X.mjs +787 -0
- package/dist/json5-jq90mF9X.mjs.map +1 -0
- package/dist/jsonc-CBh70baJ.cjs +4 -0
- package/dist/jsonc-CDLU6bgi.mjs +4 -0
- package/dist/load-DPB0maqs.cjs +6594 -0
- package/dist/load-Dr5ybfL7.mjs +6579 -0
- package/dist/load-Dr5ybfL7.mjs.map +1 -0
- package/dist/load-GpP6cojj.d.mts +36 -0
- package/dist/load-GpP6cojj.d.mts.map +1 -0
- package/dist/load-PHGmxX_X.d.cts +36 -0
- package/dist/load-PHGmxX_X.d.cts.map +1 -0
- package/dist/multipart-parser-D65rtMfY.mjs +176 -0
- package/dist/multipart-parser-D65rtMfY.mjs.map +1 -0
- package/dist/multipart-parser-aEF5a4Xf.cjs +178 -0
- package/dist/node-Co8KdzkZ.cjs +3985 -0
- package/dist/node-D9MigVDD.mjs +3975 -0
- package/dist/node-D9MigVDD.mjs.map +1 -0
- package/dist/persistence-BR4cUaN6.d.cts +85 -0
- package/dist/persistence-BR4cUaN6.d.cts.map +1 -0
- package/dist/persistence-BsBxs9wt.mjs +586 -0
- package/dist/persistence-BsBxs9wt.mjs.map +1 -0
- package/dist/persistence-D_clXRxP.cjs +712 -0
- package/dist/persistence-DrKQZNCv.d.mts +85 -0
- package/dist/persistence-DrKQZNCv.d.mts.map +1 -0
- package/dist/plugin-CM1TSv1B.cjs +159 -0
- package/dist/plugin-CSVnrdpE.cjs +146 -0
- package/dist/plugin-CSe5f2cD.d.cts +155 -0
- package/dist/plugin-CSe5f2cD.d.cts.map +1 -0
- package/dist/plugin-DMbVjdcQ.d.mts +155 -0
- package/dist/plugin-DMbVjdcQ.d.mts.map +1 -0
- package/dist/plugin-Vyvy9w9Z.mjs +141 -0
- package/dist/plugin-Vyvy9w9Z.mjs.map +1 -0
- package/dist/plugin-eBjQJP6x.mjs +130 -0
- package/dist/plugin-eBjQJP6x.mjs.map +1 -0
- package/dist/reflect-Dm8a3c29.d.cts +47 -0
- package/dist/reflect-Dm8a3c29.d.cts.map +1 -0
- package/dist/reflect-Dpz8ifa0.d.mts +47 -0
- package/dist/reflect-Dpz8ifa0.d.mts.map +1 -0
- package/dist/runtime-BDzzR4wH.d.cts +792 -0
- package/dist/runtime-BDzzR4wH.d.cts.map +1 -0
- package/dist/runtime-C5ukCv3P.mjs +242 -0
- package/dist/runtime-C5ukCv3P.mjs.map +1 -0
- package/dist/runtime-g0TEIoZK.cjs +253 -0
- package/dist/runtime-lYSIZdMn.d.mts +792 -0
- package/dist/runtime-lYSIZdMn.d.mts.map +1 -0
- package/dist/source-file-env-4Vdtzc5-.cjs +68 -0
- package/dist/source-file-env-Brfopjyr.d.cts +9 -0
- package/dist/source-file-env-Brfopjyr.d.cts.map +1 -0
- package/dist/source-file-env-DWejSP2U.d.mts +9 -0
- package/dist/source-file-env-DWejSP2U.d.mts.map +1 -0
- package/dist/source-file-env-Tj-6qobx.mjs +57 -0
- package/dist/source-file-env-Tj-6qobx.mjs.map +1 -0
- package/dist/template-helpers-1SKodHKt.d.mts +16 -0
- package/dist/template-helpers-1SKodHKt.d.mts.map +1 -0
- package/dist/template-helpers-CCEjhw1B.mjs +70 -0
- package/dist/template-helpers-CCEjhw1B.mjs.map +1 -0
- package/dist/template-helpers-YVcwxmoF.cjs +75 -0
- package/dist/template-helpers-zyitPfMz.d.cts +16 -0
- package/dist/template-helpers-zyitPfMz.d.cts.map +1 -0
- package/dist/toml-DvrxV201.cjs +657 -0
- package/dist/toml-uuOYvEAO.mjs +658 -0
- package/dist/toml-uuOYvEAO.mjs.map +1 -0
- package/dist/types/index.cjs +10 -9
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.mts +3 -2
- package/dist/types/index.mjs +3 -2
- package/dist/types/plugin.cjs +7 -133
- package/dist/types/plugin.d.cts +2 -153
- package/dist/types/plugin.d.mts +2 -153
- package/dist/types/plugin.mjs +2 -127
- package/dist/types/runtime.cjs +3 -242
- package/dist/types/runtime.d.cts +1 -790
- package/dist/types/runtime.d.mts +1 -790
- package/dist/types/runtime.mjs +1 -239
- package/dist/types-DyPQho_C.mjs +1 -0
- package/dist/types-o3zWarRp.cjs +0 -0
- package/dist/yaml-CIn2Gddw.mjs +1055 -0
- package/dist/yaml-CIn2Gddw.mjs.map +1 -0
- package/dist/yaml-CQSFMRMS.cjs +1054 -0
- package/package.json +9 -9
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { n as SecretsInterface, t as EnvInterface } from "./runtime-lYSIZdMn.mjs";
|
|
2
|
+
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types";
|
|
3
|
+
import { AutoMDPluginOptions } from "@powerlines/plugin-automd/types/plugin";
|
|
4
|
+
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "@powerlines/plugin-alloy/types";
|
|
5
|
+
import { Reflection } from "@powerlines/deepkit/types";
|
|
6
|
+
import { DotenvParseOutput } from "@stryke/env/types";
|
|
7
|
+
import { Children } from "@alloy-js/core";
|
|
8
|
+
import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
9
|
+
|
|
10
|
+
//#region src/types/plugin.d.ts
|
|
11
|
+
type EnvType = "env" | "secrets";
|
|
12
|
+
type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
|
|
13
|
+
/**
|
|
14
|
+
* 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"`.
|
|
15
|
+
*/
|
|
16
|
+
types?: TypeDefinitionParameter;
|
|
17
|
+
/**
|
|
18
|
+
* 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"`.
|
|
19
|
+
*/
|
|
20
|
+
secrets?: TypeDefinitionParameter;
|
|
21
|
+
/**
|
|
22
|
+
* An additional prefix (or list of additional prefixes) to apply to the environment variables
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* By default, the plugin will use the `POWERLINES_` prefix. This option is useful for avoiding conflicts with other environment variables.
|
|
26
|
+
*/
|
|
27
|
+
prefix?: string | string[];
|
|
28
|
+
/**
|
|
29
|
+
* Should the plugin inject the env variables in the source code with their values?
|
|
30
|
+
*
|
|
31
|
+
* @defaultValue false
|
|
32
|
+
*/
|
|
33
|
+
inject?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The default configuration to use when loading environment variables.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* 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.
|
|
39
|
+
*/
|
|
40
|
+
defaultConfig?: Children;
|
|
41
|
+
/**
|
|
42
|
+
* Babel configuration options to use when injecting environment variables into the source code.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* 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.
|
|
46
|
+
*/
|
|
47
|
+
babel?: BabelPluginOptions;
|
|
48
|
+
/**
|
|
49
|
+
* AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
|
|
53
|
+
*/
|
|
54
|
+
automd?: AutoMDPluginOptions;
|
|
55
|
+
/**
|
|
56
|
+
* Alloy configuration options to use when injecting environment variables into the source code.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* This option allows you to customize the Alloy transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Alloy settings.
|
|
60
|
+
*/
|
|
61
|
+
alloy?: AlloyPluginOptions;
|
|
62
|
+
};
|
|
63
|
+
type EnvPluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
|
|
64
|
+
env: EnvPluginOptions;
|
|
65
|
+
};
|
|
66
|
+
type EnvPluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
|
|
67
|
+
env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
|
|
68
|
+
/**
|
|
69
|
+
* The type definition for the expected env variable parameters
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* This value is parsed from the {@link EnvPluginOptions.types} option.
|
|
73
|
+
*/
|
|
74
|
+
types: TypeDefinition;
|
|
75
|
+
/**
|
|
76
|
+
* The type definition for the expected env secret parameters
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* This value is parsed from the {@link EnvPluginOptions.secrets} option.
|
|
80
|
+
*/
|
|
81
|
+
secrets: TypeDefinition;
|
|
82
|
+
/**
|
|
83
|
+
* Should the plugin inject the env variables in the source code with their values?
|
|
84
|
+
*
|
|
85
|
+
* @remarks
|
|
86
|
+
* This value is the result of reflecting the {@link EnvPluginOptions.inject} option.
|
|
87
|
+
*/
|
|
88
|
+
inject: EnvPluginOptions["inject"];
|
|
89
|
+
/**
|
|
90
|
+
* The prefix used for environment variables
|
|
91
|
+
*
|
|
92
|
+
* @remarks
|
|
93
|
+
* This value is used to filter environment variables that are loaded from the .env file and the process environment.
|
|
94
|
+
*/
|
|
95
|
+
prefix: string[];
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {
|
|
99
|
+
env: {
|
|
100
|
+
/**
|
|
101
|
+
* The type definitions reflection for the env variables and secrets
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.
|
|
105
|
+
*/
|
|
106
|
+
types: {
|
|
107
|
+
/**
|
|
108
|
+
* The type definitions for the expected env variables
|
|
109
|
+
*/
|
|
110
|
+
env: Reflection;
|
|
111
|
+
/**
|
|
112
|
+
* The type definitions for the expected env secrets
|
|
113
|
+
*/
|
|
114
|
+
secrets: Reflection;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* The current **used** environment variables and secrets reflection
|
|
118
|
+
*
|
|
119
|
+
* @remarks
|
|
120
|
+
* This reflection contains the structure of the current environment variables and secrets as defined during the plugin initialization by extracting the values from the source code.
|
|
121
|
+
*/
|
|
122
|
+
used: {
|
|
123
|
+
/**
|
|
124
|
+
* The current env variables reflection
|
|
125
|
+
*/
|
|
126
|
+
env: Reflection<EnvInterface>;
|
|
127
|
+
/**
|
|
128
|
+
* The current env secrets reflection
|
|
129
|
+
*/
|
|
130
|
+
secrets: Reflection<SecretsInterface>;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* The parsed .env configuration object
|
|
134
|
+
*
|
|
135
|
+
* @remarks
|
|
136
|
+
* 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}
|
|
137
|
+
*/
|
|
138
|
+
parsed: DotenvParseOutput;
|
|
139
|
+
/**
|
|
140
|
+
* The injected environment variables and secrets reflection
|
|
141
|
+
*
|
|
142
|
+
* @remarks
|
|
143
|
+
* This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.
|
|
144
|
+
*/
|
|
145
|
+
injected: Reflection;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
declare type __ΩEnvType = any[];
|
|
149
|
+
declare type __ΩEnvPluginOptions = any[];
|
|
150
|
+
declare type __ΩEnvPluginUserConfig = any[];
|
|
151
|
+
declare type __ΩEnvPluginResolvedConfig = any[];
|
|
152
|
+
declare type __ΩEnvPluginContext = any[];
|
|
153
|
+
//#endregion
|
|
154
|
+
export { EnvType as a, __ΩEnvPluginResolvedConfig as c, EnvPluginUserConfig as i, __ΩEnvPluginUserConfig as l, EnvPluginOptions as n, __ΩEnvPluginContext as o, EnvPluginResolvedConfig as r, __ΩEnvPluginOptions as s, EnvPluginContext as t, __ΩEnvType as u };
|
|
155
|
+
//# sourceMappingURL=plugin-DMbVjdcQ.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-DMbVjdcQ.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;KAyCY,OAAA;KAEA,gBAAA,GAAmB,KAAK;EAFxB;AAEZ;;EAA+B,KAAA,CAAA,EAIrB,uBAJqB;EAIrB;;;EAoCA,OAAA,CAAA,EA/BE,uBA+BF;EAQC;;;AAWX;;;EAES,MAAA,CAAA,EAAA,MAAA,GAAA,MAAA,EAAA;EAAgB;AAGzB;;;;EAEkB,MAAA,CAAA,EAAA,OAAA;EAAT;;;;;;EAwBO,aAAA,CAAA,EA1DE,QA0DF;EAAgB;AAYhC;;;;;EAiBW,KAAA,CAAA,EA/ED,kBA+EC;EAKI;;;;;;EAmCD,MAAA,CAAA,EA/GH,mBA+GG;EArDV;;;;;;UAlDM;;KAGE,mBAAA,GAAsB,wBAChC;OACO;;KAGG,uBAAA,GAA0B,4BACpC;OACO,SAAS,KAAK,2CACjB,SAAS,KAAK;;;;;;;WAOL;;;;;;;aAQE;;;;;;;YAQD;;;;;;;;;;UAYC,yCACS,0BAA0B,iCAGhD,mBAAmB,kBACnB,mBAAmB;;;;;;;;;;;;WAYZ;;;;eAKI;;;;;;;;;;;;WAaJ,WAAW;;;;eAKP,WAAW;;;;;;;;YASd;;;;;;;cAQE"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { t as __ΩEnvPluginContext } from "./plugin-eBjQJP6x.mjs";
|
|
2
|
+
import { __ΩBabelPluginPass } from "powerlines/types/babel";
|
|
3
|
+
import { NodePath } from "@babel/core";
|
|
4
|
+
import { stringifyDefaultValue } from "@powerlines/deepkit/utilities";
|
|
5
|
+
import { createBabelPlugin } from "@powerlines/plugin-babel/helpers/create-plugin";
|
|
6
|
+
import { addImport } from "@powerlines/plugin-babel/helpers/module-helpers";
|
|
7
|
+
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
8
|
+
|
|
9
|
+
//#region src/babel/plugin.ts
|
|
10
|
+
function __assignType(fn, args) {
|
|
11
|
+
fn.__type = args;
|
|
12
|
+
return fn;
|
|
13
|
+
}
|
|
14
|
+
const envBabelPlugin = (createBabelPlugin.Ω = [[() => __ΩEnvPluginContext, "n!"]], createBabelPlugin("env", __assignType(({ log, context }) => {
|
|
15
|
+
function extractEnv(node, pass, isInjectable = false) {
|
|
16
|
+
const envTypesAliasProperties = context.env.types.env?.getProperties().filter(__assignType((prop) => prop.getAlias().length > 0, [
|
|
17
|
+
"prop",
|
|
18
|
+
"",
|
|
19
|
+
"P\"2!\"/\""
|
|
20
|
+
]));
|
|
21
|
+
if (node.name) {
|
|
22
|
+
const prefix = context.config.env.prefix.find(__assignType((pre) => node.name && node.name.startsWith(pre) && (context.env.types.env?.hasProperty(node.name.replace(`${pre}_`, "")) || envTypesAliasProperties.some(__assignType((prop) => prop.getAlias().includes(node.name.replace(`${pre}_`, "")), [
|
|
23
|
+
"prop",
|
|
24
|
+
"",
|
|
25
|
+
"P\"2!\"/\""
|
|
26
|
+
]))), [
|
|
27
|
+
"pre",
|
|
28
|
+
"",
|
|
29
|
+
"P\"2!\"/\""
|
|
30
|
+
]));
|
|
31
|
+
let name = node.name;
|
|
32
|
+
if (prefix) name = node.name.replace(`${prefix}_`, "");
|
|
33
|
+
log(LogLevelLabel.TRACE, `Environment variable ${name} found in ${pass.filename || "unknown file"}.`);
|
|
34
|
+
if (context.env.types.env?.hasProperty(name) || envTypesAliasProperties.some(__assignType((prop) => prop.getAlias().includes(name), [
|
|
35
|
+
"prop",
|
|
36
|
+
"",
|
|
37
|
+
"P\"2!\"/\""
|
|
38
|
+
]))) {
|
|
39
|
+
const envProperty = context.env.types.env.hasProperty(name) ? context.env.types.env.getProperty(name) : envTypesAliasProperties.find(__assignType((prop) => prop.getAlias().includes(name), [
|
|
40
|
+
"prop",
|
|
41
|
+
"",
|
|
42
|
+
"P\"2!\"/\""
|
|
43
|
+
]));
|
|
44
|
+
if (!envProperty || envProperty.isIgnored()) return;
|
|
45
|
+
if (!context.env.used.env.hasProperty(name)) {
|
|
46
|
+
log(LogLevelLabel.DEBUG, `Adding "${name}" environment variables found in "${pass.filename || "unknown file"}" to used environment configuration reflection object.`);
|
|
47
|
+
context.env.used.env.addProperty(envProperty.property);
|
|
48
|
+
}
|
|
49
|
+
if (context.config.env.inject && isInjectable) {
|
|
50
|
+
let value = context.env.parsed?.[name];
|
|
51
|
+
if (value === void 0) {
|
|
52
|
+
const prefix$1 = context.config.env.prefix.find(__assignType((pre) => {
|
|
53
|
+
return context.env.parsed[`${pre.replace(/_$/g, "")}_${name}`];
|
|
54
|
+
}, [
|
|
55
|
+
"pre",
|
|
56
|
+
"",
|
|
57
|
+
"P\"2!\"/\""
|
|
58
|
+
]));
|
|
59
|
+
if (prefix$1) value = context.env.parsed[`${prefix$1.replace(/_$/g, "")}_${name}`];
|
|
60
|
+
}
|
|
61
|
+
value ??= envProperty.getDefaultValue();
|
|
62
|
+
if (envProperty.isValueRequired() && value === void 0) throw new Error(`Environment variable \`${name}\` is not defined in the .env configuration files`);
|
|
63
|
+
return stringifyDefaultValue(envProperty, value);
|
|
64
|
+
}
|
|
65
|
+
} else throw new Error(`The "${name}" environment variable is not defined in the \`env\` type definition, but is used in the source code file ${pass.filename ? pass.filename : "unknown"}.
|
|
66
|
+
|
|
67
|
+
The following environment configuration names are defined in the \`env\` type definition: \n${context.env.types.env?.getPropertyNames().sort(__assignType((a, b) => String(a).localeCompare(String(b)), [
|
|
68
|
+
"a",
|
|
69
|
+
"b",
|
|
70
|
+
"",
|
|
71
|
+
"P\"2!\"2\"\"/#"
|
|
72
|
+
])).map(__assignType((typeDef) => ` - ${String(typeDef)} ${envTypesAliasProperties.some(__assignType((prop) => prop.getNameAsString() === String(typeDef) && prop.getAlias().length > 0, [
|
|
73
|
+
"prop",
|
|
74
|
+
"",
|
|
75
|
+
"P\"2!\"/\""
|
|
76
|
+
])) ? `(Alias: ${envTypesAliasProperties?.find(__assignType((prop) => prop.getNameAsString() === String(typeDef), [
|
|
77
|
+
"prop",
|
|
78
|
+
"",
|
|
79
|
+
"P\"2!\"/\""
|
|
80
|
+
]))?.getAlias().join(", ")})` : ""}`, [
|
|
81
|
+
"typeDef",
|
|
82
|
+
"",
|
|
83
|
+
"P\"2!\"/\""
|
|
84
|
+
])).join("\n")} \n\nUsing the following env prefix: \n${context.config.env.prefix.map(__assignType((prefix$1) => ` - ${prefix$1}`, [
|
|
85
|
+
"prefix",
|
|
86
|
+
"",
|
|
87
|
+
"P\"2!\"/\""
|
|
88
|
+
])).join("\n")} \n\nPlease check your \`env\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \n\n`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
extractEnv.__type = [
|
|
92
|
+
"node",
|
|
93
|
+
() => __ΩBabelPluginPass,
|
|
94
|
+
"pass",
|
|
95
|
+
"isInjectable",
|
|
96
|
+
"extractEnv",
|
|
97
|
+
"P!2!n\"2#\"2$\"/%"
|
|
98
|
+
];
|
|
99
|
+
return { visitor: { MemberExpression: __assignType(function MemberExpression(path, pass) {
|
|
100
|
+
if (path.get("object")?.get("property")?.isIdentifier({ name: "env" }) && path.get("object")?.get("object")?.isIdentifier({ name: "process" }) && path.get("property")?.isIdentifier()) {
|
|
101
|
+
const identifier = path.get("property")?.node;
|
|
102
|
+
if (!identifier.name) return;
|
|
103
|
+
extractEnv(identifier, pass, false);
|
|
104
|
+
path.replaceWithSourceString(`env.${identifier.name}`);
|
|
105
|
+
addImport(path, {
|
|
106
|
+
module: `${context.config.framework || "powerlines"}:env`,
|
|
107
|
+
name: "env",
|
|
108
|
+
imported: "env"
|
|
109
|
+
});
|
|
110
|
+
} else if (path.get("object")?.get("property")?.isIdentifier({ name: "env" }) && path.get("object")?.get("object")?.isMetaProperty() && path.get("property")?.isIdentifier()) {
|
|
111
|
+
const identifier = path.get("property")?.node;
|
|
112
|
+
if (!identifier.name) return;
|
|
113
|
+
extractEnv(identifier, pass, false);
|
|
114
|
+
path.replaceWithSourceString(`env.${identifier.name}`);
|
|
115
|
+
addImport(path, {
|
|
116
|
+
module: `${context.config.framework || "powerlines"}:env`,
|
|
117
|
+
name: "env",
|
|
118
|
+
imported: "env"
|
|
119
|
+
});
|
|
120
|
+
} else if (path.get("object")?.isIdentifier({ name: "env" }) && path.get("property")?.isIdentifier()) {
|
|
121
|
+
const identifier = path.get("property")?.node;
|
|
122
|
+
if (!identifier.name) return;
|
|
123
|
+
extractEnv(identifier, pass, false);
|
|
124
|
+
}
|
|
125
|
+
}, [
|
|
126
|
+
() => NodePath,
|
|
127
|
+
"path",
|
|
128
|
+
() => __ΩBabelPluginPass,
|
|
129
|
+
"pass",
|
|
130
|
+
"MemberExpression",
|
|
131
|
+
"PP!7!2\"n#2$\"/%"
|
|
132
|
+
]) } };
|
|
133
|
+
}, [
|
|
134
|
+
"param0",
|
|
135
|
+
"",
|
|
136
|
+
"P\"2!\"/\""
|
|
137
|
+
])));
|
|
138
|
+
|
|
139
|
+
//#endregion
|
|
140
|
+
export { envBabelPlugin as t };
|
|
141
|
+
//# sourceMappingURL=plugin-Vyvy9w9Z.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-Vyvy9w9Z.mjs","names":[],"sources":["../src/babel/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 { NodePath } from \"@babel/core\";\nimport * as t from \"@babel/types\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\n\nimport { createBabelPlugin } from \"@powerlines/plugin-babel/helpers/create-plugin\";\nimport { addImport } from \"@powerlines/plugin-babel/helpers/module-helpers\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { BabelPluginPass } from \"powerlines/types/babel\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/*\n * The Powerlines - Environment Configuration Babel Plugin\n *\n * @param babel - The Babel core module\n * @returns The Babel plugin object\n */\nexport const envBabelPlugin = createBabelPlugin<EnvPluginContext>(\n \"env\",\n ({ log, context }) => {\n function extractEnv(\n node: t.Identifier,\n pass: BabelPluginPass,\n isInjectable = false\n ) {\n const envTypesAliasProperties = context.env.types.env\n ?.getProperties()\n .filter(prop => prop.getAlias().length > 0);\n\n if (node.name) {\n const prefix = context.config.env.prefix.find(\n pre =>\n node.name &&\n node.name.startsWith(pre) &&\n (context.env.types.env?.hasProperty(\n node.name.replace(`${pre}_`, \"\")\n ) ||\n envTypesAliasProperties.some(prop =>\n prop.getAlias().includes(node.name.replace(`${pre}_`, \"\"))\n ))\n );\n\n let name = node.name;\n if (prefix) {\n name = node.name.replace(`${prefix}_`, \"\");\n }\n\n log(\n LogLevelLabel.TRACE,\n `Environment variable ${name} found in ${\n pass.filename || \"unknown file\"\n }.`\n );\n\n if (\n context.env.types.env?.hasProperty(name) ||\n envTypesAliasProperties.some(prop => prop.getAlias().includes(name))\n ) {\n const envProperty = context.env.types.env.hasProperty(name)\n ? context.env.types.env.getProperty(name)\n : envTypesAliasProperties.find(prop =>\n prop.getAlias().includes(name)\n );\n if (!envProperty || envProperty.isIgnored()) {\n return;\n }\n\n if (!context.env.used.env.hasProperty(name)) {\n log(\n LogLevelLabel.DEBUG,\n `Adding \"${name}\" environment variables found in \"${\n pass.filename || \"unknown file\"\n }\" to used environment configuration reflection object.`\n );\n\n context.env.used.env.addProperty(envProperty.property);\n }\n\n if (context.config.env.inject && isInjectable) {\n let value = context.env.parsed?.[name];\n if (value === undefined) {\n const prefix = context.config.env.prefix.find(pre => {\n return context.env.parsed[`${pre.replace(/_$/g, \"\")}_${name}`];\n });\n if (prefix) {\n value =\n context.env.parsed[`${prefix.replace(/_$/g, \"\")}_${name}`];\n }\n }\n\n value ??= envProperty.getDefaultValue();\n\n if (envProperty.isValueRequired() && value === undefined) {\n throw new Error(\n `Environment variable \\`${name}\\` is not defined in the .env configuration files`\n );\n }\n\n return stringifyDefaultValue(envProperty, value);\n }\n } else {\n throw new Error(\n `The \"${name}\" environment variable is not defined in the \\`env\\` type definition, but is used in the source code file ${\n pass.filename ? pass.filename : \"unknown\"\n }.\n\n The following environment configuration names are defined in the \\`env\\` type definition: \\n${context.env.types.env\n ?.getPropertyNames()\n .sort((a, b) => String(a).localeCompare(String(b)))\n .map(\n typeDef =>\n ` - ${String(typeDef)} ${\n envTypesAliasProperties.some(\n prop =>\n prop.getNameAsString() === String(typeDef) &&\n prop.getAlias().length > 0\n )\n ? `(Alias: ${envTypesAliasProperties\n ?.find(\n prop => prop.getNameAsString() === String(typeDef)\n )\n ?.getAlias()\n .join(\", \")})`\n : \"\"\n }`\n )\n .join(\n \"\\n\"\n )} \\n\\nUsing the following env prefix: \\n${context.config.env.prefix\n .map(prefix => ` - ${prefix}`)\n .join(\n \"\\n\"\n )} \\n\\nPlease check your \\`env\\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \\n\\n`\n );\n }\n }\n\n return undefined;\n }\n\n return {\n visitor: {\n MemberExpression(\n path: NodePath<t.MemberExpression>,\n pass: BabelPluginPass\n ) {\n if (\n path\n .get(\"object\")\n ?.get(\"property\")\n ?.isIdentifier({ name: \"env\" }) &&\n path\n .get(\"object\")\n ?.get(\"object\")\n ?.isIdentifier({ name: \"process\" }) &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // process.env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false);\n\n path.replaceWithSourceString(`env.${identifier.name}`);\n addImport(path, {\n module: `${context.config.framework || \"powerlines\"}:env`,\n name: \"env\",\n imported: \"env\"\n });\n } else if (\n path\n .get(\"object\")\n ?.get(\"property\")\n ?.isIdentifier({ name: \"env\" }) &&\n path.get(\"object\")?.get(\"object\")?.isMetaProperty() &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // import.meta.env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false);\n\n path.replaceWithSourceString(`env.${identifier.name}`);\n addImport(path, {\n module: `${context.config.framework || \"powerlines\"}:env`,\n name: \"env\",\n imported: \"env\"\n });\n } else if (\n path.get(\"object\")?.isIdentifier({ name: \"env\" }) &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false);\n }\n }\n }\n };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
+
import { n as __ΩSecretsInterface, t as __ΩEnvInterface } from "./runtime-C5ukCv3P.mjs";
|
|
2
|
+
import { __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from "@powerlines/plugin-babel/types";
|
|
3
|
+
import { __ΩAutoMDPluginOptions } from "@powerlines/plugin-automd/types/plugin";
|
|
4
|
+
import { __ΩAlloyPluginContext, __ΩAlloyPluginOptions, __ΩAlloyPluginResolvedConfig, __ΩAlloyPluginUserConfig } from "@powerlines/plugin-alloy/types";
|
|
5
|
+
import { __ΩReflection } from "@powerlines/deepkit/types";
|
|
6
|
+
|
|
7
|
+
//#region src/types/plugin.ts
|
|
8
|
+
const __ΩOmit = [
|
|
9
|
+
"T",
|
|
10
|
+
"K",
|
|
11
|
+
() => __ΩPick,
|
|
12
|
+
() => __ΩExclude,
|
|
13
|
+
"Omit",
|
|
14
|
+
"b!b\"e!!e!!ge!\"o$#o##w%y"
|
|
15
|
+
];
|
|
16
|
+
const __ΩRequired = [
|
|
17
|
+
"T",
|
|
18
|
+
"Required",
|
|
19
|
+
"l+e#!e\"!fRb!Pde\"!gN##w\"y"
|
|
20
|
+
];
|
|
21
|
+
const __ΩPick = [
|
|
22
|
+
"T",
|
|
23
|
+
"K",
|
|
24
|
+
"Pick",
|
|
25
|
+
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
26
|
+
];
|
|
27
|
+
const __ΩExclude = [
|
|
28
|
+
"T",
|
|
29
|
+
"U",
|
|
30
|
+
"Exclude",
|
|
31
|
+
"l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
|
|
32
|
+
];
|
|
33
|
+
const __ΩEnvType = [
|
|
34
|
+
"env",
|
|
35
|
+
"secrets",
|
|
36
|
+
"EnvType",
|
|
37
|
+
"P.!.\"Jw#y"
|
|
38
|
+
];
|
|
39
|
+
const __ΩEnvPluginOptions = [
|
|
40
|
+
() => __ΩOmit,
|
|
41
|
+
"types",
|
|
42
|
+
"types",
|
|
43
|
+
"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\"`.",
|
|
44
|
+
"secrets",
|
|
45
|
+
"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\"`.",
|
|
46
|
+
"prefix",
|
|
47
|
+
"An additional prefix (or list of additional prefixes) to apply to the environment variables",
|
|
48
|
+
"inject",
|
|
49
|
+
true,
|
|
50
|
+
"Should the plugin inject the env variables in the source code with their values?",
|
|
51
|
+
"Children",
|
|
52
|
+
"defaultConfig",
|
|
53
|
+
"The default configuration to use when loading environment variables.",
|
|
54
|
+
() => __ΩBabelPluginOptions,
|
|
55
|
+
"babel",
|
|
56
|
+
"Babel configuration options to use when injecting environment variables into the source code.",
|
|
57
|
+
() => __ΩAutoMDPluginOptions,
|
|
58
|
+
"automd",
|
|
59
|
+
"AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.",
|
|
60
|
+
() => __ΩAlloyPluginOptions,
|
|
61
|
+
"alloy",
|
|
62
|
+
"Alloy configuration options to use when injecting environment variables into the source code.",
|
|
63
|
+
"EnvPluginOptions",
|
|
64
|
+
"P!.\"o!#P!4#8?$!4%8?&P&&FJ4'8?()4)8>*?+\"w,4-8?.n/408?1n2438?4n5468?7MKw8y"
|
|
65
|
+
];
|
|
66
|
+
const __ΩEnvPluginUserConfig = [
|
|
67
|
+
() => __ΩBabelPluginUserConfig,
|
|
68
|
+
() => __ΩAlloyPluginUserConfig,
|
|
69
|
+
() => __ΩEnvPluginOptions,
|
|
70
|
+
"env",
|
|
71
|
+
"EnvPluginUserConfig",
|
|
72
|
+
"Pn!n\"Pn#4$MKw%y"
|
|
73
|
+
];
|
|
74
|
+
const __ΩEnvPluginResolvedConfig = [
|
|
75
|
+
() => __ΩBabelPluginResolvedConfig,
|
|
76
|
+
() => __ΩAlloyPluginResolvedConfig,
|
|
77
|
+
() => __ΩRequired,
|
|
78
|
+
() => __ΩPick,
|
|
79
|
+
"additionalFiles",
|
|
80
|
+
() => __ΩRequired,
|
|
81
|
+
() => __ΩPick,
|
|
82
|
+
() => __ΩEnvPluginOptions,
|
|
83
|
+
"defaultConfig",
|
|
84
|
+
"types",
|
|
85
|
+
"The type definition for the expected env variable parameters",
|
|
86
|
+
"secrets",
|
|
87
|
+
"The type definition for the expected env secret parameters",
|
|
88
|
+
() => __ΩEnvPluginOptions,
|
|
89
|
+
"inject",
|
|
90
|
+
"inject",
|
|
91
|
+
"Should the plugin inject the env variables in the source code with their values?",
|
|
92
|
+
"prefix",
|
|
93
|
+
"The prefix used for environment variables",
|
|
94
|
+
"env",
|
|
95
|
+
"EnvPluginResolvedConfig",
|
|
96
|
+
"Pn!n\"PP!.%o$#o#\"n(.)o'#o&\"P!4*?+!4,?-n../f40?1&F42?3MK44MKw5y"
|
|
97
|
+
];
|
|
98
|
+
const __ΩEnvPluginContext = [
|
|
99
|
+
() => __ΩEnvPluginResolvedConfig,
|
|
100
|
+
"TResolvedConfig",
|
|
101
|
+
() => __ΩBabelPluginContext,
|
|
102
|
+
() => __ΩAlloyPluginContext,
|
|
103
|
+
() => __ΩReflection,
|
|
104
|
+
"env",
|
|
105
|
+
"The type definitions for the expected env variables",
|
|
106
|
+
() => __ΩReflection,
|
|
107
|
+
"secrets",
|
|
108
|
+
"The type definitions for the expected env secrets",
|
|
109
|
+
"The type definitions reflection for the env variables and secrets",
|
|
110
|
+
"types",
|
|
111
|
+
() => __ΩReflection,
|
|
112
|
+
() => __ΩEnvInterface,
|
|
113
|
+
"The current env variables reflection",
|
|
114
|
+
() => __ΩReflection,
|
|
115
|
+
() => __ΩSecretsInterface,
|
|
116
|
+
"The current env secrets reflection",
|
|
117
|
+
"The current **used** environment variables and secrets reflection",
|
|
118
|
+
"used",
|
|
119
|
+
"parsed",
|
|
120
|
+
"The parsed .env configuration object",
|
|
121
|
+
() => __ΩReflection,
|
|
122
|
+
"injected",
|
|
123
|
+
"The injected environment variables and secrets reflection",
|
|
124
|
+
"EnvPluginContext",
|
|
125
|
+
"n!c\"Pe\"!o#\"e\"!o$\"PPn%4&?'n(4)?*M?+4,?+Pn.o-\"4&?/n1o0\"4)?2M?344?3!45?6n748?9M4&Mw:y"
|
|
126
|
+
];
|
|
127
|
+
|
|
128
|
+
//#endregion
|
|
129
|
+
export { __ΩEnvType as a, __ΩEnvPluginUserConfig as i, __ΩEnvPluginOptions as n, __ΩEnvPluginResolvedConfig as r, __ΩEnvPluginContext as t };
|
|
130
|
+
//# sourceMappingURL=plugin-eBjQJP6x.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-eBjQJP6x.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 { Reflection } from \"@powerlines/deepkit/types\";\nimport {\n AlloyPluginContext,\n AlloyPluginOptions,\n AlloyPluginResolvedConfig,\n AlloyPluginUserConfig\n} from \"@powerlines/plugin-alloy/types\";\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 { DotenvParseOutput } from \"@stryke/env/types\";\nimport {\n DotenvConfiguration,\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport { EnvInterface, SecretsInterface } from \"./runtime\";\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 types?: TypeDefinitionParameter;\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?: TypeDefinitionParameter;\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 * 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 /**\n * Alloy configuration options to use when injecting environment variables into the source code.\n *\n * @remarks\n * This option allows you to customize the Alloy transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Alloy settings.\n */\n alloy?: AlloyPluginOptions;\n};\n\nexport type EnvPluginUserConfig = BabelPluginUserConfig &\n AlloyPluginUserConfig & {\n env: EnvPluginOptions;\n };\n\nexport type EnvPluginResolvedConfig = BabelPluginResolvedConfig &\n AlloyPluginResolvedConfig & {\n env: Required<Pick<DotenvConfiguration, \"additionalFiles\">> &\n Required<Pick<EnvPluginOptions, \"defaultConfig\">> & {\n /**\n * The type definition for the expected env variable parameters\n *\n * @remarks\n * This value is parsed from the {@link EnvPluginOptions.types} option.\n */\n types: TypeDefinition;\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: TypeDefinition;\n\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: EnvPluginOptions[\"inject\"];\n\n /**\n * The prefix used for environment variables\n *\n * @remarks\n * This value is used to filter environment variables that are loaded from the .env file and the process environment.\n */\n prefix: string[];\n };\n };\n\nexport interface EnvPluginContext<\n TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig\n>\n extends\n BabelPluginContext<TResolvedConfig>,\n AlloyPluginContext<TResolvedConfig> {\n env: {\n /**\n * The type definitions reflection for the env variables and secrets\n *\n * @remarks\n * These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.\n */\n types: {\n /**\n * The type definitions for the expected env variables\n */\n env: Reflection;\n\n /**\n * The type definitions for the expected env secrets\n */\n secrets: Reflection;\n };\n\n /**\n * The current **used** environment variables and secrets reflection\n *\n * @remarks\n * This reflection contains the structure of the current environment variables and secrets as defined during the plugin initialization by extracting the values from the source code.\n */\n used: {\n /**\n * The current env variables reflection\n */\n env: Reflection<EnvInterface>;\n\n /**\n * The current env secrets reflection\n */\n secrets: Reflection<SecretsInterface>;\n };\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: Reflection;\n };\n}\n"],"mappings":";;;;;;;AAAA,MAAM,UAAU;CAAC;CAAK;OAAW;OAAe;CAAY;CAAQ;CAAC;;;;;;AAErE,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAAY;;;;;;;AA0B/C,MAAM,aAAa;CAAC;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,sBAAqB;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;OAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAE3B,MAAM,yBAAyB;OAAO;OAAC;OAAA;CAAA;CAAA;CAAA;CAAA;AAEvC,MAAM,6BAAC;OAAA;OAAA;OAAA;OAAA;CAAA;OAAA;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEP,MAAM,sBAAU;OAAA;CAAA;OAAA;OAAA;OAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;OAAA;OAAA;CAAA;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { n as SecretsInterface, t as EnvInterface } from "./runtime-BDzzR4wH.cjs";
|
|
2
|
+
import { t as EnvPluginContext } from "./plugin-CSe5f2cD.cjs";
|
|
3
|
+
import { ReflectionClass, TypeClass, TypeObjectLiteral } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
|
|
5
|
+
//#region src/helpers/reflect.d.ts
|
|
6
|
+
declare function mergeEnvReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
|
|
7
|
+
declare function mergeSecretsReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
|
|
8
|
+
interface CreateEnvReflectionOptions {
|
|
9
|
+
type?: TypeObjectLiteral | TypeClass;
|
|
10
|
+
superReflection?: ReflectionClass<any>;
|
|
11
|
+
}
|
|
12
|
+
declare class BaseEnv implements EnvInterface {
|
|
13
|
+
APP_NAME: string;
|
|
14
|
+
APP_VERSION: string;
|
|
15
|
+
BUILD_ID: string;
|
|
16
|
+
BUILD_TIMESTAMP: string;
|
|
17
|
+
BUILD_CHECKSUM: string;
|
|
18
|
+
RELEASE_ID: string;
|
|
19
|
+
RELEASE_TAG: string;
|
|
20
|
+
ORGANIZATION: string;
|
|
21
|
+
PLATFORM: "node" | "browser" | "neutral";
|
|
22
|
+
MODE: "development" | "test" | "production";
|
|
23
|
+
ENVIRONMENT: string;
|
|
24
|
+
DEBUG: boolean;
|
|
25
|
+
TEST: boolean;
|
|
26
|
+
MINIMAL: boolean;
|
|
27
|
+
NO_COLOR: boolean;
|
|
28
|
+
FORCE_COLOR: number | boolean;
|
|
29
|
+
FORCE_HYPERLINK: number | boolean;
|
|
30
|
+
STACKTRACE: boolean;
|
|
31
|
+
INCLUDE_ERROR_DATA: boolean;
|
|
32
|
+
ERROR_URL: string;
|
|
33
|
+
DEFAULT_TIMEZONE: string;
|
|
34
|
+
DEFAULT_LOCALE: string;
|
|
35
|
+
CI: boolean;
|
|
36
|
+
}
|
|
37
|
+
declare class BaseSecrets implements SecretsInterface {
|
|
38
|
+
ENCRYPTION_KEY: string;
|
|
39
|
+
}
|
|
40
|
+
declare function createEnvReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
|
|
41
|
+
declare function createSecretsReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
|
|
42
|
+
declare function reflectEnv(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
|
|
43
|
+
declare function reflectSecrets(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
|
|
44
|
+
declare type __ΩCreateEnvReflectionOptions = any[];
|
|
45
|
+
//#endregion
|
|
46
|
+
export { createEnvReflection as a, mergeSecretsReflections as c, __ΩCreateEnvReflectionOptions as i, reflectEnv as l, BaseSecrets as n, createSecretsReflection as o, CreateEnvReflectionOptions as r, mergeEnvReflections as s, BaseEnv as t, reflectSecrets as u };
|
|
47
|
+
//# sourceMappingURL=reflect-Dm8a3c29.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflect-Dm8a3c29.d.cts","names":[],"sources":["../src/helpers/reflect.ts"],"sourcesContent":[],"mappings":";;;;;iBAuCgB,mBAAA,UACL,+BACI,yBACZ;iBAQa,uBAAA,UACL,+BACI,yBACZ;AAda,UAsBC,0BAAA,CAtBkB;EACxB,IAAA,CAAA,EAsBF,iBAtBE,GAsBkB,SAtBlB;EACI,eAAA,CAAA,EAsBK,eAtBL,CAAA,GAAA,CAAA;;AACG,cAwBL,OAAA,YAAmB,YAxBd,CAAA;EAQF,QAAA,EAAA,MAAA;EACL,WAAA,EAAA,MAAA;EACI,QAAA,EAAA,MAAA;EACZ,eAAA,EAAA,MAAA;EAAe,cAAA,EAAA,MAAA;EAQD,UAAA,EAAA,MAAA;EACR,WAAA,EAAA,MAAA;EAAoB,YAAA,EAAA,MAAA;EACT,QAAA,EAAA,MAAA,GAAA,SAAA,GAAA,SAAA;EAAe,IAAA,EAAA,aAAA,GAAA,MAAA,GAAA,YAAA;EAGtB,WAAQ,EAAA,MAAA;EAgDR,KAAA,EAAA,OAAY;EAIT,IAAA,EAAA,OAAA;EACL,OAAA,EAAA,OAAA;EACA,QAAA,EAAA,OAAA;EACR,WAAA,EAAA,MAAA,GAAA,OAAA;EAAe,eAAA,EAAA,MAAA,GAAA,OAAA;EAyCF,UAAA,EAAA,OAAA;EACL,kBAAA,EAAA,OAAA;EACA,SAAA,EAAA,MAAA;EACR,gBAAA,EAAA,MAAA;EAAe,cAAA,EAAA,MAAA;EAyCI,EAAA,EAAA,OAAA;;AAGP,cA/FF,WAAA,YAAuB,gBA+FrB,CAAA;EAAA,cAAA,EAAA,MAAA;;AAwCO,iBAnIN,mBAAA,CAmIoB,OAAA,EAlIzB,gBAkIyB,EAAA,OAAA,CAAA,EAjIzB,0BAiIyB,CAAA,EAhIjC,eAgIiC,CAAA,GAAA,CAAA;AACzB,iBAxFK,uBAAA,CAwFL,OAAA,EAvFA,gBAuFA,EAAA,OAAA,CAAA,EAtFA,0BAsFA,CAAA,EArFR,eAqFQ,CAAA,GAAA,CAAA;AAEI,iBA9CO,UAAA,CA8CP,OAAA,EA7CJ,gBA6CI,EAAA,IAAA,CAAA,EAAA,MAAA,EAAA,IAAA,CAAA,EAAA,MAAA,CAAA,EA3CA,OA2CA,CA3CA,eA2CA,CAAA,GAAA,CAAA,CAAA;AAAA,iBAHO,cAAA,CAGP,OAAA,EAFJ,gBAEI,EAAA,IAAA,CAAA,EAAA,MAAA,EAAA,IAAA,CAAA,EAAA,MAAA,CAAA,EAAA,OAAA,CAAA,eAAA,CAAA,GAAA,CAAA,CAAA;AAAA,6CAAA,GAAA,EAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { n as SecretsInterface, t as EnvInterface } from "./runtime-lYSIZdMn.mjs";
|
|
2
|
+
import { t as EnvPluginContext } from "./plugin-DMbVjdcQ.mjs";
|
|
3
|
+
import { ReflectionClass, TypeClass, TypeObjectLiteral } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
|
|
5
|
+
//#region src/helpers/reflect.d.ts
|
|
6
|
+
declare function mergeEnvReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
|
|
7
|
+
declare function mergeSecretsReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
|
|
8
|
+
interface CreateEnvReflectionOptions {
|
|
9
|
+
type?: TypeObjectLiteral | TypeClass;
|
|
10
|
+
superReflection?: ReflectionClass<any>;
|
|
11
|
+
}
|
|
12
|
+
declare class BaseEnv implements EnvInterface {
|
|
13
|
+
APP_NAME: string;
|
|
14
|
+
APP_VERSION: string;
|
|
15
|
+
BUILD_ID: string;
|
|
16
|
+
BUILD_TIMESTAMP: string;
|
|
17
|
+
BUILD_CHECKSUM: string;
|
|
18
|
+
RELEASE_ID: string;
|
|
19
|
+
RELEASE_TAG: string;
|
|
20
|
+
ORGANIZATION: string;
|
|
21
|
+
PLATFORM: "node" | "browser" | "neutral";
|
|
22
|
+
MODE: "development" | "test" | "production";
|
|
23
|
+
ENVIRONMENT: string;
|
|
24
|
+
DEBUG: boolean;
|
|
25
|
+
TEST: boolean;
|
|
26
|
+
MINIMAL: boolean;
|
|
27
|
+
NO_COLOR: boolean;
|
|
28
|
+
FORCE_COLOR: number | boolean;
|
|
29
|
+
FORCE_HYPERLINK: number | boolean;
|
|
30
|
+
STACKTRACE: boolean;
|
|
31
|
+
INCLUDE_ERROR_DATA: boolean;
|
|
32
|
+
ERROR_URL: string;
|
|
33
|
+
DEFAULT_TIMEZONE: string;
|
|
34
|
+
DEFAULT_LOCALE: string;
|
|
35
|
+
CI: boolean;
|
|
36
|
+
}
|
|
37
|
+
declare class BaseSecrets implements SecretsInterface {
|
|
38
|
+
ENCRYPTION_KEY: string;
|
|
39
|
+
}
|
|
40
|
+
declare function createEnvReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
|
|
41
|
+
declare function createSecretsReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
|
|
42
|
+
declare function reflectEnv(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
|
|
43
|
+
declare function reflectSecrets(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
|
|
44
|
+
declare type __ΩCreateEnvReflectionOptions = any[];
|
|
45
|
+
//#endregion
|
|
46
|
+
export { createEnvReflection as a, mergeSecretsReflections as c, __ΩCreateEnvReflectionOptions as i, reflectEnv as l, BaseSecrets as n, createSecretsReflection as o, CreateEnvReflectionOptions as r, mergeEnvReflections as s, BaseEnv as t, reflectSecrets as u };
|
|
47
|
+
//# sourceMappingURL=reflect-Dpz8ifa0.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflect-Dpz8ifa0.d.mts","names":[],"sources":["../src/helpers/reflect.ts"],"sourcesContent":[],"mappings":";;;;;iBAuCgB,mBAAA,UACL,+BACI,yBACZ;iBAQa,uBAAA,UACL,+BACI,yBACZ;AAda,UAsBC,0BAAA,CAtBkB;EACxB,IAAA,CAAA,EAsBF,iBAtBE,GAsBkB,SAtBlB;EACI,eAAA,CAAA,EAsBK,eAtBL,CAAA,GAAA,CAAA;;AACG,cAwBL,OAAA,YAAmB,YAxBd,CAAA;EAQF,QAAA,EAAA,MAAA;EACL,WAAA,EAAA,MAAA;EACI,QAAA,EAAA,MAAA;EACZ,eAAA,EAAA,MAAA;EAAe,cAAA,EAAA,MAAA;EAQD,UAAA,EAAA,MAAA;EACR,WAAA,EAAA,MAAA;EAAoB,YAAA,EAAA,MAAA;EACT,QAAA,EAAA,MAAA,GAAA,SAAA,GAAA,SAAA;EAAe,IAAA,EAAA,aAAA,GAAA,MAAA,GAAA,YAAA;EAGtB,WAAQ,EAAA,MAAA;EAgDR,KAAA,EAAA,OAAY;EAIT,IAAA,EAAA,OAAA;EACL,OAAA,EAAA,OAAA;EACA,QAAA,EAAA,OAAA;EACR,WAAA,EAAA,MAAA,GAAA,OAAA;EAAe,eAAA,EAAA,MAAA,GAAA,OAAA;EAyCF,UAAA,EAAA,OAAA;EACL,kBAAA,EAAA,OAAA;EACA,SAAA,EAAA,MAAA;EACR,gBAAA,EAAA,MAAA;EAAe,cAAA,EAAA,MAAA;EAyCI,EAAA,EAAA,OAAA;;AAGP,cA/FF,WAAA,YAAuB,gBA+FrB,CAAA;EAAA,cAAA,EAAA,MAAA;;AAwCO,iBAnIN,mBAAA,CAmIoB,OAAA,EAlIzB,gBAkIy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