@powerlines/plugin-env 0.16.66 → 0.16.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +0 -2
- package/dist/_virtual/_rolldown/runtime.mjs +2 -31
- package/dist/babel/plugin.cjs +83 -11
- package/dist/babel/plugin.mjs +83 -11
- package/dist/babel/plugin.mjs.map +1 -1
- package/dist/components/env-builtin.cjs +1 -1
- package/dist/components/env-builtin.mjs +1 -1
- package/dist/helpers/automd-generator.cjs +14 -4
- package/dist/helpers/automd-generator.d.mts +1 -1
- package/dist/helpers/automd-generator.mjs +14 -4
- package/dist/helpers/automd-generator.mjs.map +1 -1
- package/dist/helpers/create-reflection-resource.cjs +8 -0
- package/dist/helpers/create-reflection-resource.mjs +9 -0
- package/dist/helpers/create-reflection-resource.mjs.map +1 -1
- package/dist/helpers/docs-helper.cjs +8 -0
- package/dist/helpers/docs-helper.mjs +8 -0
- package/dist/helpers/docs-helper.mjs.map +1 -1
- package/dist/helpers/index.cjs +1 -0
- package/dist/helpers/index.mjs +2 -2
- package/dist/helpers/load.cjs +61 -10
- package/dist/helpers/load.mjs +60 -9
- package/dist/helpers/load.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +108 -1
- package/dist/helpers/persistence.mjs +108 -1
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/reflect.cjs +156 -3
- package/dist/helpers/reflect.mjs +156 -4
- package/dist/helpers/reflect.mjs.map +1 -1
- package/dist/helpers/source-file-env.cjs +34 -4
- package/dist/helpers/source-file-env.mjs +34 -4
- package/dist/helpers/source-file-env.mjs.map +1 -1
- package/dist/helpers/template-helpers.cjs +33 -5
- package/dist/helpers/template-helpers.mjs +33 -5
- package/dist/helpers/template-helpers.mjs.map +1 -1
- package/dist/types/index.cjs +11 -0
- package/dist/types/index.mjs +4 -1
- package/dist/types/plugin.cjs +137 -0
- package/dist/types/plugin.d.mts +4 -4
- package/dist/types/plugin.mjs +132 -1
- package/dist/types/plugin.mjs.map +1 -0
- package/dist/types/runtime.cjs +244 -0
- package/dist/types/runtime.mjs +242 -1
- package/dist/types/runtime.mjs.map +1 -0
- package/package.json +11 -26
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.cjs +0 -346
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs +0 -347
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.cjs +0 -23
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs +0 -23
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs.map +0 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.cjs +0 -10
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs +0 -11
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs.map +0 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.cjs +0 -1060
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs +0 -1060
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs.map +0 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.cjs +0 -761
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.mjs +0 -761
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.mjs.map +0 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.cjs +0 -388
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs +0 -388
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs.map +0 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.cjs +0 -639
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs +0 -639
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs.map +0 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.cjs +0 -17
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs +0 -15
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs.map +0 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.cjs +0 -13
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.mjs +0 -14
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.mjs.map +0 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.cjs +0 -11
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs +0 -12
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs.map +0 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/toml.cjs +0 -11
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/toml.mjs +0 -12
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/toml.mjs.map +0 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.cjs +0 -11
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.mjs +0 -12
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.mjs.map +0 -1
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +0 -46
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +0 -46
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.cjs +0 -285
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.mjs +0 -283
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.mjs.map +0 -1
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.cjs +0 -71
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.mjs +0 -69
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.mjs.map +0 -1
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +0 -1013
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +0 -1008
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.cjs +0 -23
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs +0 -10
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.cjs +0 -2695
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +0 -2682
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs.map +0 -1
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.cjs +0 -4457
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs +0 -4455
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs.map +0 -1
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.cjs +0 -29
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs +0 -30
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs.map +0 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -181
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -177
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +0 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +0 -22
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +0 -18
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +0 -3967
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +0 -3963
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +0 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.cjs +0 -11766
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs +0 -11762
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs.map +0 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +0 -25
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs +0 -21
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs.map +0 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs +0 -20
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs +0 -18
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.cjs +0 -178
- package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs +0 -176
- package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.cjs +0 -13
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs +0 -13
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.cjs +0 -3
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs +0 -3
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +0 -145
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -139
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs.map +0 -1
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +0 -128
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +0 -127
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.cjs +0 -138
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs +0 -137
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.cjs +0 -629
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs +0 -628
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.mjs","names":[],"sources":["../../src/helpers/reflect.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 { reflectType } from \"@powerlines/deepkit/reflect-type\";\nimport {\n merge,\n ReflectionClass,\n ReflectionKind,\n resolveClassType,\n TypeClass,\n TypeObjectLiteral\n} from \"@powerlines/deepkit/vendor/type\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { EnvPluginContext } from \"../types/plugin\";\nimport { EnvInterface, SecretsInterface } from \"../types/runtime\";\nimport {\n getEnvDefaultTypeDefinition,\n getSecretsDefaultTypeDefinition,\n readEnvTypeReflection,\n readSecretsReflection\n} from \"./persistence\";\n\nexport function mergeEnvReflections(\n context: EnvPluginContext,\n reflections: ReflectionClass<any>[]\n): ReflectionClass<any> {\n const reflection = createEnvReflection(context, {\n type: merge(reflections.map(reflection => reflection.type))\n });\n\n return reflection;\n}\n\nexport function mergeSecretsReflections(\n context: EnvPluginContext,\n reflections: ReflectionClass<any>[]\n): ReflectionClass<any> {\n const reflection = createSecretsReflection(context, {\n type: merge(reflections.map(reflection => reflection.type))\n });\n\n return reflection;\n}\n\nexport interface CreateEnvReflectionOptions {\n type?: TypeObjectLiteral | TypeClass;\n superReflection?: ReflectionClass<any>;\n}\n\nexport class BaseEnv implements EnvInterface {\n APP_NAME!: string;\n\n APP_VERSION!: string;\n\n BUILD_ID!: string;\n\n BUILD_TIMESTAMP!: string;\n\n BUILD_CHECKSUM!: string;\n\n RELEASE_ID!: string;\n\n RELEASE_TAG!: string;\n\n ORGANIZATION!: string;\n\n PLATFORM: \"node\" | \"browser\" | \"neutral\" = \"neutral\";\n\n MODE: \"development\" | \"test\" | \"production\" = \"production\";\n\n ENVIRONMENT!: string;\n\n DEBUG: boolean = false;\n\n TEST: boolean = false;\n\n MINIMAL: boolean = false;\n\n NO_COLOR: boolean = false;\n\n FORCE_COLOR: number | boolean = false;\n\n FORCE_HYPERLINK: number | boolean = false;\n\n STACKTRACE: boolean = false;\n\n INCLUDE_ERROR_DATA: boolean = false;\n\n ERROR_URL!: string;\n\n DEFAULT_TIMEZONE!: string;\n\n DEFAULT_LOCALE!: string;\n\n CI: boolean = false;\n}\n\nexport class BaseSecrets implements SecretsInterface {\n ENCRYPTION_KEY!: string;\n}\n\nexport function createEnvReflection(\n context: EnvPluginContext,\n options: CreateEnvReflectionOptions = {}\n): ReflectionClass<any> {\n const parent =\n options.superReflection ??\n new ReflectionClass({\n kind: ReflectionKind.class,\n description: `The base environment configuration definition for the ${titleCase(\n context.config.name\n )} project.`,\n classType: BaseEnv,\n types: [],\n implements: [\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"EnvInterface\",\n description: `The environment configuration interface definition for the ${titleCase(\n context.config.name\n )} project.`,\n types: []\n }\n ]\n });\n parent.name = \"Env\";\n\n const result = new ReflectionClass(\n options.type ?? {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `A schema describing the list of available environment variables that can be used by the ${\n context.config.name\n ? `${titleCase(context.config.name)} application`\n : \"application\"\n }.`,\n types: []\n },\n parent\n );\n result.name = \"Env\";\n\n return result;\n}\n\nexport function createSecretsReflection(\n context: EnvPluginContext,\n options: CreateEnvReflectionOptions = {}\n): ReflectionClass<any> {\n const parent =\n options.superReflection ??\n new ReflectionClass({\n kind: ReflectionKind.class,\n description: `The base secrets configuration definition for the ${titleCase(\n context.config.name\n )} project.`,\n classType: BaseSecrets,\n types: [],\n implements: [\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"SecretsInterface\",\n description: `The secrets configuration interface definition for the ${titleCase(\n context.config.name\n )} project.`,\n types: []\n }\n ]\n });\n parent.name = \"Secrets\";\n\n const result = new ReflectionClass(\n options.type ?? {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `A schema describing the list of available environment secrets that can be used by the ${\n context.config.name\n ? `${titleCase(context.config.name)} application`\n : \"application\"\n }.`,\n types: []\n },\n parent\n );\n result.name = \"Secrets\";\n\n return result;\n}\n\n/**\n * Reflects the environment configuration type definition from the provided file and name, and merges it with the default environment configuration reflection and the currently used environment configuration reflection.\n *\n * @remarks\n * The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.\n *\n * @param context - The plugin context\n * @param file - The file path to reflect the environment configuration type definition from\n * @param name - The name of the type definition to reflect the environment configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.\n * @returns A reflection of the environment configuration type definition, merged with the default environment configuration reflection and the currently used environment configuration reflection. The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.\n */\nexport async function reflectEnv(\n context: EnvPluginContext,\n file?: string,\n name?: string\n) {\n let config: ReflectionClass<any> | undefined;\n if (file) {\n const configType = await reflectType(context, {\n file: !isParentPath(file, context.workspaceConfig.workspaceRoot)\n ? joinPaths(context.workspaceConfig.workspaceRoot, file)\n : file,\n name\n });\n\n config = resolveClassType(configType);\n }\n\n return mergeEnvReflections(\n context,\n [\n await readEnvTypeReflection(context, \"env\"),\n config,\n resolveClassType(\n await reflectType(context, await getEnvDefaultTypeDefinition(context))\n )\n ].filter(Boolean) as ReflectionClass<any>[]\n );\n}\n\n/**\n * Reflects the secrets configuration type definition from the provided file and name, and merges it with the default secrets configuration reflection and the currently used secrets configuration reflection.\n *\n * @remarks\n * The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.\n *\n * @param context - The plugin context\n * @param file - The file path to reflect the secrets configuration type definition from\n * @param name - The name of the type definition to reflect the secrets configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.\n * @returns A reflection of the secrets configuration type definition, merged with the default secrets configuration reflection and the currently used secrets configuration reflection. The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.\n */\nexport async function reflectSecrets(\n context: EnvPluginContext,\n file?: string,\n name?: string\n) {\n let config: ReflectionClass<any> | undefined;\n if (file) {\n const configType = await reflectType(context, {\n file: !isParentPath(file, context.workspaceConfig.workspaceRoot)\n ? joinPaths(context.workspaceConfig.workspaceRoot, file)\n : file,\n name\n });\n\n config = resolveClassType(configType);\n }\n\n return mergeSecretsReflections(\n context,\n [\n await readSecretsReflection(context),\n config,\n resolveClassType(\n await reflectType(\n context,\n await getSecretsDefaultTypeDefinition(context)\n )\n )\n ].filter(Boolean) as ReflectionClass<any>[]\n );\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"reflect.mjs","names":[],"sources":["../../src/helpers/reflect.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 { reflectType } from \"@powerlines/deepkit/reflect-type\";\nimport {\n merge,\n ReflectionClass,\n ReflectionKind,\n resolveClassType,\n TypeClass,\n TypeObjectLiteral\n} from \"@powerlines/deepkit/vendor/type\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { EnvPluginContext } from \"../types/plugin\";\nimport { EnvInterface, SecretsInterface } from \"../types/runtime\";\nimport {\n getEnvDefaultTypeDefinition,\n getSecretsDefaultTypeDefinition,\n readEnvTypeReflection,\n readSecretsReflection\n} from \"./persistence\";\n\nexport function mergeEnvReflections(\n context: EnvPluginContext,\n reflections: ReflectionClass<any>[]\n): ReflectionClass<any> {\n const reflection = createEnvReflection(context, {\n type: merge(reflections.map(reflection => reflection.type))\n });\n\n return reflection;\n}\n\nexport function mergeSecretsReflections(\n context: EnvPluginContext,\n reflections: ReflectionClass<any>[]\n): ReflectionClass<any> {\n const reflection = createSecretsReflection(context, {\n type: merge(reflections.map(reflection => reflection.type))\n });\n\n return reflection;\n}\n\nexport interface CreateEnvReflectionOptions {\n type?: TypeObjectLiteral | TypeClass;\n superReflection?: ReflectionClass<any>;\n}\n\nexport class BaseEnv implements EnvInterface {\n APP_NAME!: string;\n\n APP_VERSION!: string;\n\n BUILD_ID!: string;\n\n BUILD_TIMESTAMP!: string;\n\n BUILD_CHECKSUM!: string;\n\n RELEASE_ID!: string;\n\n RELEASE_TAG!: string;\n\n ORGANIZATION!: string;\n\n PLATFORM: \"node\" | \"browser\" | \"neutral\" = \"neutral\";\n\n MODE: \"development\" | \"test\" | \"production\" = \"production\";\n\n ENVIRONMENT!: string;\n\n DEBUG: boolean = false;\n\n TEST: boolean = false;\n\n MINIMAL: boolean = false;\n\n NO_COLOR: boolean = false;\n\n FORCE_COLOR: number | boolean = false;\n\n FORCE_HYPERLINK: number | boolean = false;\n\n STACKTRACE: boolean = false;\n\n INCLUDE_ERROR_DATA: boolean = false;\n\n ERROR_URL!: string;\n\n DEFAULT_TIMEZONE!: string;\n\n DEFAULT_LOCALE!: string;\n\n CI: boolean = false;\n}\n\nexport class BaseSecrets implements SecretsInterface {\n ENCRYPTION_KEY!: string;\n}\n\nexport function createEnvReflection(\n context: EnvPluginContext,\n options: CreateEnvReflectionOptions = {}\n): ReflectionClass<any> {\n const parent =\n options.superReflection ??\n new ReflectionClass({\n kind: ReflectionKind.class,\n description: `The base environment configuration definition for the ${titleCase(\n context.config.name\n )} project.`,\n classType: BaseEnv,\n types: [],\n implements: [\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"EnvInterface\",\n description: `The environment configuration interface definition for the ${titleCase(\n context.config.name\n )} project.`,\n types: []\n }\n ]\n });\n parent.name = \"Env\";\n\n const result = new ReflectionClass(\n options.type ?? {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `A schema describing the list of available environment variables that can be used by the ${\n context.config.name\n ? `${titleCase(context.config.name)} application`\n : \"application\"\n }.`,\n types: []\n },\n parent\n );\n result.name = \"Env\";\n\n return result;\n}\n\nexport function createSecretsReflection(\n context: EnvPluginContext,\n options: CreateEnvReflectionOptions = {}\n): ReflectionClass<any> {\n const parent =\n options.superReflection ??\n new ReflectionClass({\n kind: ReflectionKind.class,\n description: `The base secrets configuration definition for the ${titleCase(\n context.config.name\n )} project.`,\n classType: BaseSecrets,\n types: [],\n implements: [\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"SecretsInterface\",\n description: `The secrets configuration interface definition for the ${titleCase(\n context.config.name\n )} project.`,\n types: []\n }\n ]\n });\n parent.name = \"Secrets\";\n\n const result = new ReflectionClass(\n options.type ?? {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `A schema describing the list of available environment secrets that can be used by the ${\n context.config.name\n ? `${titleCase(context.config.name)} application`\n : \"application\"\n }.`,\n types: []\n },\n parent\n );\n result.name = \"Secrets\";\n\n return result;\n}\n\n/**\n * Reflects the environment configuration type definition from the provided file and name, and merges it with the default environment configuration reflection and the currently used environment configuration reflection.\n *\n * @remarks\n * The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.\n *\n * @param context - The plugin context\n * @param file - The file path to reflect the environment configuration type definition from\n * @param name - The name of the type definition to reflect the environment configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.\n * @returns A reflection of the environment configuration type definition, merged with the default environment configuration reflection and the currently used environment configuration reflection. The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.\n */\nexport async function reflectEnv(\n context: EnvPluginContext,\n file?: string,\n name?: string\n) {\n let config: ReflectionClass<any> | undefined;\n if (file) {\n const configType = await reflectType(context, {\n file: !isParentPath(file, context.workspaceConfig.workspaceRoot)\n ? joinPaths(context.workspaceConfig.workspaceRoot, file)\n : file,\n name\n });\n\n config = resolveClassType(configType);\n }\n\n return mergeEnvReflections(\n context,\n [\n await readEnvTypeReflection(context, \"env\"),\n config,\n resolveClassType(\n await reflectType(context, await getEnvDefaultTypeDefinition(context))\n )\n ].filter(Boolean) as ReflectionClass<any>[]\n );\n}\n\n/**\n * Reflects the secrets configuration type definition from the provided file and name, and merges it with the default secrets configuration reflection and the currently used secrets configuration reflection.\n *\n * @remarks\n * The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.\n *\n * @param context - The plugin context\n * @param file - The file path to reflect the secrets configuration type definition from\n * @param name - The name of the type definition to reflect the secrets configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.\n * @returns A reflection of the secrets configuration type definition, merged with the default secrets configuration reflection and the currently used secrets configuration reflection. The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.\n */\nexport async function reflectSecrets(\n context: EnvPluginContext,\n file?: string,\n name?: string\n) {\n let config: ReflectionClass<any> | undefined;\n if (file) {\n const configType = await reflectType(context, {\n file: !isParentPath(file, context.workspaceConfig.workspaceRoot)\n ? joinPaths(context.workspaceConfig.workspaceRoot, file)\n : file,\n name\n });\n\n config = resolveClassType(configType);\n }\n\n return mergeSecretsReflections(\n context,\n [\n await readSecretsReflection(context),\n config,\n resolveClassType(\n await reflectType(\n context,\n await getSecretsDefaultTypeDefinition(context)\n )\n )\n ].filter(Boolean) as ReflectionClass<any>[]\n );\n}\n"],"mappings":"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"}
|
|
@@ -5,24 +5,54 @@ let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case
|
|
|
5
5
|
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
6
6
|
|
|
7
7
|
//#region src/helpers/source-file-env.ts
|
|
8
|
+
function __assignType(fn, args) {
|
|
9
|
+
fn.__type = args;
|
|
10
|
+
return fn;
|
|
11
|
+
}
|
|
12
|
+
const __ΩTReturned = [
|
|
13
|
+
"TEnv",
|
|
14
|
+
"TReturned",
|
|
15
|
+
"l2&R!RPe#!&qk#%QRb!Pde\"!p'w\"y"
|
|
16
|
+
];
|
|
8
17
|
function removeEnvPrefix(env) {
|
|
9
18
|
if ((0, _stryke_type_checks_is_string.isString)(env)) {
|
|
10
|
-
let name = _stryke_env_types.ENV_PREFIXES.reduce((ret, prefix) => {
|
|
19
|
+
let name = _stryke_env_types.ENV_PREFIXES.reduce(__assignType((ret, prefix) => {
|
|
11
20
|
if (ret.startsWith(prefix)) ret = ret.slice(prefix.length);
|
|
12
21
|
return ret;
|
|
13
|
-
},
|
|
22
|
+
}, [
|
|
23
|
+
"ret",
|
|
24
|
+
"prefix",
|
|
25
|
+
"",
|
|
26
|
+
"P\"2!\"2\"\"/#"
|
|
27
|
+
]), env.toUpperCase());
|
|
14
28
|
while (name.startsWith("_")) name = name.slice(1);
|
|
15
29
|
return name;
|
|
16
30
|
}
|
|
17
|
-
return Object.keys(env).reduce((ret, key) => {
|
|
31
|
+
return Object.keys(env).reduce(__assignType((ret, key) => {
|
|
18
32
|
const name = removeEnvPrefix(key);
|
|
19
33
|
if (name) ret[name] = env[key];
|
|
20
34
|
return ret;
|
|
21
|
-
},
|
|
35
|
+
}, [
|
|
36
|
+
"ret",
|
|
37
|
+
"key",
|
|
38
|
+
"",
|
|
39
|
+
"P\"2!\"2\"\"/#"
|
|
40
|
+
]), {});
|
|
22
41
|
}
|
|
42
|
+
removeEnvPrefix.__type = [
|
|
43
|
+
"env",
|
|
44
|
+
() => __ΩTReturned,
|
|
45
|
+
"removeEnvPrefix",
|
|
46
|
+
"P\"2!\"o\"\"/#"
|
|
47
|
+
];
|
|
23
48
|
function formatEnvField(key) {
|
|
24
49
|
return (0, _stryke_string_format_camel_case.camelCase)(removeEnvPrefix(key));
|
|
25
50
|
}
|
|
51
|
+
formatEnvField.__type = [
|
|
52
|
+
"key",
|
|
53
|
+
"formatEnvField",
|
|
54
|
+
"P&2!&/\""
|
|
55
|
+
];
|
|
26
56
|
|
|
27
57
|
//#endregion
|
|
28
58
|
exports.formatEnvField = formatEnvField;
|
|
@@ -3,24 +3,54 @@ import { camelCase } from "@stryke/string-format/camel-case";
|
|
|
3
3
|
import { isString } from "@stryke/type-checks/is-string";
|
|
4
4
|
|
|
5
5
|
//#region src/helpers/source-file-env.ts
|
|
6
|
+
function __assignType(fn, args) {
|
|
7
|
+
fn.__type = args;
|
|
8
|
+
return fn;
|
|
9
|
+
}
|
|
10
|
+
const __ΩTReturned = [
|
|
11
|
+
"TEnv",
|
|
12
|
+
"TReturned",
|
|
13
|
+
"l2&R!RPe#!&qk#%QRb!Pde\"!p'w\"y"
|
|
14
|
+
];
|
|
6
15
|
function removeEnvPrefix(env) {
|
|
7
16
|
if (isString(env)) {
|
|
8
|
-
let name = ENV_PREFIXES.reduce((ret, prefix) => {
|
|
17
|
+
let name = ENV_PREFIXES.reduce(__assignType((ret, prefix) => {
|
|
9
18
|
if (ret.startsWith(prefix)) ret = ret.slice(prefix.length);
|
|
10
19
|
return ret;
|
|
11
|
-
},
|
|
20
|
+
}, [
|
|
21
|
+
"ret",
|
|
22
|
+
"prefix",
|
|
23
|
+
"",
|
|
24
|
+
"P\"2!\"2\"\"/#"
|
|
25
|
+
]), env.toUpperCase());
|
|
12
26
|
while (name.startsWith("_")) name = name.slice(1);
|
|
13
27
|
return name;
|
|
14
28
|
}
|
|
15
|
-
return Object.keys(env).reduce((ret, key) => {
|
|
29
|
+
return Object.keys(env).reduce(__assignType((ret, key) => {
|
|
16
30
|
const name = removeEnvPrefix(key);
|
|
17
31
|
if (name) ret[name] = env[key];
|
|
18
32
|
return ret;
|
|
19
|
-
},
|
|
33
|
+
}, [
|
|
34
|
+
"ret",
|
|
35
|
+
"key",
|
|
36
|
+
"",
|
|
37
|
+
"P\"2!\"2\"\"/#"
|
|
38
|
+
]), {});
|
|
20
39
|
}
|
|
40
|
+
removeEnvPrefix.__type = [
|
|
41
|
+
"env",
|
|
42
|
+
() => __ΩTReturned,
|
|
43
|
+
"removeEnvPrefix",
|
|
44
|
+
"P\"2!\"o\"\"/#"
|
|
45
|
+
];
|
|
21
46
|
function formatEnvField(key) {
|
|
22
47
|
return camelCase(removeEnvPrefix(key));
|
|
23
48
|
}
|
|
49
|
+
formatEnvField.__type = [
|
|
50
|
+
"key",
|
|
51
|
+
"formatEnvField",
|
|
52
|
+
"P&2!&/\""
|
|
53
|
+
];
|
|
24
54
|
|
|
25
55
|
//#endregion
|
|
26
56
|
export { formatEnvField, removeEnvPrefix };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-file-env.mjs","names":[],"sources":["../../src/helpers/source-file-env.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 type { DotenvParseOutput } from \"@stryke/env/types\";\nimport { ENV_PREFIXES } from \"@stryke/env/types\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\n\ntype TReturned<TEnv> = TEnv extends string ? string : DotenvParseOutput;\n\nexport function removeEnvPrefix<TEnv extends DotenvParseOutput | string>(\n env: TEnv\n): TReturned<TEnv> {\n if (isString(env)) {\n let name: string = ENV_PREFIXES.reduce((ret, prefix) => {\n if (ret.startsWith(prefix)) {\n ret = ret.slice(prefix.length);\n }\n\n return ret;\n }, env.toUpperCase());\n\n while (name.startsWith(\"_\")) {\n name = name.slice(1);\n }\n\n return name as TReturned<TEnv>;\n }\n\n return Object.keys(env).reduce((ret, key) => {\n const name = removeEnvPrefix(key);\n if (name) {\n (ret as DotenvParseOutput)[name] = env[key];\n }\n\n return ret;\n }, {} as TReturned<TEnv>);\n}\n\nexport function formatEnvField(key: string): string {\n return camelCase(removeEnvPrefix(key));\n}\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"source-file-env.mjs","names":[],"sources":["../../src/helpers/source-file-env.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 type { DotenvParseOutput } from \"@stryke/env/types\";\nimport { ENV_PREFIXES } from \"@stryke/env/types\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\n\ntype TReturned<TEnv> = TEnv extends string ? string : DotenvParseOutput;\n\nexport function removeEnvPrefix<TEnv extends DotenvParseOutput | string>(\n env: TEnv\n): TReturned<TEnv> {\n if (isString(env)) {\n let name: string = ENV_PREFIXES.reduce((ret, prefix) => {\n if (ret.startsWith(prefix)) {\n ret = ret.slice(prefix.length);\n }\n\n return ret;\n }, env.toUpperCase());\n\n while (name.startsWith(\"_\")) {\n name = name.slice(1);\n }\n\n return name as TReturned<TEnv>;\n }\n\n return Object.keys(env).reduce((ret, key) => {\n const name = removeEnvPrefix(key);\n if (name) {\n (ret as DotenvParseOutput)[name] = env[key];\n }\n\n return ret;\n }, {} as TReturned<TEnv>);\n}\n\nexport function formatEnvField(key: string): string {\n return camelCase(removeEnvPrefix(key));\n}\n"],"mappings":";;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE5B,QAAO;;AAKX,MAAK,eAAe;CAAE;CAAQ;CAAC;CAAoC;;AAElE,KAAO,SAAS,IAAI,EAAE;EACtB,IAAW,OAAO,aAAa,OAAG,cAAiB,KAAA,WAAS;AAC5D,OAAe,IAAI,WAAO,OAAQ,CACnB,OAAM,IAAI,MAAM,OAAG,OAAA;AAE7B,UAAQ;;;;;;;AAEN,SAAO,KAAK,WAAW,IAAI;AAG3B,SAAC;;AAET,QAAS,OAAS,KAAE,IAAO,CAAA,OAAO,cAAe,KAAA,QAAO;;AAEnD,MAAA;AAGE,SAAA;IACJ;EAAA;EAAU;EAAM;EAAA;EAAA,CAAA,EAAA,EAAA,CAAA;;AAEnB,gBAAc,SAAS;CAAA;OAAa;CAAa;CAAW;CAAA;AAC5D,SAAc,eAAiB,KAAG;AAC9B,QAAO,UAAO,gBAAmB,IAAC,CAAA"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_types_plugin = require('../types/plugin.cjs');
|
|
3
4
|
const require_helpers_persistence = require('./persistence.cjs');
|
|
5
|
+
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
4
6
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
5
7
|
|
|
6
8
|
//#region src/helpers/template-helpers.ts
|
|
9
|
+
function __assignType(fn, args) {
|
|
10
|
+
fn.__type = args;
|
|
11
|
+
return fn;
|
|
12
|
+
}
|
|
7
13
|
/**
|
|
8
14
|
* Creates the reflection data used when generating runtime template files.
|
|
9
15
|
*
|
|
@@ -13,8 +19,8 @@ let _stryke_string_format_title_case = require("@stryke/string-format/title-case
|
|
|
13
19
|
*/
|
|
14
20
|
async function createTemplateReflection(context, name) {
|
|
15
21
|
const reflection = await require_helpers_persistence.readEnvTypeReflection(context, name);
|
|
16
|
-
reflection.getProperties().forEach((prop) => {
|
|
17
|
-
prop.getAlias().filter(Boolean).forEach((alias) => {
|
|
22
|
+
reflection.getProperties().forEach(__assignType((prop) => {
|
|
23
|
+
prop.getAlias().filter(Boolean).forEach(__assignType((alias) => {
|
|
18
24
|
reflection.addProperty({
|
|
19
25
|
name: alias,
|
|
20
26
|
optional: prop.isOptional() ? true : void 0,
|
|
@@ -27,17 +33,39 @@ async function createTemplateReflection(context, name) {
|
|
|
27
33
|
hidden: prop.isHidden(),
|
|
28
34
|
ignore: prop.isIgnored(),
|
|
29
35
|
internal: prop.isInternal(),
|
|
30
|
-
alias: prop.getAlias().filter((a) => a !== alias
|
|
36
|
+
alias: prop.getAlias().filter(__assignType((a) => a !== alias, [
|
|
37
|
+
"a",
|
|
38
|
+
"",
|
|
39
|
+
"P\"2!\"/\""
|
|
40
|
+
])).concat(prop.name),
|
|
31
41
|
title: prop.getTitle() || (0, _stryke_string_format_title_case.titleCase)(prop.name),
|
|
32
42
|
readonly: prop.isReadonly(),
|
|
33
43
|
permission: prop.getPermission(),
|
|
34
44
|
domain: prop.getDomain()
|
|
35
45
|
}
|
|
36
46
|
});
|
|
37
|
-
}
|
|
38
|
-
|
|
47
|
+
}, [
|
|
48
|
+
"alias",
|
|
49
|
+
"",
|
|
50
|
+
"P\"2!\"/\""
|
|
51
|
+
]));
|
|
52
|
+
}, [
|
|
53
|
+
"prop",
|
|
54
|
+
"",
|
|
55
|
+
"P\"2!\"/\""
|
|
56
|
+
]));
|
|
39
57
|
return reflection;
|
|
40
58
|
}
|
|
59
|
+
createTemplateReflection.__type = [
|
|
60
|
+
() => require_types_plugin.__ΩEnvPluginContext,
|
|
61
|
+
"context",
|
|
62
|
+
() => require_types_plugin.__ΩEnvType,
|
|
63
|
+
"name",
|
|
64
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
65
|
+
"createTemplateReflection",
|
|
66
|
+
"Creates the reflection data used when generating runtime template files.",
|
|
67
|
+
"Pn!2\"n#2$8P\"7%`/&?'"
|
|
68
|
+
];
|
|
41
69
|
|
|
42
70
|
//#endregion
|
|
43
71
|
exports.createTemplateReflection = createTemplateReflection;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { __ΩEnvPluginContext, __ΩEnvType } from "../types/plugin.mjs";
|
|
1
2
|
import { readEnvTypeReflection } from "./persistence.mjs";
|
|
3
|
+
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
2
4
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
3
5
|
|
|
4
6
|
//#region src/helpers/template-helpers.ts
|
|
7
|
+
function __assignType(fn, args) {
|
|
8
|
+
fn.__type = args;
|
|
9
|
+
return fn;
|
|
10
|
+
}
|
|
5
11
|
/**
|
|
6
12
|
* Creates the reflection data used when generating runtime template files.
|
|
7
13
|
*
|
|
@@ -11,8 +17,8 @@ import { titleCase } from "@stryke/string-format/title-case";
|
|
|
11
17
|
*/
|
|
12
18
|
async function createTemplateReflection(context, name) {
|
|
13
19
|
const reflection = await readEnvTypeReflection(context, name);
|
|
14
|
-
reflection.getProperties().forEach((prop) => {
|
|
15
|
-
prop.getAlias().filter(Boolean).forEach((alias) => {
|
|
20
|
+
reflection.getProperties().forEach(__assignType((prop) => {
|
|
21
|
+
prop.getAlias().filter(Boolean).forEach(__assignType((alias) => {
|
|
16
22
|
reflection.addProperty({
|
|
17
23
|
name: alias,
|
|
18
24
|
optional: prop.isOptional() ? true : void 0,
|
|
@@ -25,17 +31,39 @@ async function createTemplateReflection(context, name) {
|
|
|
25
31
|
hidden: prop.isHidden(),
|
|
26
32
|
ignore: prop.isIgnored(),
|
|
27
33
|
internal: prop.isInternal(),
|
|
28
|
-
alias: prop.getAlias().filter((a) => a !== alias
|
|
34
|
+
alias: prop.getAlias().filter(__assignType((a) => a !== alias, [
|
|
35
|
+
"a",
|
|
36
|
+
"",
|
|
37
|
+
"P\"2!\"/\""
|
|
38
|
+
])).concat(prop.name),
|
|
29
39
|
title: prop.getTitle() || titleCase(prop.name),
|
|
30
40
|
readonly: prop.isReadonly(),
|
|
31
41
|
permission: prop.getPermission(),
|
|
32
42
|
domain: prop.getDomain()
|
|
33
43
|
}
|
|
34
44
|
});
|
|
35
|
-
}
|
|
36
|
-
|
|
45
|
+
}, [
|
|
46
|
+
"alias",
|
|
47
|
+
"",
|
|
48
|
+
"P\"2!\"/\""
|
|
49
|
+
]));
|
|
50
|
+
}, [
|
|
51
|
+
"prop",
|
|
52
|
+
"",
|
|
53
|
+
"P\"2!\"/\""
|
|
54
|
+
]));
|
|
37
55
|
return reflection;
|
|
38
56
|
}
|
|
57
|
+
createTemplateReflection.__type = [
|
|
58
|
+
() => __ΩEnvPluginContext,
|
|
59
|
+
"context",
|
|
60
|
+
() => __ΩEnvType,
|
|
61
|
+
"name",
|
|
62
|
+
() => ReflectionClass,
|
|
63
|
+
"createTemplateReflection",
|
|
64
|
+
"Creates the reflection data used when generating runtime template files.",
|
|
65
|
+
"Pn!2\"n#2$8P\"7%`/&?'"
|
|
66
|
+
];
|
|
39
67
|
|
|
40
68
|
//#endregion
|
|
41
69
|
export { createTemplateReflection };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-helpers.mjs","names":[],"sources":["../../src/helpers/template-helpers.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 { ReflectionClass } from \"@powerlines/deepkit/vendor/type\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { EnvPluginContext, EnvType } from \"../types/plugin\";\nimport { readEnvTypeReflection } from \"./persistence\";\n\n/**\n * Creates the reflection data used when generating runtime template files.\n *\n * @param context - The context for the configuration plugin.\n * @param name - The name of the configuration template.\n * @returns The reflection for the specified configuration template.\n */\nexport async function createTemplateReflection(\n context: EnvPluginContext,\n name?: EnvType\n): Promise<ReflectionClass<any>> {\n const reflection = await readEnvTypeReflection(context, name);\n\n reflection.getProperties().forEach(prop => {\n const aliases = prop.getAlias();\n aliases.filter(Boolean).forEach(alias => {\n reflection.addProperty({\n name: alias,\n optional: prop.isOptional() ? true : undefined,\n readonly: prop.isReadonly() ? true : undefined,\n description: prop.getDescription(),\n visibility: prop.getVisibility(),\n type: prop.getType(),\n default: prop.getDefaultValue(),\n tags: {\n hidden: prop.isHidden(),\n ignore: prop.isIgnored(),\n internal: prop.isInternal(),\n alias: prop\n .getAlias()\n .filter(a => a !== alias)\n .concat(prop.name),\n title: prop.getTitle() || titleCase(prop.name),\n readonly: prop.isReadonly(),\n permission: prop.getPermission(),\n domain: prop.getDomain()\n }\n });\n });\n });\n\n return reflection;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"template-helpers.mjs","names":[],"sources":["../../src/helpers/template-helpers.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 { ReflectionClass } from \"@powerlines/deepkit/vendor/type\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { EnvPluginContext, EnvType } from \"../types/plugin\";\nimport { readEnvTypeReflection } from \"./persistence\";\n\n/**\n * Creates the reflection data used when generating runtime template files.\n *\n * @param context - The context for the configuration plugin.\n * @param name - The name of the configuration template.\n * @returns The reflection for the specified configuration template.\n */\nexport async function createTemplateReflection(\n context: EnvPluginContext,\n name?: EnvType\n): Promise<ReflectionClass<any>> {\n const reflection = await readEnvTypeReflection(context, name);\n\n reflection.getProperties().forEach(prop => {\n const aliases = prop.getAlias();\n aliases.filter(Boolean).forEach(alias => {\n reflection.addProperty({\n name: alias,\n optional: prop.isOptional() ? true : undefined,\n readonly: prop.isReadonly() ? true : undefined,\n description: prop.getDescription(),\n visibility: prop.getVisibility(),\n type: prop.getType(),\n default: prop.getDefaultValue(),\n tags: {\n hidden: prop.isHidden(),\n ignore: prop.isIgnored(),\n internal: prop.isInternal(),\n alias: prop\n .getAlias()\n .filter(a => a !== alias)\n .concat(prop.name),\n title: prop.getTitle() || titleCase(prop.name),\n readonly: prop.isReadonly(),\n permission: prop.getPermission(),\n domain: prop.getDomain()\n }\n });\n });\n });\n\n return reflection;\n}\n"],"mappings":";;;;;;AAIA,SAAM,aAAS,IAAW,MAAM;AAC5B,IAAA,SAAW;AACd,QAAS;;;;;;;;;;CA8BR,MAAA,aAAW,MAAgB,sBAAgB,SAAA,KAAA;AACzC,YAAM,eAAe,CAAA,QAAU,cAAA,SAAA;AAE7B,EADa,KAAS,UAAQ,CACpB,OAAC,QAAY,CAAA,QAAA,cAAA,UAAA;AACjB,cAAO,YAAA;IACH,MAAM;IACN,UAAO,KAAA,YAAoB,GAAE,OAAA;IACrC,UAAkB,KAAA,YAAgB,GAAA,OAAA;IAClC,aAAiB,KAAA,gBAAe;IAC1B,YAAc,KAAA,eAAA;IACZ,MAAM,KAAA,SAAA;IACR,SAAA,KAAA,iBAAA;IACE,MAAM;KACJ,QAAK,KAAU,UAAC;KACd,QAAK,KAAA,WAAY;KACpB,UAAA,KAAA,YAAA;KACJ,OAAS,KACG,UAAM,CACN,OAAK,cAAA,MAAA,MAAA,OAAA;MAAA;MAAA;MAAA;MAAA,CAAA,CAAA,CACR,OAAU,KAAI,KAAA;KAChB,OAAK,KAAA,UAAY,IAAA,UAAA,KAAA,KAAA;KACjB,UAAO,KAAA,YAAe;KACxB,YAAc,KAAC,eAAA;KACzB,QAAA,KAAA,WAAA;KACA;IACF,CAAA;KACF;GAAA;GAAA;GAAA;GAAA,CAAA,CAAA;;;;;;AAEF,QAAO"}
|
package/dist/types/index.cjs
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_types_runtime = require('./runtime.cjs');
|
|
3
|
+
const require_types_plugin = require('./plugin.cjs');
|
|
4
|
+
|
|
5
|
+
exports.__ΩEnvInterface = require_types_runtime.__ΩEnvInterface;
|
|
6
|
+
exports.__ΩEnvPluginContext = require_types_plugin.__ΩEnvPluginContext;
|
|
7
|
+
exports.__ΩEnvPluginOptions = require_types_plugin.__ΩEnvPluginOptions;
|
|
8
|
+
exports.__ΩEnvPluginResolvedConfig = require_types_plugin.__ΩEnvPluginResolvedConfig;
|
|
9
|
+
exports.__ΩEnvPluginUserConfig = require_types_plugin.__ΩEnvPluginUserConfig;
|
|
10
|
+
exports.__ΩEnvType = require_types_plugin.__ΩEnvType;
|
|
11
|
+
exports.__ΩSecretsInterface = require_types_runtime.__ΩSecretsInterface;
|
package/dist/types/index.mjs
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { __ΩEnvInterface, __ΩSecretsInterface } from "./runtime.mjs";
|
|
2
|
+
import { __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType } from "./plugin.mjs";
|
|
3
|
+
|
|
4
|
+
export { __ΩEnvInterface, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType, __ΩSecretsInterface };
|
package/dist/types/plugin.cjs
CHANGED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_types_runtime = require('./runtime.cjs');
|
|
4
|
+
let _powerlines_plugin_babel_types = require("@powerlines/plugin-babel/types");
|
|
5
|
+
let _powerlines_plugin_automd_types_plugin = require("@powerlines/plugin-automd/types/plugin");
|
|
6
|
+
let _powerlines_plugin_alloy_types = require("@powerlines/plugin-alloy/types");
|
|
7
|
+
let _powerlines_deepkit_types = require("@powerlines/deepkit/types");
|
|
8
|
+
|
|
9
|
+
//#region src/types/plugin.ts
|
|
10
|
+
const __ΩOmit = [
|
|
11
|
+
"T",
|
|
12
|
+
"K",
|
|
13
|
+
() => __ΩPick,
|
|
14
|
+
() => __ΩExclude,
|
|
15
|
+
"Omit",
|
|
16
|
+
"b!b\"e!!e!!ge!\"o$#o##w%y"
|
|
17
|
+
];
|
|
18
|
+
const __ΩRequired = [
|
|
19
|
+
"T",
|
|
20
|
+
"Required",
|
|
21
|
+
"l+e#!e\"!fRb!Pde\"!gN##w\"y"
|
|
22
|
+
];
|
|
23
|
+
const __ΩPick = [
|
|
24
|
+
"T",
|
|
25
|
+
"K",
|
|
26
|
+
"Pick",
|
|
27
|
+
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
28
|
+
];
|
|
29
|
+
const __ΩExclude = [
|
|
30
|
+
"T",
|
|
31
|
+
"U",
|
|
32
|
+
"Exclude",
|
|
33
|
+
"l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
|
|
34
|
+
];
|
|
35
|
+
const __ΩEnvType = [
|
|
36
|
+
"env",
|
|
37
|
+
"secrets",
|
|
38
|
+
"EnvType",
|
|
39
|
+
"P.!.\"Jw#y"
|
|
40
|
+
];
|
|
41
|
+
const __ΩEnvPluginOptions = [
|
|
42
|
+
() => __ΩOmit,
|
|
43
|
+
"types",
|
|
44
|
+
"types",
|
|
45
|
+
"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\"`.",
|
|
46
|
+
"secrets",
|
|
47
|
+
"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\"`.",
|
|
48
|
+
"prefix",
|
|
49
|
+
"An additional prefix (or list of additional prefixes) to apply to the environment variables",
|
|
50
|
+
"inject",
|
|
51
|
+
true,
|
|
52
|
+
"Should the plugin inject the env variables in the source code with their values?",
|
|
53
|
+
"validate",
|
|
54
|
+
"Should the plugin validate the loaded environment variables against the provided type definitions?",
|
|
55
|
+
"Children",
|
|
56
|
+
"defaultConfig",
|
|
57
|
+
"The default configuration to use when loading environment variables.",
|
|
58
|
+
() => _powerlines_plugin_babel_types.__ΩBabelPluginOptions,
|
|
59
|
+
"babel",
|
|
60
|
+
"Babel configuration options to use when injecting environment variables into the source code.",
|
|
61
|
+
() => _powerlines_plugin_automd_types_plugin.__ΩAutoMDPluginOptions,
|
|
62
|
+
"automd",
|
|
63
|
+
"AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.",
|
|
64
|
+
() => _powerlines_plugin_alloy_types.__ΩAlloyPluginOptions,
|
|
65
|
+
"alloy",
|
|
66
|
+
"Alloy configuration options to use when injecting environment variables into the source code.",
|
|
67
|
+
"EnvPluginOptions",
|
|
68
|
+
"P!.\"o!#P!4#8?$!4%8?&P&&FJ4'8?()4)8>*?+)4,8>*?-\"w.4/8?0n1428?3n4458?6n7488?9MKw:y"
|
|
69
|
+
];
|
|
70
|
+
const __ΩEnvPluginUserConfig = [
|
|
71
|
+
() => _powerlines_plugin_babel_types.__ΩBabelPluginUserConfig,
|
|
72
|
+
() => _powerlines_plugin_alloy_types.__ΩAlloyPluginUserConfig,
|
|
73
|
+
() => __ΩEnvPluginOptions,
|
|
74
|
+
"env",
|
|
75
|
+
"EnvPluginUserConfig",
|
|
76
|
+
"Pn!n\"Pn#4$MKw%y"
|
|
77
|
+
];
|
|
78
|
+
const __ΩEnvPluginResolvedConfig = [
|
|
79
|
+
() => _powerlines_plugin_babel_types.__ΩBabelPluginResolvedConfig,
|
|
80
|
+
() => _powerlines_plugin_alloy_types.__ΩAlloyPluginResolvedConfig,
|
|
81
|
+
() => __ΩRequired,
|
|
82
|
+
() => __ΩPick,
|
|
83
|
+
"additionalFiles",
|
|
84
|
+
() => __ΩRequired,
|
|
85
|
+
() => __ΩPick,
|
|
86
|
+
() => __ΩEnvPluginOptions,
|
|
87
|
+
"defaultConfig",
|
|
88
|
+
"types",
|
|
89
|
+
"The type definition for the expected env variable parameters",
|
|
90
|
+
"secrets",
|
|
91
|
+
"The type definition for the expected env secret parameters",
|
|
92
|
+
"inject",
|
|
93
|
+
"Should the plugin inject the env variables in the source code with their values?",
|
|
94
|
+
"validate",
|
|
95
|
+
"Should the plugin validate the loaded environment variables against the provided type definitions?",
|
|
96
|
+
"prefix",
|
|
97
|
+
"The prefix used for environment variables",
|
|
98
|
+
"env",
|
|
99
|
+
"EnvPluginResolvedConfig",
|
|
100
|
+
"Pn!n\"PP!.%o$#o#\"n(.)o'#o&\"P!4*?+!4,?-)4.?/)40?1&F42?3MK44MKw5y"
|
|
101
|
+
];
|
|
102
|
+
const __ΩEnvPluginContext = [
|
|
103
|
+
() => __ΩEnvPluginResolvedConfig,
|
|
104
|
+
"TResolvedConfig",
|
|
105
|
+
() => _powerlines_plugin_babel_types.__ΩBabelPluginContext,
|
|
106
|
+
() => _powerlines_plugin_alloy_types.__ΩAlloyPluginContext,
|
|
107
|
+
() => _powerlines_deepkit_types.__ΩReflection,
|
|
108
|
+
"env",
|
|
109
|
+
"The type definitions for the expected env variables",
|
|
110
|
+
() => _powerlines_deepkit_types.__ΩReflection,
|
|
111
|
+
"secrets",
|
|
112
|
+
"The type definitions for the expected env secrets",
|
|
113
|
+
"The type definitions reflection for the env variables and secrets",
|
|
114
|
+
"types",
|
|
115
|
+
() => _powerlines_deepkit_types.__ΩReflection,
|
|
116
|
+
() => require_types_runtime.__ΩEnvInterface,
|
|
117
|
+
"The current env variables reflection",
|
|
118
|
+
() => _powerlines_deepkit_types.__ΩReflection,
|
|
119
|
+
() => require_types_runtime.__ΩSecretsInterface,
|
|
120
|
+
"The current env secrets reflection",
|
|
121
|
+
"The current **used** environment variables and secrets reflection",
|
|
122
|
+
"used",
|
|
123
|
+
"parsed",
|
|
124
|
+
"The parsed .env configuration object",
|
|
125
|
+
() => _powerlines_deepkit_types.__ΩReflection,
|
|
126
|
+
"injected",
|
|
127
|
+
"The injected environment variables and secrets reflection",
|
|
128
|
+
"EnvPluginContext",
|
|
129
|
+
"n!c\"Pe\"!o#\"e\"!o$\"PPn%4&?'n(4)?*M?+4,?+Pn.o-\"4&?/n1o0\"4)?2M?344?3!45?6n748?9M4&Mw:y"
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
//#endregion
|
|
133
|
+
exports.__ΩEnvPluginContext = __ΩEnvPluginContext;
|
|
134
|
+
exports.__ΩEnvPluginOptions = __ΩEnvPluginOptions;
|
|
135
|
+
exports.__ΩEnvPluginResolvedConfig = __ΩEnvPluginResolvedConfig;
|
|
136
|
+
exports.__ΩEnvPluginUserConfig = __ΩEnvPluginUserConfig;
|
|
137
|
+
exports.__ΩEnvType = __ΩEnvType;
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { EnvInterface, SecretsInterface } from "./runtime.mjs";
|
|
2
|
+
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types";
|
|
3
|
+
import { AutoMDPluginOptions } from "@powerlines/plugin-automd/types/plugin";
|
|
4
|
+
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "@powerlines/plugin-alloy/types";
|
|
5
|
+
import { Reflection } from "@powerlines/deepkit/types";
|
|
2
6
|
import { DotenvParseOutput } from "@stryke/env/types";
|
|
3
7
|
import { Children } from "@alloy-js/core";
|
|
4
|
-
import { Reflection } from "@powerlines/deepkit/types";
|
|
5
|
-
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "@powerlines/plugin-alloy/types";
|
|
6
|
-
import { AutoMDPluginOptions } from "@powerlines/plugin-automd/types/plugin";
|
|
7
|
-
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types";
|
|
8
8
|
import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
9
9
|
|
|
10
10
|
//#region src/types/plugin.d.ts
|