@powerlines/plugin-env 0.13.4 → 0.13.6

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.
Files changed (63) hide show
  1. package/dist/babel/index.cjs +1 -0
  2. package/dist/babel/index.d.cts +30 -0
  3. package/dist/babel/index.d.ts +30 -0
  4. package/dist/babel/index.js +1 -0
  5. package/dist/babel/plugin.cjs +19 -0
  6. package/dist/babel/plugin.d.cts +33 -0
  7. package/dist/babel/plugin.d.ts +33 -0
  8. package/dist/babel/plugin.js +19 -0
  9. package/dist/chunk-FBBMZ4NC.cjs +7 -0
  10. package/dist/chunk-UCUR73HG.js +7 -0
  11. package/dist/components/env.cjs +40 -0
  12. package/dist/components/env.d.cts +106 -0
  13. package/dist/components/env.d.ts +106 -0
  14. package/dist/components/env.js +40 -0
  15. package/dist/components/index.cjs +1 -0
  16. package/dist/components/index.d.cts +10 -0
  17. package/dist/components/index.d.ts +10 -0
  18. package/dist/components/index.js +1 -0
  19. package/dist/helpers/index.cjs +1 -0
  20. package/dist/helpers/index.d.cts +34 -0
  21. package/dist/helpers/index.d.ts +34 -0
  22. package/dist/helpers/index.js +1 -0
  23. package/dist/helpers/load.cjs +7 -0
  24. package/dist/helpers/load.d.cts +59 -0
  25. package/dist/helpers/load.d.ts +59 -0
  26. package/dist/helpers/load.js +7 -0
  27. package/dist/helpers/persistence.cjs +7 -0
  28. package/dist/helpers/persistence.d.cts +107 -0
  29. package/dist/helpers/persistence.d.ts +107 -0
  30. package/dist/helpers/persistence.js +7 -0
  31. package/dist/helpers/reflect.cjs +7 -0
  32. package/dist/helpers/reflect.d.cts +71 -0
  33. package/dist/helpers/reflect.d.ts +71 -0
  34. package/dist/helpers/reflect.js +7 -0
  35. package/dist/helpers/source-file-env.cjs +7 -0
  36. package/dist/helpers/source-file-env.d.cts +7 -0
  37. package/dist/helpers/source-file-env.d.ts +7 -0
  38. package/dist/helpers/source-file-env.js +7 -0
  39. package/dist/helpers/template-helpers.cjs +7 -0
  40. package/dist/helpers/template-helpers.d.cts +40 -0
  41. package/dist/helpers/template-helpers.d.ts +40 -0
  42. package/dist/helpers/template-helpers.js +7 -0
  43. package/dist/index.cjs +22 -0
  44. package/dist/index.d.cts +70 -0
  45. package/dist/index.d.ts +70 -0
  46. package/dist/index.js +22 -0
  47. package/dist/runtime-CUeIsMV9.d.ts +1753 -0
  48. package/dist/runtime-DEhb6gxi.d.cts +1753 -0
  49. package/dist/types/index.cjs +1 -0
  50. package/dist/types/index.d.cts +29 -0
  51. package/dist/types/index.d.ts +29 -0
  52. package/dist/types/index.js +1 -0
  53. package/dist/types/plugin.cjs +1 -0
  54. package/dist/types/plugin.d.cts +1727 -0
  55. package/dist/types/plugin.d.ts +1727 -0
  56. package/dist/types/plugin.js +0 -0
  57. package/dist/types/runtime.cjs +1 -0
  58. package/dist/types/runtime.d.cts +24 -0
  59. package/dist/types/runtime.d.ts +24 -0
  60. package/dist/types/runtime.js +0 -0
  61. package/dist/vfs-Bl84Hw2V.d.cts +393 -0
  62. package/dist/vfs-Bl84Hw2V.d.ts +393 -0
  63. package/package.json +75 -81
@@ -0,0 +1,34 @@
1
+ export { loadEnv, loadEnvFromContext } from './load.js';
2
+ export { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection } from './persistence.js';
3
+ export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from './reflect.js';
4
+ export { formatEnvField, removeEnvPrefix } from './source-file-env.js';
5
+ export { createTemplateReflection } from './template-helpers.js';
6
+ import '../runtime-CUeIsMV9.js';
7
+ import '@stryke/env/get-env-paths';
8
+ import '@stryke/types/package-json';
9
+ import 'jiti';
10
+ import 'oxc-parser';
11
+ import 'semver';
12
+ import 'unplugin';
13
+ import '@babel/core';
14
+ import '@storm-software/build-tools/types';
15
+ import '@storm-software/config-tools/types';
16
+ import '@storm-software/config/types';
17
+ import '@stryke/types/base';
18
+ import '@stryke/types/configuration';
19
+ import '@stryke/types/file';
20
+ import 'vite';
21
+ import '@babel/helper-plugin-utils';
22
+ import '@stryke/types/array';
23
+ import '@stryke/types/tsconfig';
24
+ import 'typescript';
25
+ import '../vfs-Bl84Hw2V.js';
26
+ import '@stryke/json/types';
27
+ import 'memfs';
28
+ import 'node:fs';
29
+ import 'unionfs';
30
+ import '@stryke/env/types';
31
+ import '../types/plugin.js';
32
+ import '@alloy-js/core/jsx-runtime';
33
+ import '@deepkit/type';
34
+ import '@stryke/capnp';
@@ -0,0 +1 @@
1
+ export*from'./load';export*from'./persistence';export*from'./reflect';export*from'./source-file-env';export*from'./template-helpers';
@@ -0,0 +1,7 @@
1
+ 'use strict';var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),loadEnv=require('@stryke/env/load-env'),joinPaths=require('@stryke/path/join-paths'),kebabCase=require('@stryke/string-format/kebab-case'),isSetObject=require('@stryke/type-checks/is-set-object'),isSetString=require('@stryke/type-checks/is-set-string'),c12=require('c12'),m=require('defu'),sourceFileEnv=require('./source-file-env');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var m__default=/*#__PURE__*/_interopDefault(m);/*****************************************
2
+ *
3
+ * ⚡ Built by Storm Software
4
+ *
5
+ *****************************************/
6
+
7
+ async function k(e,o,a){let n=await loadEnv.loadEnv(a,o);if(e.additionalFiles&&e.additionalFiles?.length>0){const r=await Promise.all(e.additionalFiles.map(async i=>loadEnv.loadEnvFile(i,a)));for(const i of r)n=m__default.default(i,n);}return sourceFileEnv.removeEnvPrefix(n)}chunkFBBMZ4NC_cjs.a(k,"loadEnvFiles");async function p(e,o,a,n,r,i){const[l,t]=await Promise.all([k(e,a,o),c12.loadConfig({cwd:o,name:"storm",envName:a,defaults:{NAME:r.name?.replace(`@${i.namespace}/`,""),MODE:a,ORG:i.organization},globalRc:true,packageJson:true,dotenv:true,jitiOptions:{fsCache:joinPaths.joinPaths(n,"jiti"),moduleCache:true}})]);return m__default.default(l,t.config,i)}chunkFBBMZ4NC_cjs.a(p,"loadEnvDirectory");function C(e,o){return m__default.default({APP_NAME:kebabCase.kebabCase(e.config.name||e.packageJson.name?.replace(`/${e.workspaceConfig.namespace}`,"")),APP_VERSION:e.packageJson.version,BUILD_ID:e.meta.buildId,BUILD_TIMESTAMP:new Date(e.meta.timestamp).toISOString(),BUILD_CHECKSUM:e.meta.checksum,RELEASE_ID:e.meta.releaseId,RELEASE_TAG:`${kebabCase.kebabCase(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:e.workspaceConfig.locale,DEFAULT_TIMEZONE:e.workspaceConfig.timezone,LOG_LEVEL:e.config.logLevel,ERROR_URL:e.workspaceConfig.error?.url,ORGANIZATION:isSetString.isSetString(e.workspaceConfig.organization)?e.workspaceConfig.organization:e.workspaceConfig.organization?.name,PLATFORM:e.config.build.platform,MODE:e.workspaceConfig.mode,DEBUG:e.workspaceConfig.mode==="development",STACKTRACE:e.workspaceConfig.mode==="development",ENVIRONMENT:e.environment},isSetObject.isSetObject(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce((a,n)=>(a[n.name]=o[n.name]??n.getDefaultValue(),a),{}):{})}chunkFBBMZ4NC_cjs.a(C,"loadEnvFromContext");async function N(e,o){const[a,n,r]=await Promise.all([p(o,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),p(o,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),p(o,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return m__default.default(C(e,process.env),a,n,r)}chunkFBBMZ4NC_cjs.a(N,"loadEnv");exports.loadEnv=N;exports.loadEnvFromContext=C;
@@ -0,0 +1,59 @@
1
+ import { a as EnvironmentResolvedConfig } from '../runtime-DEhb6gxi.cjs';
2
+ import { DotenvParseOutput } from '@stryke/env/types';
3
+ import { EnvPluginContext, EnvPluginOptions } from '../types/plugin.cjs';
4
+ import '@stryke/env/get-env-paths';
5
+ import '@stryke/types/package-json';
6
+ import 'jiti';
7
+ import 'oxc-parser';
8
+ import 'semver';
9
+ import 'unplugin';
10
+ import '@babel/core';
11
+ import '@storm-software/build-tools/types';
12
+ import '@storm-software/config-tools/types';
13
+ import '@storm-software/config/types';
14
+ import '@stryke/types/base';
15
+ import '@stryke/types/configuration';
16
+ import '@stryke/types/file';
17
+ import 'vite';
18
+ import '@babel/helper-plugin-utils';
19
+ import '@stryke/types/array';
20
+ import '@stryke/types/tsconfig';
21
+ import 'typescript';
22
+ import '../vfs-Bl84Hw2V.cjs';
23
+ import '@stryke/json/types';
24
+ import 'memfs';
25
+ import 'node:fs';
26
+ import 'unionfs';
27
+ import '@alloy-js/core/jsx-runtime';
28
+ import '@deepkit/type';
29
+ import '@stryke/capnp';
30
+
31
+ /**
32
+ * Retrieves various dotenv configuration parameters from the context.
33
+ *
34
+ * @param context - The context to retrieve the dotenv configuration from.
35
+ * @param parsed - The parsed dotenv configuration.
36
+ * @returns An object containing the dotenv configuration.
37
+ */
38
+ declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvParseOutput): {
39
+ APP_NAME: string | undefined;
40
+ APP_VERSION: string | undefined;
41
+ BUILD_ID: string;
42
+ BUILD_TIMESTAMP: string;
43
+ BUILD_CHECKSUM: string;
44
+ RELEASE_ID: string;
45
+ RELEASE_TAG: string;
46
+ DEFAULT_LOCALE: string | undefined;
47
+ DEFAULT_TIMEZONE: string | undefined;
48
+ LOG_LEVEL: "debug" | "error" | "warn" | "info" | "trace" | null;
49
+ ERROR_URL: string | undefined;
50
+ ORGANIZATION: string | undefined;
51
+ PLATFORM: "node" | "browser" | "neutral" | undefined;
52
+ MODE: "test" | "development" | "production" | undefined;
53
+ DEBUG: boolean;
54
+ STACKTRACE: boolean;
55
+ ENVIRONMENT: EnvironmentResolvedConfig;
56
+ };
57
+ declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
58
+
59
+ export { loadEnv, loadEnvFromContext };
@@ -0,0 +1,59 @@
1
+ import { a as EnvironmentResolvedConfig } from '../runtime-CUeIsMV9.js';
2
+ import { DotenvParseOutput } from '@stryke/env/types';
3
+ import { EnvPluginContext, EnvPluginOptions } from '../types/plugin.js';
4
+ import '@stryke/env/get-env-paths';
5
+ import '@stryke/types/package-json';
6
+ import 'jiti';
7
+ import 'oxc-parser';
8
+ import 'semver';
9
+ import 'unplugin';
10
+ import '@babel/core';
11
+ import '@storm-software/build-tools/types';
12
+ import '@storm-software/config-tools/types';
13
+ import '@storm-software/config/types';
14
+ import '@stryke/types/base';
15
+ import '@stryke/types/configuration';
16
+ import '@stryke/types/file';
17
+ import 'vite';
18
+ import '@babel/helper-plugin-utils';
19
+ import '@stryke/types/array';
20
+ import '@stryke/types/tsconfig';
21
+ import 'typescript';
22
+ import '../vfs-Bl84Hw2V.js';
23
+ import '@stryke/json/types';
24
+ import 'memfs';
25
+ import 'node:fs';
26
+ import 'unionfs';
27
+ import '@alloy-js/core/jsx-runtime';
28
+ import '@deepkit/type';
29
+ import '@stryke/capnp';
30
+
31
+ /**
32
+ * Retrieves various dotenv configuration parameters from the context.
33
+ *
34
+ * @param context - The context to retrieve the dotenv configuration from.
35
+ * @param parsed - The parsed dotenv configuration.
36
+ * @returns An object containing the dotenv configuration.
37
+ */
38
+ declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvParseOutput): {
39
+ APP_NAME: string | undefined;
40
+ APP_VERSION: string | undefined;
41
+ BUILD_ID: string;
42
+ BUILD_TIMESTAMP: string;
43
+ BUILD_CHECKSUM: string;
44
+ RELEASE_ID: string;
45
+ RELEASE_TAG: string;
46
+ DEFAULT_LOCALE: string | undefined;
47
+ DEFAULT_TIMEZONE: string | undefined;
48
+ LOG_LEVEL: "debug" | "error" | "warn" | "info" | "trace" | null;
49
+ ERROR_URL: string | undefined;
50
+ ORGANIZATION: string | undefined;
51
+ PLATFORM: "node" | "browser" | "neutral" | undefined;
52
+ MODE: "test" | "development" | "production" | undefined;
53
+ DEBUG: boolean;
54
+ STACKTRACE: boolean;
55
+ ENVIRONMENT: EnvironmentResolvedConfig;
56
+ };
57
+ declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
58
+
59
+ export { loadEnv, loadEnvFromContext };
@@ -0,0 +1,7 @@
1
+ import {a}from'../chunk-UCUR73HG.js';import {loadEnv,loadEnvFile}from'@stryke/env/load-env';import {joinPaths}from'@stryke/path/join-paths';import {kebabCase}from'@stryke/string-format/kebab-case';import {isSetObject}from'@stryke/type-checks/is-set-object';import {isSetString}from'@stryke/type-checks/is-set-string';import {loadConfig}from'c12';import m from'defu';import {removeEnvPrefix}from'./source-file-env';/*****************************************
2
+ *
3
+ * ⚡ Built by Storm Software
4
+ *
5
+ *****************************************/
6
+
7
+ async function k(e,o,a){let n=await loadEnv(a,o);if(e.additionalFiles&&e.additionalFiles?.length>0){const r=await Promise.all(e.additionalFiles.map(async i=>loadEnvFile(i,a)));for(const i of r)n=m(i,n);}return removeEnvPrefix(n)}a(k,"loadEnvFiles");async function p(e,o,a,n,r,i){const[l,t]=await Promise.all([k(e,a,o),loadConfig({cwd:o,name:"storm",envName:a,defaults:{NAME:r.name?.replace(`@${i.namespace}/`,""),MODE:a,ORG:i.organization},globalRc:true,packageJson:true,dotenv:true,jitiOptions:{fsCache:joinPaths(n,"jiti"),moduleCache:true}})]);return m(l,t.config,i)}a(p,"loadEnvDirectory");function C(e,o){return m({APP_NAME:kebabCase(e.config.name||e.packageJson.name?.replace(`/${e.workspaceConfig.namespace}`,"")),APP_VERSION:e.packageJson.version,BUILD_ID:e.meta.buildId,BUILD_TIMESTAMP:new Date(e.meta.timestamp).toISOString(),BUILD_CHECKSUM:e.meta.checksum,RELEASE_ID:e.meta.releaseId,RELEASE_TAG:`${kebabCase(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:e.workspaceConfig.locale,DEFAULT_TIMEZONE:e.workspaceConfig.timezone,LOG_LEVEL:e.config.logLevel,ERROR_URL:e.workspaceConfig.error?.url,ORGANIZATION:isSetString(e.workspaceConfig.organization)?e.workspaceConfig.organization:e.workspaceConfig.organization?.name,PLATFORM:e.config.build.platform,MODE:e.workspaceConfig.mode,DEBUG:e.workspaceConfig.mode==="development",STACKTRACE:e.workspaceConfig.mode==="development",ENVIRONMENT:e.environment},isSetObject(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce((a,n)=>(a[n.name]=o[n.name]??n.getDefaultValue(),a),{}):{})}a(C,"loadEnvFromContext");async function J(e,o){const[a,n,r]=await Promise.all([p(o,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),p(o,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),p(o,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return m(C(e,process.env),a,n,r)}a(J,"loadEnv");export{J as loadEnv,C as loadEnvFromContext};
@@ -0,0 +1,7 @@
1
+ 'use strict';var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),capnp=require('@powerlines/deepkit/capnp'),resolveReflections=require('@powerlines/deepkit/resolve-reflections'),reflection=require('@powerlines/deepkit/schemas/reflection'),type=require('@powerlines/deepkit/vendor/type'),v=require('@stryke/capnp'),buffer=require('@stryke/fs/buffer'),resolve=require('@stryke/fs/resolve'),joinPaths=require('@stryke/path/join-paths'),isEmptyObject=require('@stryke/type-checks/is-empty-object'),node_buffer=require('node:buffer'),node_fs=require('node:fs'),reflect=require('./reflect');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var v__namespace=/*#__PURE__*/_interopNamespace(v);/*****************************************
2
+ *
3
+ * ⚡ Built by Storm Software
4
+ *
5
+ *****************************************/
6
+
7
+ async function b(e){return resolve.resolvePackage("@powerlines/plugin-env/types/runtime",{paths:[e.workspaceConfig.workspaceRoot,joinPaths.joinPaths(e.workspaceConfig.workspaceRoot,e.config.projectRoot)]})}chunkFBBMZ4NC_cjs.a(b,"resolveRuntimeTypeFile");async function Z(e){return {file:await b(e),name:"EnvInterface"}}chunkFBBMZ4NC_cjs.a(Z,"getEnvDefaultTypeDefinition");async function x(e){return {file:await b(e),name:"SecretsInterface"}}chunkFBBMZ4NC_cjs.a(x,"getSecretsDefaultTypeDefinition");function B(e,n="env"){return joinPaths.joinPaths(resolveReflections.getReflectionsPath(e),"env",`${n}-types.bin`)}chunkFBBMZ4NC_cjs.a(B,"getEnvTypeReflectionsPath");async function M(e,n="env"){const t=B(e,n);if(!node_fs.existsSync(t)){if(!e.env.types.env||isEmptyObject.isEmptyObject(e.env.types.env)){const f=reflect.createEnvReflection(e),P=new v__namespace.Message;f.messageRoot=P.initRoot(reflection.SerializedTypes),f.dataBuffer=P.toArrayBuffer(),e.env.types.env=f,await z(e,e.env.types.env,n);}return e.env.types.env}const o=await buffer.readFileBuffer(t),i=new v__namespace.Message(o,false).getRoot(reflection.SerializedTypes),r=type.resolveClassType(type.deserializeType(capnp.convertFromCapnp(i.types)));return e.env.types[n]=r,e.env.types[n].messageRoot=i,e.env.types[n].dataBuffer=o,r}chunkFBBMZ4NC_cjs.a(M,"readEnvTypeReflection");async function z(e,n,t="env"){const o=n.serializeType(),s=new v__namespace.Message,i=s.initRoot(reflection.SerializedTypes);capnp.convertToCapnp(o,i._initTypes(o.length)),await e.fs.writeFile(B(e,t),node_buffer.Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}chunkFBBMZ4NC_cjs.a(z,"writeEnvTypeReflection");function l(e,n){return joinPaths.joinPaths(resolveReflections.getReflectionsPath(e),"env",`${n}.bin`)}chunkFBBMZ4NC_cjs.a(l,"getEnvReflectionsPath");async function ee(e){const n=l(e,"env");if(!node_fs.existsSync(n)){if(e.env.types.env||(e.env.types.env=await M(e,"env")),!e.env.used.env||isEmptyObject.isEmptyObject(e.env.used.env)){const r=reflect.createEnvReflection(e,{type:{kind:type.ReflectionKind.objectLiteral,typeName:"Env",description:`An object containing the environment configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:"application"}.`,types:[]},superReflection:e.env.types.env});r.name="Env";const f=new v__namespace.Message;r.messageRoot=f.initRoot(reflection.SerializedTypes),r.dataBuffer=f.toArrayBuffer(),e.env.used.env=r,await S(e,e.env.used.env,"env");}return e.env.used.env}const t=await buffer.readFileBuffer(n),s=new v__namespace.Message(t,false).getRoot(reflection.SerializedTypes),i=type.resolveClassType(type.deserializeType(capnp.convertFromCapnp(s.types)));return e.env.used.env=i,e.env.used.env.messageRoot=s,e.env.used.env.dataBuffer=t,i}chunkFBBMZ4NC_cjs.a(ee,"readEnvReflection");async function ne(e){const n=l(e,"secrets");if(!node_fs.existsSync(n)){if(e.env.types.secrets||(e.env.types.secrets=await M(e,"secrets")),!e.env.used.secrets||isEmptyObject.isEmptyObject(e.env.used.secrets)){const r=reflect.createEnvReflection(e,{type:{kind:type.ReflectionKind.objectLiteral,typeName:"Secrets",description:`An object containing the secret configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:"application"}.`,types:[]},superReflection:e.env.types.secrets});r.name="Secrets";const f=new v__namespace.Message;r.messageRoot=f.initRoot(reflection.SerializedTypes),r.dataBuffer=f.toArrayBuffer(),e.env.used.secrets=r,await S(e,e.env.used.secrets,"secrets");}return e.env.used.secrets}const t=await buffer.readFileBuffer(n),s=new v__namespace.Message(t,false).getRoot(reflection.SerializedTypes),i=type.resolveClassType(type.deserializeType(capnp.convertFromCapnp(s.types)));return e.env.used.secrets=i,e.env.used.secrets.messageRoot=s,e.env.used.secrets.dataBuffer=t,i}chunkFBBMZ4NC_cjs.a(ne,"readSecretsReflection");async function S(e,n,t="env"){const o=n.serializeType(),s=new v__namespace.Message,i=s.initRoot(reflection.SerializedTypes);capnp.convertToCapnp(o,i._initTypes(o.length)),await e.fs.writeFile(l(e,t),node_buffer.Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}chunkFBBMZ4NC_cjs.a(S,"writeEnvReflection");function se(e,n,t="env"){const o=n.serializeType(),s=new v__namespace.Message,i=s.initRoot(reflection.SerializedTypes);capnp.convertToCapnp(o,i._initTypes(o.length)),e.fs.writeFileSync(l(e,t),node_buffer.Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}chunkFBBMZ4NC_cjs.a(se,"writeEnvReflectionSync");exports.getEnvDefaultTypeDefinition=Z;exports.getEnvReflectionsPath=l;exports.getEnvTypeReflectionsPath=B;exports.getSecretsDefaultTypeDefinition=x;exports.readEnvReflection=ee;exports.readEnvTypeReflection=M;exports.readSecretsReflection=ne;exports.resolveRuntimeTypeFile=b;exports.writeEnvReflection=S;exports.writeEnvReflectionSync=se;exports.writeEnvTypeReflection=z;
@@ -0,0 +1,107 @@
1
+ import { ReflectionClass } from '@deepkit/type';
2
+ import { TypeDefinition } from '@stryke/types/configuration';
3
+ import { C as Context } from '../runtime-DEhb6gxi.cjs';
4
+ import { EnvPluginResolvedConfig, EnvType, EnvPluginContext } from '../types/plugin.cjs';
5
+ import '@stryke/env/get-env-paths';
6
+ import '@stryke/types/package-json';
7
+ import 'jiti';
8
+ import 'oxc-parser';
9
+ import 'semver';
10
+ import 'unplugin';
11
+ import '@babel/core';
12
+ import '@storm-software/build-tools/types';
13
+ import '@storm-software/config-tools/types';
14
+ import '@storm-software/config/types';
15
+ import '@stryke/types/base';
16
+ import '@stryke/types/file';
17
+ import 'vite';
18
+ import '@babel/helper-plugin-utils';
19
+ import '@stryke/types/array';
20
+ import '@stryke/types/tsconfig';
21
+ import 'typescript';
22
+ import '../vfs-Bl84Hw2V.cjs';
23
+ import '@stryke/json/types';
24
+ import 'memfs';
25
+ import 'node:fs';
26
+ import 'unionfs';
27
+ import '@alloy-js/core/jsx-runtime';
28
+ import '@stryke/capnp';
29
+ import '@stryke/env/types';
30
+
31
+ /**
32
+ * Resolves the runtime type definition file for the environment variables.
33
+ *
34
+ * @param context - The plugin context.
35
+ * @returns The runtime type definition file for the environment variables.
36
+ */
37
+ declare function resolveRuntimeTypeFile(context: Context<EnvPluginResolvedConfig>): Promise<string>;
38
+ /**
39
+ * Gets the default type definition for the environment variables.
40
+ *
41
+ * @param context - The plugin context.
42
+ * @returns The default type definition for the environment variables.
43
+ */
44
+ declare function getEnvDefaultTypeDefinition(context: Context<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
45
+ /** Gets the default type definition for the environment secrets.
46
+ *
47
+ * @param context - The plugin context.
48
+ * @returns The default type definition for the environment secrets.
49
+ */
50
+ declare function getSecretsDefaultTypeDefinition(context: Context<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
51
+ /**
52
+ * Gets the path to the environment type reflections.
53
+ *
54
+ * @param context - The plugin context.
55
+ * @param name - The name of the type reflections.
56
+ * @returns The path to the environment type reflections.
57
+ */
58
+ declare function getEnvTypeReflectionsPath(context: Context<EnvPluginResolvedConfig>, name?: EnvType): string;
59
+ /**
60
+ * Reads the environment type reflection from the file system.
61
+ *
62
+ * @param context - The plugin context.
63
+ * @param name - The name of the type reflections.
64
+ * @returns The environment type reflection.
65
+ */
66
+ declare function readEnvTypeReflection(context: EnvPluginContext, name?: EnvType): Promise<ReflectionClass<any>>;
67
+ /**
68
+ * Writes the environment type reflection to the file system.
69
+ *
70
+ * @param context - The plugin context.
71
+ * @param reflection - The environment type reflection to write.
72
+ * @param name - The name of the type reflections.
73
+ */
74
+ declare function writeEnvTypeReflection(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): Promise<void>;
75
+ declare function getEnvReflectionsPath(context: EnvPluginContext, name: EnvType): string;
76
+ /**
77
+ * Reads the environment reflection data from the file system.
78
+ *
79
+ * @param context - The plugin context.
80
+ * @returns The environment reflection data.
81
+ */
82
+ declare function readEnvReflection(context: EnvPluginContext): Promise<ReflectionClass<any>>;
83
+ /**
84
+ * Reads the secret environment reflection data from the file system.
85
+ *
86
+ * @param context - The plugin context.
87
+ * @returns The environment reflection data.
88
+ */
89
+ declare function readSecretsReflection(context: EnvPluginContext): Promise<ReflectionClass<any>>;
90
+ /**
91
+ * Writes the environment reflection data to the file system.
92
+ *
93
+ * @param context - The plugin context.
94
+ * @param reflection - The reflection data to write.
95
+ * @param name - The name of the reflection (either "env" or "secrets").
96
+ */
97
+ declare function writeEnvReflection(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): Promise<void>;
98
+ /**
99
+ * Writes the environment reflection data to the file system.
100
+ *
101
+ * @param context - The plugin context.
102
+ * @param reflection - The reflection data to write.
103
+ * @param name - The name of the reflection (either "env" or "secrets").
104
+ */
105
+ declare function writeEnvReflectionSync(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): void;
106
+
107
+ export { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
@@ -0,0 +1,107 @@
1
+ import { ReflectionClass } from '@deepkit/type';
2
+ import { TypeDefinition } from '@stryke/types/configuration';
3
+ import { C as Context } from '../runtime-CUeIsMV9.js';
4
+ import { EnvPluginResolvedConfig, EnvType, EnvPluginContext } from '../types/plugin.js';
5
+ import '@stryke/env/get-env-paths';
6
+ import '@stryke/types/package-json';
7
+ import 'jiti';
8
+ import 'oxc-parser';
9
+ import 'semver';
10
+ import 'unplugin';
11
+ import '@babel/core';
12
+ import '@storm-software/build-tools/types';
13
+ import '@storm-software/config-tools/types';
14
+ import '@storm-software/config/types';
15
+ import '@stryke/types/base';
16
+ import '@stryke/types/file';
17
+ import 'vite';
18
+ import '@babel/helper-plugin-utils';
19
+ import '@stryke/types/array';
20
+ import '@stryke/types/tsconfig';
21
+ import 'typescript';
22
+ import '../vfs-Bl84Hw2V.js';
23
+ import '@stryke/json/types';
24
+ import 'memfs';
25
+ import 'node:fs';
26
+ import 'unionfs';
27
+ import '@alloy-js/core/jsx-runtime';
28
+ import '@stryke/capnp';
29
+ import '@stryke/env/types';
30
+
31
+ /**
32
+ * Resolves the runtime type definition file for the environment variables.
33
+ *
34
+ * @param context - The plugin context.
35
+ * @returns The runtime type definition file for the environment variables.
36
+ */
37
+ declare function resolveRuntimeTypeFile(context: Context<EnvPluginResolvedConfig>): Promise<string>;
38
+ /**
39
+ * Gets the default type definition for the environment variables.
40
+ *
41
+ * @param context - The plugin context.
42
+ * @returns The default type definition for the environment variables.
43
+ */
44
+ declare function getEnvDefaultTypeDefinition(context: Context<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
45
+ /** Gets the default type definition for the environment secrets.
46
+ *
47
+ * @param context - The plugin context.
48
+ * @returns The default type definition for the environment secrets.
49
+ */
50
+ declare function getSecretsDefaultTypeDefinition(context: Context<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
51
+ /**
52
+ * Gets the path to the environment type reflections.
53
+ *
54
+ * @param context - The plugin context.
55
+ * @param name - The name of the type reflections.
56
+ * @returns The path to the environment type reflections.
57
+ */
58
+ declare function getEnvTypeReflectionsPath(context: Context<EnvPluginResolvedConfig>, name?: EnvType): string;
59
+ /**
60
+ * Reads the environment type reflection from the file system.
61
+ *
62
+ * @param context - The plugin context.
63
+ * @param name - The name of the type reflections.
64
+ * @returns The environment type reflection.
65
+ */
66
+ declare function readEnvTypeReflection(context: EnvPluginContext, name?: EnvType): Promise<ReflectionClass<any>>;
67
+ /**
68
+ * Writes the environment type reflection to the file system.
69
+ *
70
+ * @param context - The plugin context.
71
+ * @param reflection - The environment type reflection to write.
72
+ * @param name - The name of the type reflections.
73
+ */
74
+ declare function writeEnvTypeReflection(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): Promise<void>;
75
+ declare function getEnvReflectionsPath(context: EnvPluginContext, name: EnvType): string;
76
+ /**
77
+ * Reads the environment reflection data from the file system.
78
+ *
79
+ * @param context - The plugin context.
80
+ * @returns The environment reflection data.
81
+ */
82
+ declare function readEnvReflection(context: EnvPluginContext): Promise<ReflectionClass<any>>;
83
+ /**
84
+ * Reads the secret environment reflection data from the file system.
85
+ *
86
+ * @param context - The plugin context.
87
+ * @returns The environment reflection data.
88
+ */
89
+ declare function readSecretsReflection(context: EnvPluginContext): Promise<ReflectionClass<any>>;
90
+ /**
91
+ * Writes the environment reflection data to the file system.
92
+ *
93
+ * @param context - The plugin context.
94
+ * @param reflection - The reflection data to write.
95
+ * @param name - The name of the reflection (either "env" or "secrets").
96
+ */
97
+ declare function writeEnvReflection(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): Promise<void>;
98
+ /**
99
+ * Writes the environment reflection data to the file system.
100
+ *
101
+ * @param context - The plugin context.
102
+ * @param reflection - The reflection data to write.
103
+ * @param name - The name of the reflection (either "env" or "secrets").
104
+ */
105
+ declare function writeEnvReflectionSync(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): void;
106
+
107
+ export { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
@@ -0,0 +1,7 @@
1
+ import {a}from'../chunk-UCUR73HG.js';import {convertFromCapnp,convertToCapnp}from'@powerlines/deepkit/capnp';import {getReflectionsPath}from'@powerlines/deepkit/resolve-reflections';import {SerializedTypes}from'@powerlines/deepkit/schemas/reflection';import {resolveClassType,deserializeType,ReflectionKind}from'@powerlines/deepkit/vendor/type';import*as v from'@stryke/capnp';import {readFileBuffer}from'@stryke/fs/buffer';import {resolvePackage}from'@stryke/fs/resolve';import {joinPaths}from'@stryke/path/join-paths';import {isEmptyObject}from'@stryke/type-checks/is-empty-object';import {Buffer}from'node:buffer';import {existsSync}from'node:fs';import {createEnvReflection}from'./reflect';/*****************************************
2
+ *
3
+ * ⚡ Built by Storm Software
4
+ *
5
+ *****************************************/
6
+
7
+ async function b(e){return resolvePackage("@powerlines/plugin-env/types/runtime",{paths:[e.workspaceConfig.workspaceRoot,joinPaths(e.workspaceConfig.workspaceRoot,e.config.projectRoot)]})}a(b,"resolveRuntimeTypeFile");async function x(e){return {file:await b(e),name:"EnvInterface"}}a(x,"getEnvDefaultTypeDefinition");async function ee(e){return {file:await b(e),name:"SecretsInterface"}}a(ee,"getSecretsDefaultTypeDefinition");function B(e,n="env"){return joinPaths(getReflectionsPath(e),"env",`${n}-types.bin`)}a(B,"getEnvTypeReflectionsPath");async function M(e,n="env"){const t=B(e,n);if(!existsSync(t)){if(!e.env.types.env||isEmptyObject(e.env.types.env)){const f=createEnvReflection(e),P=new v.Message;f.messageRoot=P.initRoot(SerializedTypes),f.dataBuffer=P.toArrayBuffer(),e.env.types.env=f,await z(e,e.env.types.env,n);}return e.env.types.env}const o=await readFileBuffer(t),i=new v.Message(o,false).getRoot(SerializedTypes),r=resolveClassType(deserializeType(convertFromCapnp(i.types)));return e.env.types[n]=r,e.env.types[n].messageRoot=i,e.env.types[n].dataBuffer=o,r}a(M,"readEnvTypeReflection");async function z(e,n,t="env"){const o=n.serializeType(),s=new v.Message,i=s.initRoot(SerializedTypes);convertToCapnp(o,i._initTypes(o.length)),await e.fs.writeFile(B(e,t),Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}a(z,"writeEnvTypeReflection");function l(e,n){return joinPaths(getReflectionsPath(e),"env",`${n}.bin`)}a(l,"getEnvReflectionsPath");async function ne(e){const n=l(e,"env");if(!existsSync(n)){if(e.env.types.env||(e.env.types.env=await M(e,"env")),!e.env.used.env||isEmptyObject(e.env.used.env)){const r=createEnvReflection(e,{type:{kind:ReflectionKind.objectLiteral,typeName:"Env",description:`An object containing the environment configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:"application"}.`,types:[]},superReflection:e.env.types.env});r.name="Env";const f=new v.Message;r.messageRoot=f.initRoot(SerializedTypes),r.dataBuffer=f.toArrayBuffer(),e.env.used.env=r,await S(e,e.env.used.env,"env");}return e.env.used.env}const t=await readFileBuffer(n),s=new v.Message(t,false).getRoot(SerializedTypes),i=resolveClassType(deserializeType(convertFromCapnp(s.types)));return e.env.used.env=i,e.env.used.env.messageRoot=s,e.env.used.env.dataBuffer=t,i}a(ne,"readEnvReflection");async function se(e){const n=l(e,"secrets");if(!existsSync(n)){if(e.env.types.secrets||(e.env.types.secrets=await M(e,"secrets")),!e.env.used.secrets||isEmptyObject(e.env.used.secrets)){const r=createEnvReflection(e,{type:{kind:ReflectionKind.objectLiteral,typeName:"Secrets",description:`An object containing the secret configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:"application"}.`,types:[]},superReflection:e.env.types.secrets});r.name="Secrets";const f=new v.Message;r.messageRoot=f.initRoot(SerializedTypes),r.dataBuffer=f.toArrayBuffer(),e.env.used.secrets=r,await S(e,e.env.used.secrets,"secrets");}return e.env.used.secrets}const t=await readFileBuffer(n),s=new v.Message(t,false).getRoot(SerializedTypes),i=resolveClassType(deserializeType(convertFromCapnp(s.types)));return e.env.used.secrets=i,e.env.used.secrets.messageRoot=s,e.env.used.secrets.dataBuffer=t,i}a(se,"readSecretsReflection");async function S(e,n,t="env"){const o=n.serializeType(),s=new v.Message,i=s.initRoot(SerializedTypes);convertToCapnp(o,i._initTypes(o.length)),await e.fs.writeFile(l(e,t),Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}a(S,"writeEnvReflection");function te(e,n,t="env"){const o=n.serializeType(),s=new v.Message,i=s.initRoot(SerializedTypes);convertToCapnp(o,i._initTypes(o.length)),e.fs.writeFileSync(l(e,t),Buffer.from(s.toArrayBuffer()),{encoding:"binary",mode:"fs"});}a(te,"writeEnvReflectionSync");export{x as getEnvDefaultTypeDefinition,l as getEnvReflectionsPath,B as getEnvTypeReflectionsPath,ee as getSecretsDefaultTypeDefinition,ne as readEnvReflection,M as readEnvTypeReflection,se as readSecretsReflection,b as resolveRuntimeTypeFile,S as writeEnvReflection,te as writeEnvReflectionSync,z as writeEnvTypeReflection};
@@ -0,0 +1,7 @@
1
+ 'use strict';var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),reflectType=require('@powerlines/deepkit/reflect-type'),type=require('@powerlines/deepkit/vendor/type'),isParentPath=require('@stryke/path/is-parent-path'),joinPaths=require('@stryke/path/join-paths'),titleCase=require('@stryke/string-format/title-case'),persistence=require('./persistence');/*****************************************
2
+ *
3
+ * ⚡ Built by Storm Software
4
+ *
5
+ *****************************************/
6
+
7
+ function T(e,n){return O(e,{type:type.merge(n.map(t=>t.type))})}chunkFBBMZ4NC_cjs.a(T,"mergeEnvReflections");function v(e,n){return I(e,{type:type.merge(n.map(t=>t.type))})}chunkFBBMZ4NC_cjs.a(v,"mergeSecretsReflections");class b{static{chunkFBBMZ4NC_cjs.a(this,"BaseEnv");}POWERLINES_LOCAL=false;APP_NAME;APP_VERSION;BUILD_ID;BUILD_TIMESTAMP;BUILD_CHECKSUM;RELEASE_ID;RELEASE_TAG;ORGANIZATION;PLATFORM="neutral";MODE="development";ENVIRONMENT;DEBUG=false;TEST=false;MINIMAL=false;NO_COLOR=false;FORCE_COLOR=false;FORCE_HYPERLINK=false;STACKTRACE=false;INCLUDE_ERROR_DATA=false;ERROR_URL;DEFAULT_TIMEZONE;DEFAULT_LOCALE;CI=false}class L{static{chunkFBBMZ4NC_cjs.a(this,"BaseSecrets");}ENCRYPTION_KEY}function O(e,n={}){const i=n.superReflection??new type.ReflectionClass({kind:type.ReflectionKind.class,description:`The base environment configuration definition for the ${titleCase.titleCase(e.config.name)} project.`,classType:b,types:[],implements:[{kind:type.ReflectionKind.objectLiteral,typeName:"EnvInterface",description:`The environment configuration interface definition for the ${titleCase.titleCase(e.config.name)} project.`,types:[]}]});i.name="Env";const t=new type.ReflectionClass(n.type??{kind:type.ReflectionKind.objectLiteral,typeName:"Env",description:`A schema describing the list of available environment variables that can be used by the ${e.config.name?`${titleCase.titleCase(e.config.name)} application`:"application"}.`,types:[]},i);return t.name="Env",t}chunkFBBMZ4NC_cjs.a(O,"createEnvReflection");function I(e,n={}){const i=n.superReflection??new type.ReflectionClass({kind:type.ReflectionKind.class,description:`The base secrets configuration definition for the ${titleCase.titleCase(e.config.name)} project.`,classType:L,types:[],implements:[{kind:type.ReflectionKind.objectLiteral,typeName:"SecretsInterface",description:`The secrets configuration interface definition for the ${titleCase.titleCase(e.config.name)} project.`,types:[]}]});i.name="Secrets";const t=new type.ReflectionClass(n.type??{kind:type.ReflectionKind.objectLiteral,typeName:"Secrets",description:`A schema describing the list of available environment secrets that can be used by the ${e.config.name?`${titleCase.titleCase(e.config.name)} application`:"application"}.`,types:[]},i);return t.name="Secrets",t}chunkFBBMZ4NC_cjs.a(I,"createSecretsReflection");async function F(e,n,i){let t;if(n){const m=await reflectType.reflectType(e,{file:isParentPath.isParentPath(n,e.workspaceConfig.workspaceRoot)?n:joinPaths.joinPaths(e.workspaceConfig.workspaceRoot,n),name:i},{skipNodeModulesBundle:true});t=type.resolveClassType(m);}const f=await reflectType.reflectType(e,await persistence.getEnvDefaultTypeDefinition(e)),p=await persistence.readEnvTypeReflection(e,"env");return T(e,[p,t,type.resolveClassType(f)].filter(Boolean))}chunkFBBMZ4NC_cjs.a(F,"reflectEnv");async function K(e,n,i){let t;if(n){const m=await reflectType.reflectType(e,{file:isParentPath.isParentPath(n,e.workspaceConfig.workspaceRoot)?n:joinPaths.joinPaths(e.workspaceConfig.workspaceRoot,n),name:i},{skipNodeModulesBundle:true});t=type.resolveClassType(m);}const f=await reflectType.reflectType(e,await persistence.getSecretsDefaultTypeDefinition(e)),p=await persistence.readSecretsReflection(e);return v(e,[p,t,type.resolveClassType(f)].filter(Boolean))}chunkFBBMZ4NC_cjs.a(K,"reflectSecrets");exports.BaseEnv=b;exports.BaseSecrets=L;exports.createEnvReflection=O;exports.createSecretsReflection=I;exports.mergeEnvReflections=T;exports.mergeSecretsReflections=v;exports.reflectEnv=F;exports.reflectSecrets=K;
@@ -0,0 +1,71 @@
1
+ import { ReflectionClass, TypeObjectLiteral, TypeClass } from '@deepkit/type';
2
+ import { EnvPluginContext } from '../types/plugin.cjs';
3
+ import { E as EnvInterface, S as SecretsInterface } from '../runtime-DEhb6gxi.cjs';
4
+ import '@alloy-js/core/jsx-runtime';
5
+ import '@stryke/capnp';
6
+ import '@stryke/env/types';
7
+ import '@stryke/types/configuration';
8
+ import '@stryke/env/get-env-paths';
9
+ import '@stryke/types/package-json';
10
+ import 'jiti';
11
+ import 'oxc-parser';
12
+ import 'semver';
13
+ import 'unplugin';
14
+ import '@babel/core';
15
+ import '@storm-software/build-tools/types';
16
+ import '@storm-software/config-tools/types';
17
+ import '@storm-software/config/types';
18
+ import '@stryke/types/base';
19
+ import '@stryke/types/file';
20
+ import 'vite';
21
+ import '@babel/helper-plugin-utils';
22
+ import '@stryke/types/array';
23
+ import '@stryke/types/tsconfig';
24
+ import 'typescript';
25
+ import '../vfs-Bl84Hw2V.cjs';
26
+ import '@stryke/json/types';
27
+ import 'memfs';
28
+ import 'node:fs';
29
+ import 'unionfs';
30
+
31
+ declare function mergeEnvReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
32
+ declare function mergeSecretsReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
33
+ interface CreateEnvReflectionOptions {
34
+ type?: TypeObjectLiteral | TypeClass;
35
+ superReflection?: ReflectionClass<any>;
36
+ }
37
+ declare class BaseEnv implements EnvInterface {
38
+ POWERLINES_LOCAL: boolean;
39
+ APP_NAME: string;
40
+ APP_VERSION: string;
41
+ BUILD_ID: string;
42
+ BUILD_TIMESTAMP: string;
43
+ BUILD_CHECKSUM: string;
44
+ RELEASE_ID: string;
45
+ RELEASE_TAG: string;
46
+ ORGANIZATION: string;
47
+ PLATFORM: "node" | "browser" | "neutral";
48
+ MODE: "development" | "test" | "production";
49
+ ENVIRONMENT: string;
50
+ DEBUG: boolean;
51
+ TEST: boolean;
52
+ MINIMAL: boolean;
53
+ NO_COLOR: boolean;
54
+ FORCE_COLOR: number | boolean;
55
+ FORCE_HYPERLINK: number | boolean;
56
+ STACKTRACE: boolean;
57
+ INCLUDE_ERROR_DATA: boolean;
58
+ ERROR_URL: string;
59
+ DEFAULT_TIMEZONE: string;
60
+ DEFAULT_LOCALE: string;
61
+ CI: boolean;
62
+ }
63
+ declare class BaseSecrets implements SecretsInterface {
64
+ ENCRYPTION_KEY: string;
65
+ }
66
+ declare function createEnvReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
67
+ declare function createSecretsReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
68
+ declare function reflectEnv(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
69
+ declare function reflectSecrets(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
70
+
71
+ export { BaseEnv, BaseSecrets, type CreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets };
@@ -0,0 +1,71 @@
1
+ import { ReflectionClass, TypeObjectLiteral, TypeClass } from '@deepkit/type';
2
+ import { EnvPluginContext } from '../types/plugin.js';
3
+ import { E as EnvInterface, S as SecretsInterface } from '../runtime-CUeIsMV9.js';
4
+ import '@alloy-js/core/jsx-runtime';
5
+ import '@stryke/capnp';
6
+ import '@stryke/env/types';
7
+ import '@stryke/types/configuration';
8
+ import '@stryke/env/get-env-paths';
9
+ import '@stryke/types/package-json';
10
+ import 'jiti';
11
+ import 'oxc-parser';
12
+ import 'semver';
13
+ import 'unplugin';
14
+ import '@babel/core';
15
+ import '@storm-software/build-tools/types';
16
+ import '@storm-software/config-tools/types';
17
+ import '@storm-software/config/types';
18
+ import '@stryke/types/base';
19
+ import '@stryke/types/file';
20
+ import 'vite';
21
+ import '@babel/helper-plugin-utils';
22
+ import '@stryke/types/array';
23
+ import '@stryke/types/tsconfig';
24
+ import 'typescript';
25
+ import '../vfs-Bl84Hw2V.js';
26
+ import '@stryke/json/types';
27
+ import 'memfs';
28
+ import 'node:fs';
29
+ import 'unionfs';
30
+
31
+ declare function mergeEnvReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
32
+ declare function mergeSecretsReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
33
+ interface CreateEnvReflectionOptions {
34
+ type?: TypeObjectLiteral | TypeClass;
35
+ superReflection?: ReflectionClass<any>;
36
+ }
37
+ declare class BaseEnv implements EnvInterface {
38
+ POWERLINES_LOCAL: boolean;
39
+ APP_NAME: string;
40
+ APP_VERSION: string;
41
+ BUILD_ID: string;
42
+ BUILD_TIMESTAMP: string;
43
+ BUILD_CHECKSUM: string;
44
+ RELEASE_ID: string;
45
+ RELEASE_TAG: string;
46
+ ORGANIZATION: string;
47
+ PLATFORM: "node" | "browser" | "neutral";
48
+ MODE: "development" | "test" | "production";
49
+ ENVIRONMENT: string;
50
+ DEBUG: boolean;
51
+ TEST: boolean;
52
+ MINIMAL: boolean;
53
+ NO_COLOR: boolean;
54
+ FORCE_COLOR: number | boolean;
55
+ FORCE_HYPERLINK: number | boolean;
56
+ STACKTRACE: boolean;
57
+ INCLUDE_ERROR_DATA: boolean;
58
+ ERROR_URL: string;
59
+ DEFAULT_TIMEZONE: string;
60
+ DEFAULT_LOCALE: string;
61
+ CI: boolean;
62
+ }
63
+ declare class BaseSecrets implements SecretsInterface {
64
+ ENCRYPTION_KEY: string;
65
+ }
66
+ declare function createEnvReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
67
+ declare function createSecretsReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
68
+ declare function reflectEnv(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
69
+ declare function reflectSecrets(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
70
+
71
+ export { BaseEnv, BaseSecrets, type CreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets };
@@ -0,0 +1,7 @@
1
+ import {a}from'../chunk-UCUR73HG.js';import {reflectType}from'@powerlines/deepkit/reflect-type';import {merge,ReflectionClass,ReflectionKind,resolveClassType}from'@powerlines/deepkit/vendor/type';import {isParentPath}from'@stryke/path/is-parent-path';import {joinPaths}from'@stryke/path/join-paths';import {titleCase}from'@stryke/string-format/title-case';import {getEnvDefaultTypeDefinition,readEnvTypeReflection,getSecretsDefaultTypeDefinition,readSecretsReflection}from'./persistence';/*****************************************
2
+ *
3
+ * ⚡ Built by Storm Software
4
+ *
5
+ *****************************************/
6
+
7
+ function T(e,n){return O(e,{type:merge(n.map(t=>t.type))})}a(T,"mergeEnvReflections");function v(e,n){return I(e,{type:merge(n.map(t=>t.type))})}a(v,"mergeSecretsReflections");class b{static{a(this,"BaseEnv");}POWERLINES_LOCAL=false;APP_NAME;APP_VERSION;BUILD_ID;BUILD_TIMESTAMP;BUILD_CHECKSUM;RELEASE_ID;RELEASE_TAG;ORGANIZATION;PLATFORM="neutral";MODE="development";ENVIRONMENT;DEBUG=false;TEST=false;MINIMAL=false;NO_COLOR=false;FORCE_COLOR=false;FORCE_HYPERLINK=false;STACKTRACE=false;INCLUDE_ERROR_DATA=false;ERROR_URL;DEFAULT_TIMEZONE;DEFAULT_LOCALE;CI=false}class L{static{a(this,"BaseSecrets");}ENCRYPTION_KEY}function O(e,n={}){const i=n.superReflection??new ReflectionClass({kind:ReflectionKind.class,description:`The base environment configuration definition for the ${titleCase(e.config.name)} project.`,classType:b,types:[],implements:[{kind:ReflectionKind.objectLiteral,typeName:"EnvInterface",description:`The environment configuration interface definition for the ${titleCase(e.config.name)} project.`,types:[]}]});i.name="Env";const t=new ReflectionClass(n.type??{kind:ReflectionKind.objectLiteral,typeName:"Env",description:`A schema describing the list of available environment variables that can be used by the ${e.config.name?`${titleCase(e.config.name)} application`:"application"}.`,types:[]},i);return t.name="Env",t}a(O,"createEnvReflection");function I(e,n={}){const i=n.superReflection??new ReflectionClass({kind:ReflectionKind.class,description:`The base secrets configuration definition for the ${titleCase(e.config.name)} project.`,classType:L,types:[],implements:[{kind:ReflectionKind.objectLiteral,typeName:"SecretsInterface",description:`The secrets configuration interface definition for the ${titleCase(e.config.name)} project.`,types:[]}]});i.name="Secrets";const t=new ReflectionClass(n.type??{kind:ReflectionKind.objectLiteral,typeName:"Secrets",description:`A schema describing the list of available environment secrets that can be used by the ${e.config.name?`${titleCase(e.config.name)} application`:"application"}.`,types:[]},i);return t.name="Secrets",t}a(I,"createSecretsReflection");async function K(e,n,i){let t;if(n){const m=await reflectType(e,{file:isParentPath(n,e.workspaceConfig.workspaceRoot)?n:joinPaths(e.workspaceConfig.workspaceRoot,n),name:i},{skipNodeModulesBundle:true});t=resolveClassType(m);}const f=await reflectType(e,await getEnvDefaultTypeDefinition(e)),p=await readEnvTypeReflection(e,"env");return T(e,[p,t,resolveClassType(f)].filter(Boolean))}a(K,"reflectEnv");async function G(e,n,i){let t;if(n){const m=await reflectType(e,{file:isParentPath(n,e.workspaceConfig.workspaceRoot)?n:joinPaths(e.workspaceConfig.workspaceRoot,n),name:i},{skipNodeModulesBundle:true});t=resolveClassType(m);}const f=await reflectType(e,await getSecretsDefaultTypeDefinition(e)),p=await readSecretsReflection(e);return v(e,[p,t,resolveClassType(f)].filter(Boolean))}a(G,"reflectSecrets");export{b as BaseEnv,L as BaseSecrets,O as createEnvReflection,I as createSecretsReflection,T as mergeEnvReflections,v as mergeSecretsReflections,K as reflectEnv,G as reflectSecrets};
@@ -0,0 +1,7 @@
1
+ 'use strict';var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),types=require('@stryke/env/types'),camelCase=require('@stryke/string-format/camel-case'),isString=require('@stryke/type-checks/is-string');/*****************************************
2
+ *
3
+ * ⚡ Built by Storm Software
4
+ *
5
+ *****************************************/
6
+
7
+ function i(r){if(isString.isString(r)){let t=types.ENV_PREFIXES.reduce((e,n)=>(e.startsWith(n)&&(e=e.slice(n.length)),e),r.toUpperCase());for(;t.startsWith("_");)t=t.slice(1);return t}return Object.keys(r).reduce((t,e)=>{const n=i(e);return n&&(t[n]=r[e]),t},{})}chunkFBBMZ4NC_cjs.a(i,"removeEnvPrefix");function T(r){return camelCase.camelCase(i(r))}chunkFBBMZ4NC_cjs.a(T,"formatEnvField");exports.formatEnvField=T;exports.removeEnvPrefix=i;
@@ -0,0 +1,7 @@
1
+ import { DotenvParseOutput } from '@stryke/env/types';
2
+
3
+ type TReturned<TEnv> = TEnv extends string ? string : DotenvParseOutput;
4
+ declare function removeEnvPrefix<TEnv extends DotenvParseOutput | string>(env: TEnv): TReturned<TEnv>;
5
+ declare function formatEnvField(key: string): string;
6
+
7
+ export { formatEnvField, removeEnvPrefix };
@@ -0,0 +1,7 @@
1
+ import { DotenvParseOutput } from '@stryke/env/types';
2
+
3
+ type TReturned<TEnv> = TEnv extends string ? string : DotenvParseOutput;
4
+ declare function removeEnvPrefix<TEnv extends DotenvParseOutput | string>(env: TEnv): TReturned<TEnv>;
5
+ declare function formatEnvField(key: string): string;
6
+
7
+ export { formatEnvField, removeEnvPrefix };