@powerlines/plugin-env 0.16.156 → 0.16.158
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/package.json +9 -9
- package/dist/_virtual/_rolldown/runtime.cjs +0 -29
- package/dist/babel/index.cjs +0 -4
- package/dist/babel/index.d.cts +0 -2
- package/dist/babel/index.d.mts +0 -2
- package/dist/babel/index.mjs +0 -3
- package/dist/babel/plugin.cjs +0 -130
- package/dist/babel/plugin.d.cts +0 -8
- package/dist/babel/plugin.d.cts.map +0 -1
- package/dist/babel/plugin.d.mts +0 -8
- package/dist/babel/plugin.d.mts.map +0 -1
- package/dist/babel/plugin.mjs +0 -129
- package/dist/babel/plugin.mjs.map +0 -1
- package/dist/components/docs.cjs +0 -111
- package/dist/components/docs.d.cts +0 -24
- package/dist/components/docs.d.cts.map +0 -1
- package/dist/components/docs.d.mts +0 -24
- package/dist/components/docs.d.mts.map +0 -1
- package/dist/components/docs.mjs +0 -109
- package/dist/components/docs.mjs.map +0 -1
- package/dist/components/env-builtin.cjs +0 -815
- package/dist/components/env-builtin.d.cts +0 -21
- package/dist/components/env-builtin.d.cts.map +0 -1
- package/dist/components/env-builtin.d.mts +0 -21
- package/dist/components/env-builtin.d.mts.map +0 -1
- package/dist/components/env-builtin.mjs +0 -811
- package/dist/components/env-builtin.mjs.map +0 -1
- package/dist/components/index.cjs +0 -9
- package/dist/components/index.d.cts +0 -3
- package/dist/components/index.d.mts +0 -3
- package/dist/components/index.mjs +0 -4
- package/dist/helpers/automd-generator.cjs +0 -32
- package/dist/helpers/automd-generator.d.cts +0 -14
- package/dist/helpers/automd-generator.d.cts.map +0 -1
- package/dist/helpers/automd-generator.d.mts +0 -14
- package/dist/helpers/automd-generator.d.mts.map +0 -1
- package/dist/helpers/automd-generator.mjs +0 -31
- package/dist/helpers/automd-generator.mjs.map +0 -1
- package/dist/helpers/create-reflection-resource.cjs +0 -23
- package/dist/helpers/create-reflection-resource.d.cts +0 -13
- package/dist/helpers/create-reflection-resource.d.cts.map +0 -1
- package/dist/helpers/create-reflection-resource.d.mts +0 -13
- package/dist/helpers/create-reflection-resource.d.mts.map +0 -1
- package/dist/helpers/create-reflection-resource.mjs +0 -23
- package/dist/helpers/create-reflection-resource.mjs.map +0 -1
- package/dist/helpers/index.cjs +0 -34
- package/dist/helpers/index.d.cts +0 -7
- package/dist/helpers/index.d.mts +0 -7
- package/dist/helpers/index.mjs +0 -8
- package/dist/helpers/load.cjs +0 -139
- package/dist/helpers/load.d.cts +0 -36
- package/dist/helpers/load.d.cts.map +0 -1
- package/dist/helpers/load.d.mts +0 -36
- package/dist/helpers/load.d.mts.map +0 -1
- package/dist/helpers/load.mjs +0 -136
- package/dist/helpers/load.mjs.map +0 -1
- package/dist/helpers/persistence.cjs +0 -308
- package/dist/helpers/persistence.d.cts +0 -84
- package/dist/helpers/persistence.d.cts.map +0 -1
- package/dist/helpers/persistence.d.mts +0 -84
- package/dist/helpers/persistence.d.mts.map +0 -1
- package/dist/helpers/persistence.mjs +0 -296
- package/dist/helpers/persistence.mjs.map +0 -1
- package/dist/helpers/reflect.cjs +0 -290
- package/dist/helpers/reflect.d.cts +0 -68
- package/dist/helpers/reflect.d.cts.map +0 -1
- package/dist/helpers/reflect.d.mts +0 -68
- package/dist/helpers/reflect.d.mts.map +0 -1
- package/dist/helpers/reflect.mjs +0 -281
- package/dist/helpers/reflect.mjs.map +0 -1
- package/dist/helpers/source-file-env.cjs +0 -59
- package/dist/helpers/source-file-env.d.cts +0 -9
- package/dist/helpers/source-file-env.d.cts.map +0 -1
- package/dist/helpers/source-file-env.d.mts +0 -9
- package/dist/helpers/source-file-env.d.mts.map +0 -1
- package/dist/helpers/source-file-env.mjs +0 -57
- package/dist/helpers/source-file-env.mjs.map +0 -1
- package/dist/helpers/template-helpers.cjs +0 -70
- package/dist/helpers/template-helpers.d.cts +0 -15
- package/dist/helpers/template-helpers.d.cts.map +0 -1
- package/dist/helpers/template-helpers.d.mts +0 -15
- package/dist/helpers/template-helpers.d.mts.map +0 -1
- package/dist/helpers/template-helpers.mjs +0 -69
- package/dist/helpers/template-helpers.mjs.map +0 -1
- package/dist/index.cjs +0 -241
- package/dist/index.d.cts +0 -17
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts +0 -17
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -235
- package/dist/index.mjs.map +0 -1
- package/dist/types/index.cjs +0 -11
- package/dist/types/index.d.cts +0 -3
- package/dist/types/index.d.mts +0 -3
- package/dist/types/index.mjs +0 -4
- package/dist/types/plugin.cjs +0 -115
- package/dist/types/plugin.d.cts +0 -163
- package/dist/types/plugin.d.cts.map +0 -1
- package/dist/types/plugin.d.mts +0 -163
- package/dist/types/plugin.d.mts.map +0 -1
- package/dist/types/plugin.mjs +0 -110
- package/dist/types/plugin.mjs.map +0 -1
- package/dist/types/runtime.cjs +0 -535
- package/dist/types/runtime.d.cts +0 -934
- package/dist/types/runtime.d.cts.map +0 -1
- package/dist/types/runtime.d.mts +0 -934
- package/dist/types/runtime.d.mts.map +0 -1
- package/dist/types/runtime.mjs +0 -533
- package/dist/types/runtime.mjs.map +0 -1
package/dist/types/plugin.d.mts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { EnvInterface, SecretsInterface } from "./runtime.mjs";
|
|
2
|
-
import { DotenvParseOutput } from "@stryke/env/types";
|
|
3
|
-
import { Children } from "@alloy-js/core";
|
|
4
|
-
import { Reflection } from "@powerlines/deepkit/types";
|
|
5
|
-
import { AutoMDPluginOptions } from "@powerlines/plugin-automd/types/plugin";
|
|
6
|
-
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types";
|
|
7
|
-
import { DeepkitPluginContext, DeepkitPluginOptions, DeepkitPluginResolvedConfig, DeepkitPluginUserConfig } from "@powerlines/plugin-deepkit/types/plugin";
|
|
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
|
-
* Should the plugin validate the loaded environment variables against the provided type definitions?
|
|
36
|
-
*
|
|
37
|
-
* @defaultValue false
|
|
38
|
-
*/
|
|
39
|
-
validate?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* The default configuration to use when loading environment variables.
|
|
42
|
-
*
|
|
43
|
-
* @remarks
|
|
44
|
-
* 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.
|
|
45
|
-
*/
|
|
46
|
-
defaultConfig?: Children;
|
|
47
|
-
/**
|
|
48
|
-
* Babel configuration options to use when injecting environment variables into the source code.
|
|
49
|
-
*
|
|
50
|
-
* @remarks
|
|
51
|
-
* 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.
|
|
52
|
-
*/
|
|
53
|
-
babel?: BabelPluginOptions;
|
|
54
|
-
/**
|
|
55
|
-
* AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
|
|
56
|
-
*
|
|
57
|
-
* @remarks
|
|
58
|
-
* The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
|
|
59
|
-
*/
|
|
60
|
-
automd?: AutoMDPluginOptions;
|
|
61
|
-
/**
|
|
62
|
-
* Alloy configuration options to use when injecting environment variables into the source code.
|
|
63
|
-
*
|
|
64
|
-
* @remarks
|
|
65
|
-
* This option allows you to customize the Deepkit transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Deepkit settings.
|
|
66
|
-
*/
|
|
67
|
-
deepkit?: DeepkitPluginOptions;
|
|
68
|
-
};
|
|
69
|
-
type EnvPluginUserConfig = BabelPluginUserConfig & DeepkitPluginUserConfig & {
|
|
70
|
-
env: EnvPluginOptions;
|
|
71
|
-
};
|
|
72
|
-
type EnvPluginResolvedConfig = BabelPluginResolvedConfig & DeepkitPluginResolvedConfig & {
|
|
73
|
-
env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
|
|
74
|
-
/**
|
|
75
|
-
* The type definition for the expected env variable parameters
|
|
76
|
-
*
|
|
77
|
-
* @remarks
|
|
78
|
-
* This value is parsed from the {@link EnvPluginOptions.types} option.
|
|
79
|
-
*/
|
|
80
|
-
types: TypeDefinition;
|
|
81
|
-
/**
|
|
82
|
-
* The type definition for the expected env secret parameters
|
|
83
|
-
*
|
|
84
|
-
* @remarks
|
|
85
|
-
* This value is parsed from the {@link EnvPluginOptions.secrets} option.
|
|
86
|
-
*/
|
|
87
|
-
secrets: TypeDefinition;
|
|
88
|
-
/**
|
|
89
|
-
* Should the plugin inject the env variables in the source code with their values?
|
|
90
|
-
*
|
|
91
|
-
* @remarks
|
|
92
|
-
* This value is the result of reflecting the {@link EnvPluginOptions.inject} option.
|
|
93
|
-
*/
|
|
94
|
-
inject: boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Should the plugin validate the loaded environment variables against the provided type definitions?
|
|
97
|
-
*
|
|
98
|
-
* @remarks
|
|
99
|
-
* This value is the result of reflecting the {@link EnvPluginOptions.validate} option.
|
|
100
|
-
*/
|
|
101
|
-
validate: boolean;
|
|
102
|
-
/**
|
|
103
|
-
* The prefix used for environment variables
|
|
104
|
-
*
|
|
105
|
-
* @remarks
|
|
106
|
-
* This value is used to filter environment variables that are loaded from the .env file and the process environment.
|
|
107
|
-
*/
|
|
108
|
-
prefix: string[];
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, DeepkitPluginContext<TResolvedConfig> {
|
|
112
|
-
env: {
|
|
113
|
-
/**
|
|
114
|
-
* The type definitions reflection for the env variables and secrets
|
|
115
|
-
*
|
|
116
|
-
* @remarks
|
|
117
|
-
* These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.
|
|
118
|
-
*/
|
|
119
|
-
types: {
|
|
120
|
-
/**
|
|
121
|
-
* The type definitions for the expected env variables
|
|
122
|
-
*/
|
|
123
|
-
env: Reflection;
|
|
124
|
-
/**
|
|
125
|
-
* The type definitions for the expected env secrets
|
|
126
|
-
*/
|
|
127
|
-
secrets: Reflection;
|
|
128
|
-
};
|
|
129
|
-
/**
|
|
130
|
-
* The current **used** environment variables and secrets reflection
|
|
131
|
-
*
|
|
132
|
-
* @remarks
|
|
133
|
-
* 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.
|
|
134
|
-
*/
|
|
135
|
-
used: {
|
|
136
|
-
/**
|
|
137
|
-
* The current env variables reflection
|
|
138
|
-
*/
|
|
139
|
-
env: Reflection<EnvInterface>;
|
|
140
|
-
/**
|
|
141
|
-
* The current env secrets reflection
|
|
142
|
-
*/
|
|
143
|
-
secrets: Reflection<SecretsInterface>;
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* The parsed .env configuration object
|
|
147
|
-
*
|
|
148
|
-
* @remarks
|
|
149
|
-
* 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}
|
|
150
|
-
*/
|
|
151
|
-
parsed: DotenvParseOutput;
|
|
152
|
-
/**
|
|
153
|
-
* The injected environment variables and secrets reflection
|
|
154
|
-
*
|
|
155
|
-
* @remarks
|
|
156
|
-
* This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.
|
|
157
|
-
*/
|
|
158
|
-
injected: Reflection;
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
//#endregion
|
|
162
|
-
export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType };
|
|
163
|
-
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;;KAyCY,OAAA;AAAA,KAEA,gBAAA,GAAmB,IAAA,CAAK,mBAAA;EAFxB;;;EAMV,KAAA,GAAQ,uBAAA;EANS;AAEnB;;EASE,OAAA,GAAU,uBAAA;EATwB;;;;;;EAiBlC,MAAA;EA8CU;;;;;EAvCV,MAAA;EApBQ;;;;;EA2BR,QAAA;EAQA;;;;;;EAAA,aAAA,GAAgB,QAAA;EAwBN;;;AAGZ;;;EAnBE,KAAA,GAAQ,kBAAA;EAoBR;;;;;;EAZA,MAAA,GAAS,mBAAA;EAaF;;;AAGT;;;EARE,OAAA,GAAU,oBAAA;AAAA;AAAA,KAGA,mBAAA,GAAsB,qBAAA,GAChC,uBAAA;EACE,GAAA,EAAK,gBAAA;AAAA;AAAA,KAGG,uBAAA,GAA0B,yBAAA,GACpC,2BAAA;EACE,GAAA,EAAK,QAAA,CAAS,IAAA,CAAK,mBAAA,wBACjB,QAAA,CAAS,IAAA,CAAK,gBAAA;IAAd;;;;;;IAOE,KAAA,EAAO,cAAA;IARX;;;;;;IAgBI,OAAA,EAAS,cAAA;IART;;;;;;IAgBA,MAAA;IAgBM;;AAId;;;;IAZQ,QAAA;IAgBe;;;;;;IARf,MAAA;EAAA;AAAA;AAAA,UAIS,gBAAA,yBACS,uBAAA,GAA0B,uBAAA,UAGhD,kBAAA,CAAmB,eAAA,GACnB,oBAAA,CAAqB,eAAA;EACvB,GAAA;IADE;;;;;;IAQA,KAAA;MATmB;;;MAajB,GAAA,EAAK,UAAA;MAJP;;;MASE,OAAA,EAAS,UAAA;IAAA;IASX;;;;;;IAAA,IAAA;MAkBA;;;MAdE,GAAA,EAAK,UAAA,CAAW,YAAA;MAsBE;;;MAjBlB,OAAA,EAAS,UAAA,CAAW,gBAAA;IAAA;;;;;;;IAStB,MAAA,EAAQ,iBAAA;;;;;;;IAQR,QAAA,EAAU,UAAA;EAAA;AAAA"}
|
package/dist/types/plugin.mjs
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
//#region src/types/plugin.ts
|
|
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 };
|
|
110
|
-
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Children } from \"@alloy-js/core\";\nimport { Reflection } from \"@powerlines/deepkit/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 {\n DeepkitPluginContext,\n DeepkitPluginOptions,\n DeepkitPluginResolvedConfig,\n DeepkitPluginUserConfig\n} from \"@powerlines/plugin-deepkit/types/plugin\";\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 * Should the plugin validate the loaded environment variables against the provided type definitions?\n *\n * @defaultValue false\n */\n validate?: boolean;\n\n /**\n * The default configuration to use when loading environment variables.\n *\n * @remarks\n * This configuration is used as the base configuration when loading environment variables, and will be overridden by any values found in the `.env` file or the process environment.\n */\n defaultConfig?: Children;\n\n /**\n * Babel configuration options to use when injecting environment variables into the source code.\n *\n * @remarks\n * This option allows you to customize the Babel transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Babel settings.\n */\n babel?: BabelPluginOptions;\n\n /**\n * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.\n *\n * @remarks\n * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.\n */\n automd?: AutoMDPluginOptions;\n\n /**\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 Deepkit transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Deepkit settings.\n */\n deepkit?: DeepkitPluginOptions;\n};\n\nexport type EnvPluginUserConfig = BabelPluginUserConfig &\n DeepkitPluginUserConfig & {\n env: EnvPluginOptions;\n };\n\nexport type EnvPluginResolvedConfig = BabelPluginResolvedConfig &\n DeepkitPluginResolvedConfig & {\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: boolean;\n\n /**\n * Should the plugin validate the loaded environment variables against the provided type definitions?\n *\n * @remarks\n * This value is the result of reflecting the {@link EnvPluginOptions.validate} option.\n */\n validate: boolean;\n\n /**\n * The prefix used for environment variables\n *\n * @remarks\n * This value is used to filter environment variables that are loaded from the .env file and the process environment.\n */\n prefix: string[];\n };\n };\n\nexport interface EnvPluginContext<\n TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig\n>\n extends\n BabelPluginContext<TResolvedConfig>,\n DeepkitPluginContext<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;CAAI;CAAM;CAAQ;CAAG;;;;;;;AAEtC,MAAM,aAAS;CAAA;CAAY;CAAW;CAAW;CAAU;AAE3D,MAAM,sBAAmB;OAAQ;CAAS;CAAK;CAAa;CAAO;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;AAInE,MAAC,6BAAkC;OAAO;OAAmB;CAAA;OAAA;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAE7D,MAAC,sBAA0B;OAAQ;CAAkB;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
|