@powerlines/plugin-env 0.13.53 → 0.13.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel/index.cjs +1 -1
- package/dist/babel/index.d.cts +17 -31
- package/dist/babel/index.d.mts +17 -0
- package/dist/babel/index.mjs +1 -0
- package/dist/babel/plugin.cjs +1 -19
- package/dist/babel/plugin.d.cts +17 -34
- package/dist/babel/plugin.d.mts +17 -0
- package/dist/babel/plugin.mjs +1 -0
- package/dist/babel-CE47sTzg.mjs +1 -0
- package/dist/chunk-CbqXBSoN.mjs +1 -0
- package/dist/chunk-DT2f8AgL.cjs +1 -0
- package/dist/components/docs.cjs +1 -0
- package/dist/components/docs.d.cts +2 -0
- package/dist/components/docs.d.mts +2 -0
- package/dist/components/docs.mjs +1 -0
- package/dist/components/env.cjs +1 -40
- package/dist/components/env.d.cts +4 -105
- package/dist/components/env.d.mts +4 -0
- package/dist/components/env.mjs +1 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.cts +6 -8
- package/dist/components/index.d.mts +6 -0
- package/dist/components/index.mjs +1 -0
- package/dist/components-LyHNrcZE.mjs +1 -0
- package/dist/config-D2esSp2r.d.mts +1681 -0
- package/dist/config-D2esSp2r.d.mts.map +1 -0
- package/dist/config-Dli3ofDp.d.cts +1680 -0
- package/dist/config-Dli3ofDp.d.cts.map +1 -0
- package/dist/create-reflection-resource-CQHJrkQi.cjs +1 -0
- package/dist/create-reflection-resource-D7go0-VG.d.mts +16 -0
- package/dist/create-reflection-resource-D7go0-VG.d.mts.map +1 -0
- package/dist/create-reflection-resource-DOZmUtSi.d.cts +16 -0
- package/dist/create-reflection-resource-DOZmUtSi.d.cts.map +1 -0
- package/dist/create-reflection-resource-UtOwX4Ml.mjs +2 -0
- package/dist/create-reflection-resource-UtOwX4Ml.mjs.map +1 -0
- package/dist/docs-BDiEhcDa.mjs +2 -0
- package/dist/docs-BDiEhcDa.mjs.map +1 -0
- package/dist/docs-Bhi9smBO.cjs +1 -0
- package/dist/docs-BoZkRBO4.d.cts +10 -0
- package/dist/docs-BoZkRBO4.d.cts.map +1 -0
- package/dist/docs-BwK6pC_c.d.mts +10 -0
- package/dist/docs-BwK6pC_c.d.mts.map +1 -0
- package/dist/env-0C9Vc_CF.cjs +34 -0
- package/dist/env-BQWQzimx.d.cts +113 -0
- package/dist/env-BQWQzimx.d.cts.map +1 -0
- package/dist/env-D4MK9BWK.mjs +32 -0
- package/dist/env-D4MK9BWK.mjs.map +1 -0
- package/dist/env-DMqCnKB2.d.mts +113 -0
- package/dist/env-DMqCnKB2.d.mts.map +1 -0
- package/dist/helpers/create-reflection-resource.cjs +1 -0
- package/dist/helpers/create-reflection-resource.d.cts +6 -0
- package/dist/helpers/create-reflection-resource.d.mts +6 -0
- package/dist/helpers/create-reflection-resource.mjs +1 -0
- package/dist/helpers/index.cjs +1 -1
- package/dist/helpers/index.d.cts +12 -35
- package/dist/helpers/index.d.mts +12 -0
- package/dist/helpers/index.mjs +1 -0
- package/dist/helpers/load.cjs +1 -7
- package/dist/helpers/load.d.cts +6 -60
- package/dist/helpers/load.d.mts +6 -0
- package/dist/helpers/load.mjs +1 -0
- package/dist/helpers/persistence.cjs +1 -7
- package/dist/helpers/persistence.d.cts +6 -108
- package/dist/helpers/persistence.d.mts +6 -0
- package/dist/helpers/persistence.mjs +1 -0
- package/dist/helpers/reflect.cjs +1 -7
- package/dist/helpers/reflect.d.cts +6 -72
- package/dist/helpers/reflect.d.mts +6 -0
- package/dist/helpers/reflect.mjs +1 -0
- package/dist/helpers/source-file-env.cjs +1 -7
- package/dist/helpers/source-file-env.d.cts +2 -7
- package/dist/helpers/source-file-env.d.mts +2 -0
- package/dist/helpers/source-file-env.mjs +1 -0
- package/dist/helpers/template-helpers.cjs +1 -7
- package/dist/helpers/template-helpers.d.cts +6 -41
- package/dist/helpers/template-helpers.d.mts +6 -0
- package/dist/helpers/template-helpers.mjs +1 -0
- package/dist/helpers-DfMThUgD.mjs +1 -0
- package/dist/helpers-YGhXHw5G.cjs +0 -0
- package/dist/index-B3G-X5Fc.d.mts +42 -0
- package/dist/index-B3G-X5Fc.d.mts.map +1 -0
- package/dist/index-BRBK9zG-.d.cts +1 -0
- package/dist/index-Bt4QNofW.d.mts +1 -0
- package/dist/index-CRo77wc3.d.mts +1 -0
- package/dist/index-CspKFJM1.d.cts +1 -0
- package/dist/index-Dpmi5zcN.d.cts +1 -0
- package/dist/index-E1euY2F8.d.cts +42 -0
- package/dist/index-E1euY2F8.d.cts.map +1 -0
- package/dist/index-Wc1llEvP.d.mts +1 -0
- package/dist/index.cjs +5 -10
- package/dist/index.d.cts +17 -71
- package/dist/index.d.mts +17 -0
- package/dist/index.mjs +18 -0
- package/dist/index.mjs.map +1 -0
- package/dist/load-BZTlThWg.mjs +2 -0
- package/dist/load-BZTlThWg.mjs.map +1 -0
- package/dist/load-CWOZ3u-s.d.cts +36 -0
- package/dist/load-CWOZ3u-s.d.cts.map +1 -0
- package/dist/load-Dzf30s_a.d.mts +39 -0
- package/dist/load-Dzf30s_a.d.mts.map +1 -0
- package/dist/load-nUlit5lR.cjs +1 -0
- package/dist/{helpers/persistence.d.ts → persistence-BSorOnu8.d.cts} +15 -38
- package/dist/persistence-BSorOnu8.d.cts.map +1 -0
- package/dist/persistence-Br-YMVb1.mjs +15 -0
- package/dist/persistence-Br-YMVb1.mjs.map +1 -0
- package/dist/persistence-KaP3-ka1.cjs +14 -0
- package/dist/persistence-sVp1g7Mp.d.mts +85 -0
- package/dist/persistence-sVp1g7Mp.d.mts.map +1 -0
- package/dist/plugin-CRYQ682C.cjs +0 -0
- package/dist/plugin-Cl-yPswT.d.cts +1716 -0
- package/dist/plugin-Cl-yPswT.d.cts.map +1 -0
- package/dist/plugin-Cx61c9gw.mjs +6 -0
- package/dist/plugin-Cx61c9gw.mjs.map +1 -0
- package/dist/plugin-DrnPbdzR.mjs +1 -0
- package/dist/plugin-VRahDLZZ.d.mts +1716 -0
- package/dist/plugin-VRahDLZZ.d.mts.map +1 -0
- package/dist/plugin-v-FJGggy.cjs +5 -0
- package/dist/reflect-C1joiXZ1.d.mts +47 -0
- package/dist/reflect-C1joiXZ1.d.mts.map +1 -0
- package/dist/reflect-CFNlkro0.d.cts +47 -0
- package/dist/reflect-CFNlkro0.d.cts.map +1 -0
- package/dist/runtime-BaZivi6m.cjs +0 -0
- package/dist/runtime-CIWxfv47.d.cts +795 -0
- package/dist/runtime-CIWxfv47.d.cts.map +1 -0
- package/dist/runtime-ChZa5p23.d.mts +795 -0
- package/dist/runtime-ChZa5p23.d.mts.map +1 -0
- package/dist/runtime-DqCYc37d.mjs +1 -0
- package/dist/source-file-CLCTB4C7.cjs +1 -0
- package/dist/source-file-CjFSCK1w.mjs +2 -0
- package/dist/source-file-CjFSCK1w.mjs.map +1 -0
- package/dist/source-file-env-BDFTs5WJ.mjs +2 -0
- package/dist/source-file-env-BDFTs5WJ.mjs.map +1 -0
- package/dist/source-file-env-C6uYyxww.cjs +1 -0
- package/dist/{helpers/source-file-env.d.ts → source-file-env-DonDJDV1.d.cts} +5 -3
- package/dist/source-file-env-DonDJDV1.d.cts.map +1 -0
- package/dist/source-file-env-DzpWKluw.d.mts +9 -0
- package/dist/source-file-env-DzpWKluw.d.mts.map +1 -0
- package/dist/template-helpers-BDDg5jaw.d.cts +16 -0
- package/dist/template-helpers-BDDg5jaw.d.cts.map +1 -0
- package/dist/template-helpers-BSbamu0U.cjs +1 -0
- package/dist/template-helpers-CLrM_TtO.mjs +2 -0
- package/dist/template-helpers-CLrM_TtO.mjs.map +1 -0
- package/dist/template-helpers-DmfAtQIT.d.mts +16 -0
- package/dist/template-helpers-DmfAtQIT.d.mts.map +1 -0
- package/dist/type-CnPIyotQ.d.mts +4 -0
- package/dist/type-CnPIyotQ.d.mts.map +1 -0
- package/dist/type-D6dRgWJT.d.cts +4 -0
- package/dist/type-D6dRgWJT.d.cts.map +1 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +6 -30
- package/dist/types/index.d.mts +6 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +1 -1
- package/dist/types/plugin.d.cts +5 -1733
- package/dist/types/plugin.d.mts +5 -0
- package/dist/types/plugin.mjs +1 -0
- package/dist/types/runtime.cjs +1 -1
- package/dist/types/runtime.d.cts +3 -25
- package/dist/types/runtime.d.mts +3 -0
- package/dist/types/runtime.mjs +1 -0
- package/dist/types-BCto_Rzj.mjs +1 -0
- package/dist/types-DS7T32tb.cjs +0 -0
- package/dist/utilities-4S--uN0L.mjs +2 -0
- package/dist/utilities-4S--uN0L.mjs.map +1 -0
- package/dist/utilities-CxyT2chk.cjs +1 -0
- package/package.json +66 -55
- package/dist/babel/index.d.ts +0 -31
- package/dist/babel/index.js +0 -1
- package/dist/babel/plugin.d.ts +0 -34
- package/dist/babel/plugin.js +0 -19
- package/dist/chunk-FBBMZ4NC.cjs +0 -7
- package/dist/chunk-UCUR73HG.js +0 -7
- package/dist/components/env.d.ts +0 -105
- package/dist/components/env.js +0 -40
- package/dist/components/index.d.ts +0 -8
- package/dist/components/index.js +0 -1
- package/dist/fs-ECFlqnPg.d.cts +0 -378
- package/dist/fs-ECFlqnPg.d.ts +0 -378
- package/dist/helpers/index.d.ts +0 -35
- package/dist/helpers/index.js +0 -1
- package/dist/helpers/load.d.ts +0 -60
- package/dist/helpers/load.js +0 -7
- package/dist/helpers/persistence.js +0 -7
- package/dist/helpers/reflect.d.ts +0 -72
- package/dist/helpers/reflect.js +0 -7
- package/dist/helpers/source-file-env.js +0 -7
- package/dist/helpers/template-helpers.d.ts +0 -41
- package/dist/helpers/template-helpers.js +0 -7
- package/dist/index.d.ts +0 -71
- package/dist/index.js +0 -22
- package/dist/runtime-B75FziIk.d.ts +0 -2011
- package/dist/runtime-DqYFxAEo.d.cts +0 -2011
- package/dist/types/index.d.ts +0 -30
- package/dist/types/index.js +0 -1
- package/dist/types/plugin.d.ts +0 -1733
- package/dist/types/runtime.d.ts +0 -25
- /package/dist/{types/plugin.js → babel-Bmzkjy1p.cjs} +0 -0
- /package/dist/{types/runtime.js → components-BWruXLSx.cjs} +0 -0
package/dist/index.d.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { P as PluginContext, b as Plugin } from './runtime-B75FziIk.js';
|
|
2
|
-
export { E as EnvInterface, S as SecretsInterface, _ as __ΩEnvInterface, c as __ΩSecretsInterface } from './runtime-B75FziIk.js';
|
|
3
|
-
import { Children } from '@alloy-js/core/jsx-runtime';
|
|
4
|
-
import { PrintTreeOptions } from '@alloy-js/core';
|
|
5
|
-
import { EnvPluginContext, EnvPluginResolvedConfig } from './types/plugin.js';
|
|
6
|
-
export { EnvPluginOptions, EnvPluginUserConfig, EnvType, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType } from './types/plugin.js';
|
|
7
|
-
export { envBabelPlugin } from './babel/plugin.js';
|
|
8
|
-
export { EnvBuiltin, EnvBuiltinProps, EnvTypeDefinition, __ΩEnvBuiltinProps } from './components/env.js';
|
|
9
|
-
export { loadEnv, loadEnvFromContext } from './helpers/load.js';
|
|
10
|
-
export { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection } from './helpers/persistence.js';
|
|
11
|
-
export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from './helpers/reflect.js';
|
|
12
|
-
export { formatEnvField, removeEnvPrefix } from './helpers/source-file-env.js';
|
|
13
|
-
export { createTemplateReflection } from './helpers/template-helpers.js';
|
|
14
|
-
import '@stryke/env/get-env-paths';
|
|
15
|
-
import '@stryke/http/fetch';
|
|
16
|
-
import '@stryke/types/base';
|
|
17
|
-
import '@stryke/types/package-json';
|
|
18
|
-
import 'jiti';
|
|
19
|
-
import 'magic-string';
|
|
20
|
-
import 'oxc-parser';
|
|
21
|
-
import 'semver';
|
|
22
|
-
import 'ts-morph';
|
|
23
|
-
import 'undici';
|
|
24
|
-
import 'unplugin';
|
|
25
|
-
import '@babel/core';
|
|
26
|
-
import '@storm-software/build-tools/types';
|
|
27
|
-
import '@storm-software/config-tools/types';
|
|
28
|
-
import '@storm-software/config/types';
|
|
29
|
-
import '@stryke/types/configuration';
|
|
30
|
-
import '@stryke/types/file';
|
|
31
|
-
import 'vite';
|
|
32
|
-
import '@babel/helper-plugin-utils';
|
|
33
|
-
import './fs-ECFlqnPg.js';
|
|
34
|
-
import '@stryke/fs/resolve';
|
|
35
|
-
import '@stryke/types/array';
|
|
36
|
-
import '@stryke/types/tsconfig';
|
|
37
|
-
import 'typescript';
|
|
38
|
-
import '@deepkit/type';
|
|
39
|
-
import '@stryke/capnp';
|
|
40
|
-
import '@stryke/env/types';
|
|
41
|
-
import '@alloy-js/typescript';
|
|
42
|
-
|
|
43
|
-
type PluginPluginAlloyOptions = Partial<PrintTreeOptions> & {
|
|
44
|
-
/**
|
|
45
|
-
* If true, the Alloy framework is used to generate JSON output files.
|
|
46
|
-
*
|
|
47
|
-
* @defaultValue false
|
|
48
|
-
*/
|
|
49
|
-
generatesJson?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* If true, the Alloy framework is used to generate Markdown output files.
|
|
52
|
-
*
|
|
53
|
-
* @defaultValue false
|
|
54
|
-
*/
|
|
55
|
-
generatesMarkdown?: boolean;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
interface AlloyPluginOptions {
|
|
59
|
-
alloy?: PluginPluginAlloyOptions;
|
|
60
|
-
}
|
|
61
|
-
type AlloyPluginBuilderResult<TContext extends PluginContext = PluginContext> = Plugin<TContext> & {
|
|
62
|
-
render: (this: TContext) => Children;
|
|
63
|
-
};
|
|
64
|
-
type AlloyPluginBuilder<TContext extends PluginContext = PluginContext, TOptions = any> = <T extends TContext>(options: TOptions) => AlloyPluginBuilderResult<T>;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* A Powerlines plugin to inject environment variables into the source code.
|
|
68
|
-
*/
|
|
69
|
-
declare const plugin: <T extends EnvPluginContext<EnvPluginResolvedConfig>>(options: Parameters<AlloyPluginBuilder<EnvPluginContext<EnvPluginResolvedConfig>>>[0] & AlloyPluginOptions) => Plugin<T>;
|
|
70
|
-
|
|
71
|
-
export { EnvPluginContext, EnvPluginResolvedConfig, plugin as default, plugin };
|
package/dist/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import'./chunk-UCUR73HG.js';import {createComponent}from'@alloy-js/core/jsx-runtime';import {createAlloyPlugin}from'@powerlines/alloy/create-plugin';import {stringifyType,ReflectionClass,ReflectionKind}from'@powerlines/deepkit/vendor/type';import A from'@powerlines/plugin-babel';import {LogLevelLabel}from'@storm-software/config-tools/types';import {parseTypeDefinition}from'@stryke/convert/parse-type-definition';import {toArray}from'@stryke/convert/to-array';import {ENV_PREFIXES}from'@stryke/env/types';import {existsSync}from'@stryke/fs/exists';import {createDirectory}from'@stryke/fs/helpers';import {isParentPath}from'@stryke/path/is-parent-path';import {joinPaths}from'@stryke/path/join';import {constantCase}from'@stryke/string-format/constant-case';import w from'defu';import {envBabelPlugin}from'./babel/plugin';import {EnvBuiltin}from'./components/env';import {loadEnv}from'./helpers/load';import {getEnvReflectionsPath,writeEnvReflection,readEnvTypeReflection,getEnvTypeReflectionsPath,readEnvReflection,readSecretsReflection,writeEnvTypeReflection,getEnvDefaultTypeDefinition,getSecretsDefaultTypeDefinition}from'./helpers/persistence';import {reflectEnv,reflectSecrets}from'./helpers/reflect';export*from'./babel';export*from'./components';export*from'./helpers';export*from'./types';/*****************************************
|
|
2
|
-
*
|
|
3
|
-
* ⚡ Built by Storm Software
|
|
4
|
-
*
|
|
5
|
-
*****************************************/
|
|
6
|
-
|
|
7
|
-
const F=createAlloyPlugin((g={})=>({name:"env",dependsOn:[A(g.babel)],async config(){this.log(LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");const e={env:w(g,{types:{},prefix:[]}),transform:{babel:{plugins:[envBabelPlugin]}}};if(e.env.types)e.env.types=parseTypeDefinition(e.env.types);else {this.log(LogLevelLabel.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");const t=await getEnvDefaultTypeDefinition(this);e.env.types=parseTypeDefinition(`${t.file}#${t.name}`);}if(e.env.secrets)e.env.secrets=parseTypeDefinition(e.env.secrets);else {const t=await getSecretsDefaultTypeDefinition(this);e.env.secrets=parseTypeDefinition(`${t.file}#${t.name}`);}return e.env.prefix=toArray(e.env.prefix??[]).reduce((t,n)=>{const i=constantCase(n);return t.includes(i)||t.push(i),t},[...ENV_PREFIXES,"POWERLINES_"]),e.env.prefix=e.env.prefix.reduce((t,n)=>(t.includes(n.replace(/_$/g,""))||t.push(n.replace(/_$/g,"")),t),[]),e},async configResolved(){if(this.log(LogLevelLabel.TRACE,"Environment plugin configuration has been resolved for the Powerlines project."),this.config.env.inject??=this.config.projectType==="application",this.env=w({parsed:await loadEnv(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!=="prepare"&&this.persistedMeta?.checksum===this.meta.checksum&&existsSync(getEnvTypeReflectionsPath(this,"env")))this.log(LogLevelLabel.TRACE,"Skipping reflection initialization as the meta checksum has not changed."),this.env.types.env=await readEnvTypeReflection(this,"env"),existsSync(getEnvReflectionsPath(this,"env"))&&(this.env.used.env=await readEnvReflection(this)),existsSync(getEnvTypeReflectionsPath(this,"secrets"))&&(this.env.types.secrets=await readEnvTypeReflection(this,"secrets")),existsSync(getEnvReflectionsPath(this,"secrets"))&&(this.env.used.secrets=await readSecretsReflection(this));else {if(this.env.types.env=await reflectEnv(this,this.config.env.types?.file?isParentPath(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:joinPaths(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw new Error("Failed to find the environment configuration type reflection in the context.");if(await writeEnvTypeReflection(this,this.env.types.env,"env"),this.env.types.secrets=await reflectSecrets(this,this.config.env.secrets?.file?isParentPath(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:joinPaths(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw new Error("Failed to find the secrets configuration type reflection in the context.");await writeEnvTypeReflection(this,this.env.types.secrets,"secrets"),this.log(LogLevelLabel.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);const e=this.env.types.env.getProperties().filter(t=>t.getAlias().length>0);Object.entries(await loadEnv(this,this.config.env)).forEach(([t,n])=>{const i=this.config.env.prefix.reduce((f,m)=>t.replace(/_$/g,"").startsWith(m)?t.replace(/_$/g,"").slice(m.length):f,t),c=e.find(f=>f?.getAlias().reverse().includes(i));(this.env.types.env?.hasProperty(i)||c)&&this.env.types.env.getProperty(i).setDefaultValue(n);}),this.env.used.env=new ReflectionClass({kind:ReflectionKind.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 writeEnvReflection(this,this.env.used.env,"env"),this.env.types.secrets&&(await writeEnvTypeReflection(this,this.env.types.secrets,"secrets"),this.env.used.secrets=new ReflectionClass({kind:ReflectionKind.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 writeEnvReflection(this,this.env.used.secrets,"secrets"));}},render(){const e=this;return this.log(LogLevelLabel.TRACE,"Preparing the Environment runtime artifacts for the Powerlines project."),createComponent(EnvBuiltin,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(LogLevelLabel.TRACE,"Writing Environment documentation for the Powerlines project artifacts.");const e=joinPaths(this.config.projectRoot,"docs","generated");existsSync(e)||await createDirectory(e);const t=await readEnvTypeReflection(this,"env"),n=joinPaths(e,"env.md");this.log(LogLevelLabel.TRACE,`Documenting environment variables configuration in "${n}"`),await this.fs.write(n,`<!-- Generated by Powerlines -->
|
|
8
|
-
|
|
9
|
-
# Environment variables configuration
|
|
10
|
-
|
|
11
|
-
Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project.
|
|
12
|
-
|
|
13
|
-
## Environment Configuration
|
|
14
|
-
|
|
15
|
-
The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
|
|
16
|
-
|
|
17
|
-
| Name | Description | Type | Default Value | Required |
|
|
18
|
-
| ---- | ----------- | ---- | ------------- | :------: |
|
|
19
|
-
${t.getProperties().filter(i=>i.getNameAsString()!=="__STORM_INJECTED__").sort((i,c)=>i.getNameAsString().localeCompare(c.getNameAsString())).map(i=>`| ${i.getNameAsString().trim()} | ${(i.getDescription()?.replaceAll("\r","")?.replaceAll(`
|
|
20
|
-
`,"")??"").trim()} | ${stringifyType(i.getType()).trim().replaceAll(" | ",", or ")} | ${i.hasDefault()?String(i.getDefaultValue())?.includes('"')?i.getDefaultValue():`\`${i.getDefaultValue()}\``:""} | ${i.isValueRequired()?"":"\u2714"} |`).join(`
|
|
21
|
-
`)}
|
|
22
|
-
`);},async buildEnd(){const e=getEnvReflectionsPath(this,"env");this.log(LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await writeEnvReflection(this,this.env.used.env,"env");}}));var re=F;export{re as default,F as plugin};
|