@powerlines/plugin-env 0.15.144 → 0.15.145
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel/index.d.cts +3 -3
- package/dist/babel/index.d.mts +3 -3
- package/dist/babel/plugin.d.cts +3 -3
- package/dist/babel/plugin.d.mts +3 -3
- package/dist/components/docs.cjs +1 -8
- package/dist/components/docs.d.cts +1 -1
- package/dist/components/docs.d.mts +1 -1
- package/dist/components/docs.mjs +1 -8
- package/dist/components/env.cjs +1 -3
- package/dist/components/env.d.cts +1 -1
- package/dist/components/env.d.mts +1 -1
- package/dist/components/env.mjs +1 -3
- package/dist/components/index.cjs +2 -4
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -4
- package/dist/create-reflection-resource-3svZm2rY.d.cts +14 -0
- package/dist/create-reflection-resource-3svZm2rY.d.cts.map +1 -0
- package/dist/create-reflection-resource-CCpA76Yq.d.mts +14 -0
- package/dist/create-reflection-resource-CCpA76Yq.d.mts.map +1 -0
- package/dist/create-reflection-resource-D0QrD1Td.mjs +23 -0
- package/dist/create-reflection-resource-D0QrD1Td.mjs.map +1 -0
- package/dist/create-reflection-resource-d2zdTyOE.cjs +27 -0
- package/dist/{docs-DbRoWmL_.mjs → docs-B4Bd2HuK.mjs} +8 -11
- package/dist/docs-B4Bd2HuK.mjs.map +1 -0
- package/dist/{docs-B0d8pdIg.d.mts → docs-BAKwE4PJ.d.cts} +3 -1
- package/dist/docs-BAKwE4PJ.d.cts.map +1 -0
- package/dist/{docs-DMfzQuvP.d.cts → docs-CVf-w8oz.d.mts} +3 -1
- package/dist/docs-CVf-w8oz.d.mts.map +1 -0
- package/dist/{docs-B-SDRHeg.cjs → docs-ClXTdyjQ.cjs} +6 -9
- package/dist/{env-R63eR4RP.cjs → env-CCdAU0So.cjs} +13 -17
- package/dist/{env-D9oCn-AS.mjs → env-CNxmjHTB.mjs} +15 -19
- package/dist/env-CNxmjHTB.mjs.map +1 -0
- package/dist/{env-BIyd8CTA.d.cts → env-D0KBPuAd.d.mts} +3 -1
- package/dist/env-D0KBPuAd.d.mts.map +1 -0
- package/dist/{env-BKmI7DyR.d.mts → env-DwM7pJm7.d.cts} +3 -1
- package/dist/env-DwM7pJm7.d.cts.map +1 -0
- package/dist/helpers/create-reflection-resource.cjs +2 -9
- package/dist/helpers/create-reflection-resource.d.cts +2 -2
- package/dist/helpers/create-reflection-resource.d.mts +2 -2
- package/dist/helpers/create-reflection-resource.mjs +2 -9
- package/dist/helpers/index.cjs +2 -2
- package/dist/helpers/index.d.cts +2 -2
- package/dist/helpers/index.d.mts +2 -2
- package/dist/helpers/index.mjs +2 -2
- package/dist/index-Bdi8CvaN.d.cts.map +1 -1
- package/dist/index-Drhzdkqe.d.mts.map +1 -1
- package/dist/index.cjs +16 -8
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +16 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/dist/create-reflection-resource-B3friIs9.mjs +0 -98
- package/dist/create-reflection-resource-B3friIs9.mjs.map +0 -1
- package/dist/create-reflection-resource-BJj83ii4.cjs +0 -103
- package/dist/create-reflection-resource-DSLbLsX2.d.cts +0 -16
- package/dist/create-reflection-resource-DSLbLsX2.d.cts.map +0 -1
- package/dist/create-reflection-resource-DwWJAo-G.d.mts +0 -16
- package/dist/create-reflection-resource-DwWJAo-G.d.mts.map +0 -1
- package/dist/docs-B0d8pdIg.d.mts.map +0 -1
- package/dist/docs-DMfzQuvP.d.cts.map +0 -1
- package/dist/docs-DbRoWmL_.mjs.map +0 -1
- package/dist/env-BIyd8CTA.d.cts.map +0 -1
- package/dist/env-BKmI7DyR.d.mts.map +0 -1
- package/dist/env-D9oCn-AS.mjs.map +0 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["ReflectionClass","ReflectionKind","alloy","automd","babel","parseTypeDefinition","toArray","ENV_PREFIXES","existsSync","isParentPath","joinPaths","constantCase","defu","envBabelPlugin","EnvDocsFile","EnvBuiltin","env","getDocsOutputPath","loadEnv","getEnvDefaultTypeDefinition","getEnvReflectionsPath","getEnvTypeReflectionsPath","getSecretsDefaultTypeDefinition","readEnvReflection","readEnvTypeReflection","readSecretsReflection","writeEnvReflection","writeEnvTypeReflection","reflectEnv","reflectSecrets","plugin","options","name","config","debug","types","prefix","transform","plugins","warn","envDefaultTypeDefinition","file","secrets","secretsDefaultTypeDefinition","reduce","ret","formattedPrefix","includes","push","framework","filter","Boolean","replace","configResolved","parsed","used","injected","command","skipCache","persistedMeta","checksum","meta","workspaceConfig","workspaceRoot","projectRoot","undefined","Error","getProperties","length","envWithAlias","prop","getAlias","Object","entries","forEach","key","value","unprefixedKey","startsWith","slice","aliasKey","find","reverse","hasProperty","getProperty","setDefaultValue","kind","objectLiteral","typeName","description","prepare","_self$","render","_$createComponent","defaultConfig","order","handler","trace","docs","levelOffset","buildEnd","reflectionPath","generators","vite","envPrefix"],"sources":["../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/parse-type-definition.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/to-array.mjs","../src/index.tsx"],"sourcesContent":["//#region ../type-checks/src/get-object-tag.ts\n/**\n* Gets the `toStringTag` of `obj`.\n*\n* @param value - The obj to query.\n* @returns Returns the `toStringTag`.\n*/\nconst getObjectTag = (value) => {\n\tif (value == null) return value === void 0 ? \"[object Undefined]\" : \"[object Null]\";\n\treturn Object.prototype.toString.call(value);\n};\n\n//#endregion\nexport { getObjectTag };\n//# sourceMappingURL=get-object-tag.mjs.map","import { getObjectTag } from \"./get-object-tag.mjs\";\n\n//#region ../type-checks/src/is-plain-object.ts\n/**\n* Checks if `value` is object-like. A value is object-like if it's not `null`\n* and has a `typeof` result of \"object\".\n*\n* @example\n* ```typescript\n* isObjectLike({})\n* // => true\n*\n* isObjectLike([1, 2, 3])\n* // => true\n*\n* isObjectLike(Function)\n* // => false\n*\n* isObjectLike(null)\n* // => false\n* ```\n*\n* @param value - The value to check.\n* @returns Returns `true` if `value` is object-like, else `false`.\n*/\nconst isObjectLike = (obj) => {\n\treturn typeof obj === \"object\" && obj !== null;\n};\n/**\n* Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.\n*\n* @example\n* ```typescript\n* function Foo() {\n* this.a = 1\n* }\n*\n* isPlainObject(new Foo)\n* // => false\n*\n* isPlainObject([1, 2, 3])\n* // => false\n*\n* isPlainObject({ 'x': 0, 'y': 0 })\n* // => true\n*\n* isPlainObject(Object.create(null))\n* // => true\n* ```\n*\n* @param obj - The value to check.\n* @returns Returns `true` if `obj` is a plain object, else `false`.\n*/\nconst isPlainObject = (obj) => {\n\tif (!isObjectLike(obj) || getObjectTag(obj) !== \"[object Object]\") return false;\n\tif (Object.getPrototypeOf(obj) === null) return true;\n\tlet proto = obj;\n\twhile (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);\n\treturn Object.getPrototypeOf(obj) === proto;\n};\n\n//#endregion\nexport { isObjectLike, isPlainObject };\n//# sourceMappingURL=is-plain-object.mjs.map","import { isPlainObject } from \"./is-plain-object.mjs\";\n\n//#region ../type-checks/src/is-object.ts\n/**\n* Check if the provided value's type is `Object`\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `Object`\n*/\nconst isObject = (value) => {\n\ttry {\n\t\treturn typeof value === \"object\" || Boolean(value) && value?.constructor === Object || isPlainObject(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map","//#region ../type-checks/src/is-string.ts\nconst isString = (value) => {\n\ttry {\n\t\treturn typeof value === \"string\";\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isString };\n//# sourceMappingURL=is-string.mjs.map","//#region ../type-checks/src/is-buffer.ts\nconst isBufferExists = typeof Buffer !== \"undefined\";\n/**\n* Check if the provided value's type is `Buffer`\n*/\nconst isBuffer = isBufferExists ? Buffer.isBuffer.bind(Buffer) : function isBuffer$1(value) {\n\treturn false;\n};\n\n//#endregion\nexport { isBufferExists };\n//# sourceMappingURL=is-buffer.mjs.map","import \"./is-buffer.mjs\";\n\n//#region ../type-checks/src/type-detect.ts\nconst globalObject = ((Obj) => {\n\tif (typeof globalThis === \"object\") return globalThis;\n\tObject.defineProperty(Obj, \"typeDetectGlobalObject\", {\n\t\tget() {\n\t\t\treturn this;\n\t\t},\n\t\tconfigurable: true\n\t});\n\treturn globalThis;\n})(Object.prototype);\n\n//#endregion\nexport { };\n//# sourceMappingURL=type-detect.mjs.map","import { isObject } from \"./type-checks/src/is-object.mjs\";\nimport { isString } from \"./type-checks/src/is-string.mjs\";\nimport \"./type-checks/src/index.mjs\";\n\n//#region src/parse-type-definition.ts\n/**\n* Parse a type definition parameter into a {@link TypeDefinition} object\n*\n* @param param - The parameter to parse\n* @returns The parsed type definition\n*/\nconst parseTypeDefinition = (param) => {\n\tif (isString(param)) {\n\t\tif (param.includes(\":\")) {\n\t\t\tconst params = param.split(\":\");\n\t\t\tif (params.length > 1 && params[0]) return {\n\t\t\t\tfile: params[0],\n\t\t\t\tname: params[1]\n\t\t\t};\n\t\t}\n\t\tif (param.includes(\"#\")) {\n\t\t\tconst params = param.split(\"#\");\n\t\t\tif (params.length > 1 && params[0]) return {\n\t\t\t\tfile: params[0],\n\t\t\t\tname: params[1]\n\t\t\t};\n\t\t}\n\t\treturn { file: param };\n\t}\n\tif (isObject(param)) return {\n\t\tfile: param.file,\n\t\tname: param.name\n\t};\n};\n\n//#endregion\nexport { parseTypeDefinition };\n//# sourceMappingURL=parse-type-definition.mjs.map","//#region src/to-array.ts\n/**\n* Convert `Arrayable<T>` to `Array<T>`\n*\n* @param array - The `Arrayable<T>` to convert\n* @returns An `Array<T>` containing the elements of the input\n*/\nfunction toArray(array) {\n\tarray = array ?? [];\n\treturn Array.isArray(array) ? array : [array];\n}\n\n//#endregion\nexport { toArray };\n//# sourceMappingURL=to-array.mjs.map","/* -------------------------------------------------------------------\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 {\n ReflectionClass,\n ReflectionKind\n} from \"@powerlines/deepkit/vendor/type\";\nimport alloy from \"@powerlines/plugin-alloy\";\nimport automd from \"@powerlines/plugin-automd\";\nimport babel from \"@powerlines/plugin-babel\";\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { ENV_PREFIXES } from \"@stryke/env/types\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport type { UserConfig as ViteUserConfig } from \"vite\";\nimport { envBabelPlugin } from \"./babel/plugin\";\nimport { EnvDocsFile } from \"./components/docs\";\nimport { EnvBuiltin } from \"./components/env\";\nimport { env } from \"./helpers/automd-generator\";\nimport { getDocsOutputPath } from \"./helpers/docs-helper\";\nimport { loadEnv } from \"./helpers/load\";\nimport {\n getEnvDefaultTypeDefinition,\n getEnvReflectionsPath,\n getEnvTypeReflectionsPath,\n getSecretsDefaultTypeDefinition,\n readEnvReflection,\n readEnvTypeReflection,\n readSecretsReflection,\n writeEnvReflection,\n writeEnvTypeReflection\n} from \"./helpers/persistence\";\nimport { reflectEnv, reflectSecrets } from \"./helpers/reflect\";\nimport { EnvPluginContext, EnvPluginOptions } from \"./types/plugin\";\n\nexport * from \"./babel\";\nexport * from \"./components\";\nexport * from \"./helpers\";\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to inject environment variables into the source code.\n */\nexport const plugin = <TContext extends EnvPluginContext = EnvPluginContext>(\n options: EnvPluginOptions = {}\n) => {\n return [\n alloy(options.alloy),\n babel(options.babel),\n {\n name: \"env\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `env` build plugin.\"\n );\n\n const config = {\n env: defu(options, {\n types: {} as TypeDefinitionParameter,\n prefix: []\n }),\n transform: {\n babel: {\n plugins: [envBabelPlugin]\n }\n }\n };\n\n if (config.env.types) {\n config.env.types = parseTypeDefinition(\n config.env.types\n ) as TypeDefinition;\n } else {\n this.warn(\n \"The `env.types` configuration parameter was not provided. Please ensure this is expected.\"\n );\n\n const envDefaultTypeDefinition =\n await getEnvDefaultTypeDefinition(this);\n config.env.types = parseTypeDefinition(\n `${envDefaultTypeDefinition.file}#${envDefaultTypeDefinition.name}`\n ) as TypeDefinition;\n }\n\n if (config.env.secrets) {\n config.env.secrets = parseTypeDefinition(\n config.env.secrets\n ) as TypeDefinition;\n } else {\n const secretsDefaultTypeDefinition =\n await getSecretsDefaultTypeDefinition(this);\n config.env.secrets = parseTypeDefinition(\n `${secretsDefaultTypeDefinition.file}#${\n secretsDefaultTypeDefinition.name\n }`\n ) as TypeDefinition;\n }\n\n config.env.prefix = toArray(\n (config.env.prefix ?? []) as string[]\n ).reduce(\n (ret: string[], prefix: string) => {\n const formattedPrefix = constantCase(prefix);\n if (!ret.includes(formattedPrefix)) {\n ret.push(formattedPrefix);\n }\n\n return ret;\n },\n [\n ...ENV_PREFIXES,\n \"POWERLINES_\",\n this.config.framework &&\n this.config.framework !== \"powerlines\" &&\n `${constantCase(this.config.framework)}_`\n ].filter(Boolean) as string[]\n );\n\n config.env.prefix = toArray(config.env.prefix).reduce((ret, prefix) => {\n if (!ret.includes(prefix.replace(/_$/g, \"\"))) {\n ret.push(prefix.replace(/_$/g, \"\"));\n }\n return ret;\n }, [] as string[]);\n\n return config;\n },\n async configResolved() {\n this.debug(\n `Environment plugin configuration has been resolved for the Powerlines project.`\n );\n\n this.env = defu(\n {\n parsed: await loadEnv(this, this.config.env)\n },\n this.env ?? {},\n {\n types: {\n env: {}\n },\n used: {\n env: {},\n secrets: {}\n },\n parsed: {},\n injected: {}\n }\n ) as EnvPluginContext[\"env\"];\n\n if (\n this.config.command !== \"prepare\" &&\n !this.config.skipCache &&\n this.persistedMeta?.checksum === this.meta.checksum &&\n existsSync(getEnvTypeReflectionsPath(this, \"env\"))\n ) {\n this.debug(\n `Skipping reflection initialization as the meta checksum has not changed.`\n );\n\n this.env.types.env = await readEnvTypeReflection(this, \"env\");\n\n if (existsSync(getEnvReflectionsPath(this, \"env\"))) {\n this.env.used.env = await readEnvReflection(this);\n }\n\n if (existsSync(getEnvTypeReflectionsPath(this, \"secrets\"))) {\n this.env.types.secrets = await readEnvTypeReflection(\n this,\n \"secrets\"\n );\n }\n\n if (existsSync(getEnvReflectionsPath(this, \"secrets\"))) {\n this.env.used.secrets = await readSecretsReflection(this);\n }\n } else {\n this.debug(\n `Starting environment configuration reflection initialization.`\n );\n\n this.env.types.env = await reflectEnv(\n this,\n this.config.env.types?.file\n ? isParentPath(\n this.config.env.types?.file,\n this.workspaceConfig.workspaceRoot\n )\n ? this.config.env.types?.file\n : joinPaths(\n this.config.projectRoot,\n this.config.env.types?.file\n )\n : undefined,\n this.config.env.types?.name\n );\n if (!this.env.types.env) {\n throw new Error(\n \"Failed to find the environment configuration type reflection in the context.\"\n );\n }\n\n await writeEnvTypeReflection(this, this.env.types.env, \"env\");\n\n this.env.types.secrets = await reflectSecrets(\n this,\n this.config.env.secrets?.file\n ? isParentPath(\n this.config.env.secrets?.file,\n this.workspaceConfig.workspaceRoot\n )\n ? this.config.env.secrets?.file\n : joinPaths(\n this.config.projectRoot,\n this.config.env.secrets?.file\n )\n : undefined,\n this.config.env.secrets?.name\n );\n if (!this.env.types.secrets) {\n throw new Error(\n \"Failed to find the secrets configuration type reflection in the context.\"\n );\n }\n\n await writeEnvTypeReflection(this, this.env.types.secrets, \"secrets\");\n\n this.debug(\n `Resolved ${\n this.env.types.env.getProperties().length ?? 0\n } environment configuration parameters and ${\n this.env.types.secrets?.getProperties().length ?? 0\n } secret configuration parameters`\n );\n\n const envWithAlias = this.env.types.env\n .getProperties()\n .filter(prop => prop.getAlias().length > 0);\n\n Object.entries(await loadEnv(this, this.config.env)).forEach(\n ([key, value]) => {\n const unprefixedKey = this.config.env.prefix.reduce(\n (ret, prefix) => {\n if (key.replace(/_$/g, \"\").startsWith(prefix)) {\n return key.replace(/_$/g, \"\").slice(prefix.length);\n }\n return ret;\n },\n key\n );\n\n const aliasKey = envWithAlias.find(prop =>\n prop?.getAlias().reverse().includes(unprefixedKey)\n );\n if (this.env.types.env?.hasProperty(unprefixedKey) || aliasKey) {\n this.env.types.env\n .getProperty(unprefixedKey)\n .setDefaultValue(value);\n }\n }\n );\n\n this.env.used.env = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `An object containing the environment configuration parameters used by the ${\n this.config.name\n ? `${this.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n this.env.types.env\n );\n\n await writeEnvReflection(this, this.env.used.env, \"env\");\n\n if (this.env.types.secrets) {\n await writeEnvTypeReflection(\n this,\n this.env.types.secrets,\n \"secrets\"\n );\n\n this.env.used.secrets = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `An object containing the secret configuration parameters used by the ${\n this.config.name\n ? `${this.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n this.env.types.secrets\n );\n await writeEnvReflection(this, this.env.used.secrets, \"secrets\");\n }\n }\n },\n async prepare() {\n this.debug(\n `Preparing the Environment runtime artifacts for the Powerlines project.`\n );\n\n await this.render(\n <EnvBuiltin defaultConfig={this.config.env.defaultConfig} />\n );\n },\n transform: {\n order: \"post\",\n async handler() {\n if (this.env.used.env.getProperties().length > 0) {\n this.trace(\n `Persisting used environment configuration reflections to ${getEnvReflectionsPath(\n this,\n \"env\"\n )}.`\n );\n await writeEnvReflection(this, this.env.used.env, \"env\");\n }\n\n if (this.env.used.secrets.getProperties().length > 0) {\n this.trace(\n `Persisting used secret configuration reflections to ${getEnvReflectionsPath(\n this,\n \"secrets\"\n )}.`\n );\n await writeEnvReflection(this, this.env.used.secrets, \"secrets\");\n }\n }\n },\n async docs() {\n this.debug(\n `Documenting environment variables configuration values in \"${joinPaths(\n getDocsOutputPath(this),\n \"env.md\"\n )}\"`\n );\n\n await this.render(<EnvDocsFile levelOffset={0} />);\n },\n async buildEnd() {\n const reflectionPath = getEnvReflectionsPath(this, \"env\");\n\n this.debug(`Writing env reflection types to ${reflectionPath}.`);\n\n await writeEnvReflection(this, this.env.used.env, \"env\");\n }\n },\n {\n name: \"env:automd-generator\",\n config() {\n return {\n automd: defu(options.automd ?? {}, {\n generators: {\n env: env(this)\n }\n })\n };\n }\n },\n {\n name: \"env:vite\",\n vite: {\n configResolved(this: TContext) {\n return {\n envPrefix: this.config?.env?.prefix\n } as ViteUserConfig;\n }\n }\n },\n automd(options.automd)\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,gBAAgB,UAAU;AAC/B,KAAI,SAAS,KAAM,QAAO,UAAU,KAAK,IAAI,uBAAuB;AACpE,QAAO,OAAO,UAAU,SAAS,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;ACgB7C,MAAM,gBAAgB,QAAQ;AAC7B,QAAO,OAAO,QAAQ,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2B3C,MAAM,iBAAiB,QAAQ;AAC9B,KAAI,CAAC,aAAa,IAAI,IAAI,aAAa,IAAI,KAAK,kBAAmB,QAAO;AAC1E,KAAI,OAAO,eAAe,IAAI,KAAK,KAAM,QAAO;CAChD,IAAI,QAAQ;AACZ,QAAO,OAAO,eAAe,MAAM,KAAK,KAAM,SAAQ,OAAO,eAAe,MAAM;AAClF,QAAO,OAAO,eAAe,IAAI,KAAK;;;;;;;;;;;ACjDvC,MAAM,YAAY,UAAU;AAC3B,KAAI;AACH,SAAO,OAAO,UAAU,YAAY,QAAQ,MAAM,IAAI,OAAO,gBAAgB,UAAU,cAAc,MAAM;SACpG;AACP,SAAO;;;;;;ACZT,MAAM,YAAY,UAAU;AAC3B,KAAI;AACH,SAAO,OAAO,UAAU;SACjB;AACP,SAAO;;;;;;ACJT,MAAM,iBAAiB,OAAO,WAAW;AAIxB,kBAAiB,OAAO,SAAS,KAAK,OAAO;;;;ECFvC,QAAQ;AAC9B,KAAI,OAAO,eAAe,SAAU,QAAO;AAC3C,QAAO,eAAe,KAAK,0BAA0B;EACpD,MAAM;AACL,UAAO;;EAER,cAAc;EACd,CAAC;AACF,QAAO;GACL,OAAO,UAAU;;;;;;;;;;ACDpB,MAAM,uBAAuB,UAAU;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ACqF,aAAa,GAAC,CAAI,CAAC;;GAEpD,MAAMC,WAAW;IACf,MAAMC,iBAAiBjF,sBAAsB,MAAM,MAAM;AAEzD,SAAKc,MAAM,mCAAmCmE,eAAc,GAAI;AAEhE,UAAM3E,mBAAmB,MAAM,KAAKV,IAAIuC,KAAKvC,KAAK,MAAM;;GAE3D;EACD;GACEgB,MAAM;GACNC,SAAS;AACP,WAAO,EACL9B,QAAQS,KAAKmB,QAAQ5B,UAAU,EAAE,EAAE,EACjCmG,YAAY,EACVtF,KAAKA,IAAI,KAAI,EACf,EACD,CAAA,EACF;;GAEJ;EACD;GACEgB,MAAM;GACNuE,MAAM,EACJlD,iBAA+B;AAC7B,WAAO,EACLmD,WAAW,KAAKvE,QAAQjB,KAAKoB,QAC9B;MAEL;GACD;EACDjC,OAAO4B,QAAQ5B,OAAO;EACvB;;AAGH,kBAAe2B"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["ReflectionClass","ReflectionKind","alloy","automd","babel","parseTypeDefinition","toArray","ENV_PREFIXES","existsSync","isParentPath","joinPaths","constantCase","defu","envBabelPlugin","EnvDocsFile","EnvBuiltin","env","getDocsOutputPath","loadEnv","getEnvDefaultTypeDefinition","getEnvReflectionsPath","getEnvTypeReflectionsPath","getSecretsDefaultTypeDefinition","readEnvReflection","readEnvTypeReflection","readSecretsReflection","writeEnvReflection","writeEnvTypeReflection","reflectEnv","reflectSecrets","plugin","options","name","config","debug","types","prefix","transform","plugins","warn","envDefaultTypeDefinition","file","secrets","secretsDefaultTypeDefinition","reduce","ret","formattedPrefix","includes","push","framework","filter","Boolean","replace","configResolved","parsed","used","injected","command","skipCache","persistedMeta","checksum","meta","workspaceConfig","workspaceRoot","projectRoot","undefined","Error","getProperties","length","envWithAlias","prop","getAlias","Object","entries","forEach","key","value","unprefixedKey","startsWith","slice","aliasKey","find","reverse","hasProperty","getProperty","setDefaultValue","kind","objectLiteral","typeName","description","prepare","_self$","result","render","_$createComponent","defaultConfig","reflection","order","handler","trace","docs","levelOffset","buildEnd","reflectionPath","generators","vite","envPrefix"],"sources":["../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/parse-type-definition.mjs","../../../node_modules/.pnpm/@stryke+convert@0.6.37/node_modules/@stryke/convert/dist/to-array.mjs","../src/index.tsx"],"sourcesContent":["//#region ../type-checks/src/get-object-tag.ts\n/**\n* Gets the `toStringTag` of `obj`.\n*\n* @param value - The obj to query.\n* @returns Returns the `toStringTag`.\n*/\nconst getObjectTag = (value) => {\n\tif (value == null) return value === void 0 ? \"[object Undefined]\" : \"[object Null]\";\n\treturn Object.prototype.toString.call(value);\n};\n\n//#endregion\nexport { getObjectTag };\n//# sourceMappingURL=get-object-tag.mjs.map","import { getObjectTag } from \"./get-object-tag.mjs\";\n\n//#region ../type-checks/src/is-plain-object.ts\n/**\n* Checks if `value` is object-like. A value is object-like if it's not `null`\n* and has a `typeof` result of \"object\".\n*\n* @example\n* ```typescript\n* isObjectLike({})\n* // => true\n*\n* isObjectLike([1, 2, 3])\n* // => true\n*\n* isObjectLike(Function)\n* // => false\n*\n* isObjectLike(null)\n* // => false\n* ```\n*\n* @param value - The value to check.\n* @returns Returns `true` if `value` is object-like, else `false`.\n*/\nconst isObjectLike = (obj) => {\n\treturn typeof obj === \"object\" && obj !== null;\n};\n/**\n* Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.\n*\n* @example\n* ```typescript\n* function Foo() {\n* this.a = 1\n* }\n*\n* isPlainObject(new Foo)\n* // => false\n*\n* isPlainObject([1, 2, 3])\n* // => false\n*\n* isPlainObject({ 'x': 0, 'y': 0 })\n* // => true\n*\n* isPlainObject(Object.create(null))\n* // => true\n* ```\n*\n* @param obj - The value to check.\n* @returns Returns `true` if `obj` is a plain object, else `false`.\n*/\nconst isPlainObject = (obj) => {\n\tif (!isObjectLike(obj) || getObjectTag(obj) !== \"[object Object]\") return false;\n\tif (Object.getPrototypeOf(obj) === null) return true;\n\tlet proto = obj;\n\twhile (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);\n\treturn Object.getPrototypeOf(obj) === proto;\n};\n\n//#endregion\nexport { isObjectLike, isPlainObject };\n//# sourceMappingURL=is-plain-object.mjs.map","import { isPlainObject } from \"./is-plain-object.mjs\";\n\n//#region ../type-checks/src/is-object.ts\n/**\n* Check if the provided value's type is `Object`\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `Object`\n*/\nconst isObject = (value) => {\n\ttry {\n\t\treturn typeof value === \"object\" || Boolean(value) && value?.constructor === Object || isPlainObject(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map","//#region ../type-checks/src/is-string.ts\nconst isString = (value) => {\n\ttry {\n\t\treturn typeof value === \"string\";\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isString };\n//# sourceMappingURL=is-string.mjs.map","//#region ../type-checks/src/is-buffer.ts\nconst isBufferExists = typeof Buffer !== \"undefined\";\n/**\n* Check if the provided value's type is `Buffer`\n*/\nconst isBuffer = isBufferExists ? Buffer.isBuffer.bind(Buffer) : function isBuffer$1(value) {\n\treturn false;\n};\n\n//#endregion\nexport { isBufferExists };\n//# sourceMappingURL=is-buffer.mjs.map","import \"./is-buffer.mjs\";\n\n//#region ../type-checks/src/type-detect.ts\nconst globalObject = ((Obj) => {\n\tif (typeof globalThis === \"object\") return globalThis;\n\tObject.defineProperty(Obj, \"typeDetectGlobalObject\", {\n\t\tget() {\n\t\t\treturn this;\n\t\t},\n\t\tconfigurable: true\n\t});\n\treturn globalThis;\n})(Object.prototype);\n\n//#endregion\nexport { };\n//# sourceMappingURL=type-detect.mjs.map","import { isObject } from \"./type-checks/src/is-object.mjs\";\nimport { isString } from \"./type-checks/src/is-string.mjs\";\nimport \"./type-checks/src/index.mjs\";\n\n//#region src/parse-type-definition.ts\n/**\n* Parse a type definition parameter into a {@link TypeDefinition} object\n*\n* @param param - The parameter to parse\n* @returns The parsed type definition\n*/\nconst parseTypeDefinition = (param) => {\n\tif (isString(param)) {\n\t\tif (param.includes(\":\")) {\n\t\t\tconst params = param.split(\":\");\n\t\t\tif (params.length > 1 && params[0]) return {\n\t\t\t\tfile: params[0],\n\t\t\t\tname: params[1]\n\t\t\t};\n\t\t}\n\t\tif (param.includes(\"#\")) {\n\t\t\tconst params = param.split(\"#\");\n\t\t\tif (params.length > 1 && params[0]) return {\n\t\t\t\tfile: params[0],\n\t\t\t\tname: params[1]\n\t\t\t};\n\t\t}\n\t\treturn { file: param };\n\t}\n\tif (isObject(param)) return {\n\t\tfile: param.file,\n\t\tname: param.name\n\t};\n};\n\n//#endregion\nexport { parseTypeDefinition };\n//# sourceMappingURL=parse-type-definition.mjs.map","//#region src/to-array.ts\n/**\n* Convert `Arrayable<T>` to `Array<T>`\n*\n* @param array - The `Arrayable<T>` to convert\n* @returns An `Array<T>` containing the elements of the input\n*/\nfunction toArray(array) {\n\tarray = array ?? [];\n\treturn Array.isArray(array) ? array : [array];\n}\n\n//#endregion\nexport { toArray };\n//# sourceMappingURL=to-array.mjs.map","/* -------------------------------------------------------------------\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 {\n ReflectionClass,\n ReflectionKind\n} from \"@powerlines/deepkit/vendor/type\";\nimport alloy from \"@powerlines/plugin-alloy\";\nimport automd from \"@powerlines/plugin-automd\";\nimport babel from \"@powerlines/plugin-babel\";\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { ENV_PREFIXES } from \"@stryke/env/types\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport type { UserConfig as ViteUserConfig } from \"vite\";\nimport { envBabelPlugin } from \"./babel/plugin\";\nimport { EnvDocsFile } from \"./components/docs\";\nimport { EnvBuiltin } from \"./components/env\";\nimport { env } from \"./helpers/automd-generator\";\nimport { getDocsOutputPath } from \"./helpers/docs-helper\";\nimport { loadEnv } from \"./helpers/load\";\nimport {\n getEnvDefaultTypeDefinition,\n getEnvReflectionsPath,\n getEnvTypeReflectionsPath,\n getSecretsDefaultTypeDefinition,\n readEnvReflection,\n readEnvTypeReflection,\n readSecretsReflection,\n writeEnvReflection,\n writeEnvTypeReflection\n} from \"./helpers/persistence\";\nimport { reflectEnv, reflectSecrets } from \"./helpers/reflect\";\nimport { EnvPluginContext, EnvPluginOptions } from \"./types/plugin\";\n\nexport * from \"./babel\";\nexport * from \"./components\";\nexport * from \"./helpers\";\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to inject environment variables into the source code.\n */\nexport const plugin = <TContext extends EnvPluginContext = EnvPluginContext>(\n options: EnvPluginOptions = {}\n) => {\n return [\n alloy(options.alloy),\n babel(options.babel),\n {\n name: \"env\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `env` build plugin.\"\n );\n\n const config = {\n env: defu(options, {\n types: {} as TypeDefinitionParameter,\n prefix: []\n }),\n transform: {\n babel: {\n plugins: [envBabelPlugin]\n }\n }\n };\n\n if (config.env.types) {\n config.env.types = parseTypeDefinition(\n config.env.types\n ) as TypeDefinition;\n } else {\n this.warn(\n \"The `env.types` configuration parameter was not provided. Please ensure this is expected.\"\n );\n\n const envDefaultTypeDefinition =\n await getEnvDefaultTypeDefinition(this);\n config.env.types = parseTypeDefinition(\n `${envDefaultTypeDefinition.file}#${envDefaultTypeDefinition.name}`\n ) as TypeDefinition;\n }\n\n if (config.env.secrets) {\n config.env.secrets = parseTypeDefinition(\n config.env.secrets\n ) as TypeDefinition;\n } else {\n const secretsDefaultTypeDefinition =\n await getSecretsDefaultTypeDefinition(this);\n config.env.secrets = parseTypeDefinition(\n `${secretsDefaultTypeDefinition.file}#${\n secretsDefaultTypeDefinition.name\n }`\n ) as TypeDefinition;\n }\n\n config.env.prefix = toArray(\n (config.env.prefix ?? []) as string[]\n ).reduce(\n (ret: string[], prefix: string) => {\n const formattedPrefix = constantCase(prefix);\n if (!ret.includes(formattedPrefix)) {\n ret.push(formattedPrefix);\n }\n\n return ret;\n },\n [\n ...ENV_PREFIXES,\n \"POWERLINES_\",\n this.config.framework &&\n this.config.framework !== \"powerlines\" &&\n `${constantCase(this.config.framework)}_`\n ].filter(Boolean) as string[]\n );\n\n config.env.prefix = toArray(config.env.prefix).reduce((ret, prefix) => {\n if (!ret.includes(prefix.replace(/_$/g, \"\"))) {\n ret.push(prefix.replace(/_$/g, \"\"));\n }\n return ret;\n }, [] as string[]);\n\n return config;\n },\n async configResolved() {\n this.debug(\n `Environment plugin configuration has been resolved for the Powerlines project.`\n );\n\n this.env = defu(\n {\n parsed: await loadEnv(this, this.config.env)\n },\n this.env ?? {},\n {\n types: {\n env: {}\n },\n used: {\n env: {},\n secrets: {}\n },\n parsed: {},\n injected: {}\n }\n ) as EnvPluginContext[\"env\"];\n\n if (\n this.config.command !== \"prepare\" &&\n !this.config.skipCache &&\n this.persistedMeta?.checksum === this.meta.checksum &&\n existsSync(getEnvTypeReflectionsPath(this, \"env\"))\n ) {\n this.debug(\n `Skipping reflection initialization as the meta checksum has not changed.`\n );\n\n this.env.types.env = await readEnvTypeReflection(this, \"env\");\n\n if (existsSync(getEnvReflectionsPath(this, \"env\"))) {\n this.env.used.env = await readEnvReflection(this);\n }\n\n if (existsSync(getEnvTypeReflectionsPath(this, \"secrets\"))) {\n this.env.types.secrets = await readEnvTypeReflection(\n this,\n \"secrets\"\n );\n }\n\n if (existsSync(getEnvReflectionsPath(this, \"secrets\"))) {\n this.env.used.secrets = await readSecretsReflection(this);\n }\n } else {\n this.debug(\n `Starting environment configuration reflection initialization.`\n );\n\n this.env.types.env = await reflectEnv(\n this,\n this.config.env.types?.file\n ? isParentPath(\n this.config.env.types?.file,\n this.workspaceConfig.workspaceRoot\n )\n ? this.config.env.types?.file\n : joinPaths(\n this.config.projectRoot,\n this.config.env.types?.file\n )\n : undefined,\n this.config.env.types?.name\n );\n if (!this.env.types.env) {\n throw new Error(\n \"Failed to find the environment configuration type reflection in the context.\"\n );\n }\n\n await writeEnvTypeReflection(this, this.env.types.env, \"env\");\n\n this.env.types.secrets = await reflectSecrets(\n this,\n this.config.env.secrets?.file\n ? isParentPath(\n this.config.env.secrets?.file,\n this.workspaceConfig.workspaceRoot\n )\n ? this.config.env.secrets?.file\n : joinPaths(\n this.config.projectRoot,\n this.config.env.secrets?.file\n )\n : undefined,\n this.config.env.secrets?.name\n );\n if (!this.env.types.secrets) {\n throw new Error(\n \"Failed to find the secrets configuration type reflection in the context.\"\n );\n }\n\n await writeEnvTypeReflection(this, this.env.types.secrets, \"secrets\");\n\n this.debug(\n `Resolved ${\n this.env.types.env.getProperties().length ?? 0\n } environment configuration parameters and ${\n this.env.types.secrets?.getProperties().length ?? 0\n } secret configuration parameters`\n );\n\n const envWithAlias = this.env.types.env\n .getProperties()\n .filter(prop => prop.getAlias().length > 0);\n\n Object.entries(await loadEnv(this, this.config.env)).forEach(\n ([key, value]) => {\n const unprefixedKey = this.config.env.prefix.reduce(\n (ret, prefix) => {\n if (key.replace(/_$/g, \"\").startsWith(prefix)) {\n return key.replace(/_$/g, \"\").slice(prefix.length);\n }\n return ret;\n },\n key\n );\n\n const aliasKey = envWithAlias.find(prop =>\n prop?.getAlias().reverse().includes(unprefixedKey)\n );\n if (this.env.types.env?.hasProperty(unprefixedKey) || aliasKey) {\n this.env.types.env\n .getProperty(unprefixedKey)\n .setDefaultValue(value);\n }\n }\n );\n\n this.env.used.env = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `An object containing the environment configuration parameters used by the ${\n this.config.name\n ? `${this.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n this.env.types.env\n );\n\n await writeEnvReflection(this, this.env.used.env, \"env\");\n\n if (this.env.types.secrets) {\n await writeEnvTypeReflection(\n this,\n this.env.types.secrets,\n \"secrets\"\n );\n\n this.env.used.secrets = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `An object containing the secret configuration parameters used by the ${\n this.config.name\n ? `${this.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n this.env.types.secrets\n );\n await writeEnvReflection(this, this.env.used.secrets, \"secrets\");\n }\n }\n },\n async prepare() {\n this.debug(\n `Preparing the Environment runtime artifacts for the Powerlines project.`\n );\n\n const result = await readEnvTypeReflection(this, \"env\");\n await this.render(\n <EnvBuiltin\n defaultConfig={this.config.env.defaultConfig}\n reflection={result}\n />\n );\n },\n transform: {\n order: \"post\",\n async handler() {\n if (this.env.used.env.getProperties().length > 0) {\n this.trace(\n `Persisting used environment configuration reflections to ${getEnvReflectionsPath(\n this,\n \"env\"\n )}.`\n );\n await writeEnvReflection(this, this.env.used.env, \"env\");\n }\n\n if (this.env.used.secrets.getProperties().length > 0) {\n this.trace(\n `Persisting used secret configuration reflections to ${getEnvReflectionsPath(\n this,\n \"secrets\"\n )}.`\n );\n await writeEnvReflection(this, this.env.used.secrets, \"secrets\");\n }\n }\n },\n async docs() {\n this.debug(\n `Documenting environment variables configuration values in \"${joinPaths(\n getDocsOutputPath(this),\n \"env.md\"\n )}\"`\n );\n\n const result = await readEnvTypeReflection(this, \"env\");\n await this.render(<EnvDocsFile levelOffset={0} reflection={result} />);\n },\n async buildEnd() {\n const reflectionPath = getEnvReflectionsPath(this, \"env\");\n\n this.debug(`Writing env reflection types to ${reflectionPath}.`);\n\n await writeEnvReflection(this, this.env.used.env, \"env\");\n }\n },\n {\n name: \"env:automd-generator\",\n config() {\n return {\n automd: defu(options.automd ?? {}, {\n generators: {\n env: env(this)\n }\n })\n };\n }\n },\n {\n name: \"env:vite\",\n vite: {\n configResolved(this: TContext) {\n return {\n envPrefix: this.config?.env?.prefix\n } as ViteUserConfig;\n }\n }\n },\n automd(options.automd)\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,gBAAgB,UAAU;AAC/B,KAAI,SAAS,KAAM,QAAO,UAAU,KAAK,IAAI,uBAAuB;AACpE,QAAO,OAAO,UAAU,SAAS,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;ACgB7C,MAAM,gBAAgB,QAAQ;AAC7B,QAAO,OAAO,QAAQ,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2B3C,MAAM,iBAAiB,QAAQ;AAC9B,KAAI,CAAC,aAAa,IAAI,IAAI,aAAa,IAAI,KAAK,kBAAmB,QAA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A+B;AAC7B,WAAO,EACLqD,WAAW,KAAKzE,QAAQjB,KAAKoB,QAC9B;MAEL;GACD;EACDjC,OAAO4B,QAAQ5B,OAAO;EACvB;;AAGH,kBAAe2B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-env",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.145",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
|
|
6
6
|
"repository": {
|
|
@@ -313,10 +313,10 @@
|
|
|
313
313
|
"@alloy-js/typescript": "^0.22.0",
|
|
314
314
|
"@babel/core": "^7.28.6",
|
|
315
315
|
"@babel/types": "^7.28.6",
|
|
316
|
-
"@powerlines/plugin-alloy": "^0.19.
|
|
317
|
-
"@powerlines/plugin-automd": "^0.1.
|
|
318
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
319
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
316
|
+
"@powerlines/plugin-alloy": "^0.19.17",
|
|
317
|
+
"@powerlines/plugin-automd": "^0.1.242",
|
|
318
|
+
"@powerlines/plugin-babel": "^0.12.251",
|
|
319
|
+
"@powerlines/plugin-plugin": "^0.12.193",
|
|
320
320
|
"@storm-software/config-tools": "^1.189.0",
|
|
321
321
|
"@stryke/capnp": "^0.12.64",
|
|
322
322
|
"@stryke/env": "^0.20.56",
|
|
@@ -326,15 +326,15 @@
|
|
|
326
326
|
"@stryke/type-checks": "^0.5.22",
|
|
327
327
|
"@stryke/types": "^0.10.36",
|
|
328
328
|
"automd": "^0.4.2",
|
|
329
|
-
"powerlines": "^0.38.
|
|
329
|
+
"powerlines": "^0.38.9"
|
|
330
330
|
},
|
|
331
331
|
"devDependencies": {
|
|
332
|
-
"@powerlines/deepkit": "^0.6.
|
|
333
|
-
"@powerlines/plugin-deepkit": "^0.11.
|
|
332
|
+
"@powerlines/deepkit": "^0.6.22",
|
|
333
|
+
"@powerlines/plugin-deepkit": "^0.11.121",
|
|
334
334
|
"@types/node": "^24.10.9",
|
|
335
335
|
"vite": "8.0.0-beta.2"
|
|
336
336
|
},
|
|
337
337
|
"publishConfig": { "access": "public" },
|
|
338
338
|
"types": "./dist/index.d.cts",
|
|
339
|
-
"gitHead": "
|
|
339
|
+
"gitHead": "645a6b28d6331e68c666e715a892b08c24da9cf7"
|
|
340
340
|
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { t as __ΩEnvPluginContext } from "./plugin-eBjQJP6x.mjs";
|
|
2
|
-
import { o as readEnvTypeReflection } from "./persistence-BsBxs9wt.mjs";
|
|
3
|
-
import { n as loadEnvFromContext } from "./load-Dr5ybfL7.mjs";
|
|
4
|
-
import { ReflectionClass, ReflectionKind } from "@powerlines/deepkit/vendor/type";
|
|
5
|
-
import { titleCase } from "@stryke/string-format/title-case";
|
|
6
|
-
import { computed, createResource } from "@alloy-js/core";
|
|
7
|
-
|
|
8
|
-
//#region src/helpers/create-reflection-resource.ts
|
|
9
|
-
const __ΩRecord = [
|
|
10
|
-
"K",
|
|
11
|
-
"T",
|
|
12
|
-
"Record",
|
|
13
|
-
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
14
|
-
];
|
|
15
|
-
function __assignType(fn, args) {
|
|
16
|
-
fn.__type = args;
|
|
17
|
-
return fn;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Creates a reflection resource for the environment configuration.
|
|
21
|
-
*
|
|
22
|
-
* @param context - The environment plugin context.
|
|
23
|
-
* @returns A resource that provides the reflection of the environment configuration.
|
|
24
|
-
*/
|
|
25
|
-
function createReflectionResource(context) {
|
|
26
|
-
const defaultValue = computed(() => context && loadEnvFromContext(context, process.env));
|
|
27
|
-
return createResource.Ω = [[
|
|
28
|
-
() => __ΩRecord,
|
|
29
|
-
() => ReflectionClass,
|
|
30
|
-
"P&\"o!#7\""
|
|
31
|
-
]], createResource(async () => {
|
|
32
|
-
if (!context) return new ReflectionClass({
|
|
33
|
-
kind: ReflectionKind.objectLiteral,
|
|
34
|
-
description: `The initial environment configuration state for the Powerlines project.`,
|
|
35
|
-
types: []
|
|
36
|
-
});
|
|
37
|
-
const result = await readEnvTypeReflection(context, "env");
|
|
38
|
-
result.getProperties().forEach(__assignType((prop) => {
|
|
39
|
-
prop.getAlias().filter(Boolean).forEach(__assignType((alias) => {
|
|
40
|
-
result.addProperty({
|
|
41
|
-
name: alias,
|
|
42
|
-
optional: prop.isOptional() ? true : void 0,
|
|
43
|
-
readonly: prop.isReadonly() ? true : void 0,
|
|
44
|
-
description: prop.getDescription(),
|
|
45
|
-
visibility: prop.getVisibility(),
|
|
46
|
-
type: prop.getType(),
|
|
47
|
-
default: prop.getDefaultValue(),
|
|
48
|
-
tags: {
|
|
49
|
-
hidden: prop.isHidden(),
|
|
50
|
-
ignore: prop.isIgnored(),
|
|
51
|
-
internal: prop.isInternal(),
|
|
52
|
-
alias: prop.getAlias().filter(__assignType((a) => a !== alias, [
|
|
53
|
-
"a",
|
|
54
|
-
"",
|
|
55
|
-
"P\"2!\"/\""
|
|
56
|
-
])).concat(prop.name),
|
|
57
|
-
title: prop.getTitle() || titleCase(prop.name),
|
|
58
|
-
readonly: prop.isReadonly(),
|
|
59
|
-
permission: prop.getPermission(),
|
|
60
|
-
domain: prop.getDomain()
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}, [
|
|
64
|
-
"alias",
|
|
65
|
-
"",
|
|
66
|
-
"P\"2!\"/\""
|
|
67
|
-
]));
|
|
68
|
-
}, [
|
|
69
|
-
"prop",
|
|
70
|
-
"",
|
|
71
|
-
"P\"2!\"/\""
|
|
72
|
-
]));
|
|
73
|
-
result.getProperties().forEach(__assignType((prop) => {
|
|
74
|
-
prop.setDefaultValue(defaultValue.value?.[prop.getNameAsString()] ?? prop.getAlias().reduce(__assignType((ret, alias) => ret ?? defaultValue.value?.[alias], [
|
|
75
|
-
"ret",
|
|
76
|
-
"alias",
|
|
77
|
-
"",
|
|
78
|
-
"P\"2!\"2\"\"/#"
|
|
79
|
-
]), void 0) ?? prop.getDefaultValue());
|
|
80
|
-
}, [
|
|
81
|
-
"prop",
|
|
82
|
-
"",
|
|
83
|
-
"P\"2!\"/\""
|
|
84
|
-
]));
|
|
85
|
-
return result;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
createReflectionResource.__type = [
|
|
89
|
-
() => __ΩEnvPluginContext,
|
|
90
|
-
"context",
|
|
91
|
-
"createReflectionResource",
|
|
92
|
-
"Creates a reflection resource for the environment configuration.",
|
|
93
|
-
"Pn!2\"8\"/#?$"
|
|
94
|
-
];
|
|
95
|
-
|
|
96
|
-
//#endregion
|
|
97
|
-
export { createReflectionResource as t };
|
|
98
|
-
//# sourceMappingURL=create-reflection-resource-B3friIs9.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-reflection-resource-B3friIs9.mjs","names":[],"sources":["../src/helpers/create-reflection-resource.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 { computed, createResource } from \"@alloy-js/core\";\nimport {\n ReflectionClass,\n ReflectionKind\n} from \"@powerlines/deepkit/vendor/type\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { EnvPluginContext } from \"../types/plugin\";\nimport { loadEnvFromContext } from \"./load\";\nimport { readEnvTypeReflection } from \"./persistence\";\n\n/**\n * Creates a reflection resource for the environment configuration.\n *\n * @param context - The environment plugin context.\n * @returns A resource that provides the reflection of the environment configuration.\n */\nexport function createReflectionResource(context?: EnvPluginContext) {\n const defaultValue = computed(\n () => context && loadEnvFromContext(context, process.env)\n );\n\n return createResource<ReflectionClass<Record<string, any>>>(async () => {\n if (!context) {\n return new ReflectionClass({\n kind: ReflectionKind.objectLiteral,\n description: `The initial environment configuration state for the Powerlines project.`,\n types: []\n });\n }\n\n const result = await readEnvTypeReflection(context, \"env\");\n result.getProperties().forEach(prop => {\n const aliases = prop.getAlias();\n aliases.filter(Boolean).forEach(alias => {\n result.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 result.getProperties().forEach(prop => {\n prop.setDefaultValue(\n (defaultValue.value as Record<string, any>)?.[prop.getNameAsString()] ??\n prop\n .getAlias()\n .reduce(\n (ret, alias) =>\n ret ?? (defaultValue.value as Record<string, any>)?.[alias],\n undefined\n ) ??\n prop.getDefaultValue()\n );\n });\n\n return result;\n });\n}\n"],"mappings":";;;;;;;;AAAA,MAAM,YAAY;CAAC;CAAK;CAAK;CAAU;CAAyB;;AAI5D,IAAG,SAAS;AACZ,QAAO;;;;;;;;AA8BX,SAAgB,yBAAe,SAAA;CAC3B,MAAM,eAAe,eAAe,WAAW,mBAAS,SAAA,QAAA,IAAA,CAAA;AACzD,QAAA,eAAA,IAAA,CAAA;QAAA;QAAA;EAAA;EAAA,CAAA,EAAA,eAAA,YAAA;eAES,QAAO,IAAI,gBAAgB;GACvB,MAAE,eAAA;GACF,aAAa;GACb,OAAO,EAAA;GACV,C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const require_persistence = require('./persistence-D_clXRxP.cjs');
|
|
4
|
-
const require_load = require('./load-DPB0maqs.cjs');
|
|
5
|
-
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
6
|
-
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
7
|
-
let __alloy_js_core = require("@alloy-js/core");
|
|
8
|
-
|
|
9
|
-
//#region src/helpers/create-reflection-resource.ts
|
|
10
|
-
const __ΩRecord = [
|
|
11
|
-
"K",
|
|
12
|
-
"T",
|
|
13
|
-
"Record",
|
|
14
|
-
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
15
|
-
];
|
|
16
|
-
function __assignType(fn, args) {
|
|
17
|
-
fn.__type = args;
|
|
18
|
-
return fn;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Creates a reflection resource for the environment configuration.
|
|
22
|
-
*
|
|
23
|
-
* @param context - The environment plugin context.
|
|
24
|
-
* @returns A resource that provides the reflection of the environment configuration.
|
|
25
|
-
*/
|
|
26
|
-
function createReflectionResource(context) {
|
|
27
|
-
const defaultValue = (0, __alloy_js_core.computed)(() => context && require_load.loadEnvFromContext(context, process.env));
|
|
28
|
-
return __alloy_js_core.createResource.Ω = [[
|
|
29
|
-
() => __ΩRecord,
|
|
30
|
-
() => __powerlines_deepkit_vendor_type.ReflectionClass,
|
|
31
|
-
"P&\"o!#7\""
|
|
32
|
-
]], (0, __alloy_js_core.createResource)(async () => {
|
|
33
|
-
if (!context) return new __powerlines_deepkit_vendor_type.ReflectionClass({
|
|
34
|
-
kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
35
|
-
description: `The initial environment configuration state for the Powerlines project.`,
|
|
36
|
-
types: []
|
|
37
|
-
});
|
|
38
|
-
const result = await require_persistence.readEnvTypeReflection(context, "env");
|
|
39
|
-
result.getProperties().forEach(__assignType((prop) => {
|
|
40
|
-
prop.getAlias().filter(Boolean).forEach(__assignType((alias) => {
|
|
41
|
-
result.addProperty({
|
|
42
|
-
name: alias,
|
|
43
|
-
optional: prop.isOptional() ? true : void 0,
|
|
44
|
-
readonly: prop.isReadonly() ? true : void 0,
|
|
45
|
-
description: prop.getDescription(),
|
|
46
|
-
visibility: prop.getVisibility(),
|
|
47
|
-
type: prop.getType(),
|
|
48
|
-
default: prop.getDefaultValue(),
|
|
49
|
-
tags: {
|
|
50
|
-
hidden: prop.isHidden(),
|
|
51
|
-
ignore: prop.isIgnored(),
|
|
52
|
-
internal: prop.isInternal(),
|
|
53
|
-
alias: prop.getAlias().filter(__assignType((a) => a !== alias, [
|
|
54
|
-
"a",
|
|
55
|
-
"",
|
|
56
|
-
"P\"2!\"/\""
|
|
57
|
-
])).concat(prop.name),
|
|
58
|
-
title: prop.getTitle() || (0, __stryke_string_format_title_case.titleCase)(prop.name),
|
|
59
|
-
readonly: prop.isReadonly(),
|
|
60
|
-
permission: prop.getPermission(),
|
|
61
|
-
domain: prop.getDomain()
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}, [
|
|
65
|
-
"alias",
|
|
66
|
-
"",
|
|
67
|
-
"P\"2!\"/\""
|
|
68
|
-
]));
|
|
69
|
-
}, [
|
|
70
|
-
"prop",
|
|
71
|
-
"",
|
|
72
|
-
"P\"2!\"/\""
|
|
73
|
-
]));
|
|
74
|
-
result.getProperties().forEach(__assignType((prop) => {
|
|
75
|
-
prop.setDefaultValue(defaultValue.value?.[prop.getNameAsString()] ?? prop.getAlias().reduce(__assignType((ret, alias) => ret ?? defaultValue.value?.[alias], [
|
|
76
|
-
"ret",
|
|
77
|
-
"alias",
|
|
78
|
-
"",
|
|
79
|
-
"P\"2!\"2\"\"/#"
|
|
80
|
-
]), void 0) ?? prop.getDefaultValue());
|
|
81
|
-
}, [
|
|
82
|
-
"prop",
|
|
83
|
-
"",
|
|
84
|
-
"P\"2!\"/\""
|
|
85
|
-
]));
|
|
86
|
-
return result;
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
createReflectionResource.__type = [
|
|
90
|
-
() => require_plugin.__ΩEnvPluginContext,
|
|
91
|
-
"context",
|
|
92
|
-
"createReflectionResource",
|
|
93
|
-
"Creates a reflection resource for the environment configuration.",
|
|
94
|
-
"Pn!2\"8\"/#?$"
|
|
95
|
-
];
|
|
96
|
-
|
|
97
|
-
//#endregion
|
|
98
|
-
Object.defineProperty(exports, 'createReflectionResource', {
|
|
99
|
-
enumerable: true,
|
|
100
|
-
get: function () {
|
|
101
|
-
return createReflectionResource;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { t as EnvPluginContext } from "./plugin-CSe5f2cD.cjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/create-reflection-resource.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Creates a reflection resource for the environment configuration.
|
|
9
|
-
*
|
|
10
|
-
* @param context - The environment plugin context.
|
|
11
|
-
* @returns A resource that provides the reflection of the environment configuration.
|
|
12
|
-
*/
|
|
13
|
-
declare function createReflectionResource(context?: EnvPluginContext): _alloy_js_core0.Resource<ReflectionClass<Record<string, any>>>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { createReflectionResource as t };
|
|
16
|
-
//# sourceMappingURL=create-reflection-resource-DSLbLsX2.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-reflection-resource-DSLbLsX2.d.cts","names":[],"sources":["../src/helpers/create-reflection-resource.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAkCA;;;AAAmE,iBAAnD,wBAAA,CAAmD,OAAA,CAAA,EAAhB,gBAAgB,CAAA,EAAA,eAAA,CAAA,QAAA,CAAA,eAAA,CAAA,MAAA,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { t as EnvPluginContext } from "./plugin-DMbVjdcQ.mjs";
|
|
2
|
-
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
3
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/create-reflection-resource.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Creates a reflection resource for the environment configuration.
|
|
9
|
-
*
|
|
10
|
-
* @param context - The environment plugin context.
|
|
11
|
-
* @returns A resource that provides the reflection of the environment configuration.
|
|
12
|
-
*/
|
|
13
|
-
declare function createReflectionResource(context?: EnvPluginContext): _alloy_js_core0.Resource<ReflectionClass<Record<string, any>>>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { createReflectionResource as t };
|
|
16
|
-
//# sourceMappingURL=create-reflection-resource-DwWJAo-G.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-reflection-resource-DwWJAo-G.d.mts","names":[],"sources":["../src/helpers/create-reflection-resource.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAkCA;;;AAAmE,iBAAnD,wBAAA,CAAmD,OAAA,CAAA,EAAhB,gBAAgB,CAAA,EAAA,eAAA,CAAA,QAAA,CAAA,eAAA,CAAA,MAAA,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docs-B0d8pdIg.d.mts","names":[],"sources":["../src/components/docs.tsx"],"sourcesContent":[],"mappings":";;;;UAgCiB,gBAAA,SAAyB,QAAQ;;;AAAlD;AAeA;;;;;;;;;;iBAAgB,WAAA,QAAmB,mBAAgB,eAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docs-DMfzQuvP.d.cts","names":[],"sources":["../src/components/docs.tsx"],"sourcesContent":[],"mappings":";;;;UAgCiB,gBAAA,SAAyB,QAAQ;;;AAAlD;AAeA;;;;;;;;;;iBAAgB,WAAA,QAAmB,mBAAgB,eAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docs-DbRoWmL_.mjs","names":["code","Show","Heading","Link","stringifyType","usePowerlinesSafe","MarkdownFile","MarkdownTable","joinPaths","createReflectionResource","getDocsOutputPath","EnvDocsFile","props","levelOffset","rest","context","reflection","_$createComponent","_$mergeProps","path","children","level","when","packageJson","name","href","title","_$createIntrinsic","data","getProperties","filter","property","getNameAsString","sort","a","b","localeCompare","map","reflectionProperty","trim","description","getDescription","type","getType","replaceAll","defaultValue","hasDefault","String","getDefaultValue","includes","required","isValueRequired"],"sources":["../src/components/docs.tsx"],"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 { code, Show } from \"@alloy-js/core\";\nimport { Heading, Link } from \"@alloy-js/markdown\";\nimport { stringifyType } from \"@powerlines/deepkit/vendor/type\";\nimport { usePowerlinesSafe } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n MarkdownFile,\n MarkdownFileProps\n} from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { createReflectionResource } from \"../helpers/create-reflection-resource\";\nimport { getDocsOutputPath } from \"../helpers/docs-helper\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\nexport interface EnvDocsFileProps extends Partial<MarkdownFileProps> {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n}\n\n/**\n * Generates the environment configuration markdown documentation for the Powerlines project.\n */\nexport function EnvDocsFile(props: EnvDocsFileProps) {\n const { levelOffset = 0, ...rest } = props;\n\n const context = usePowerlinesSafe<EnvPluginContext>();\n if (!context) {\n return null;\n }\n\n // Clean and recreate the output directories\n const reflection = createReflectionResource(context);\n\n return (\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context), \"env.md\")}\n {...rest}>\n <Heading level={1 + levelOffset}>Environment Configuration</Heading>\n {code`Below is a list of environment variables used by the`}\n <Show when={!!context?.packageJson.name}>\n <Link\n href={`https://www.npmjs.com/package/${context?.packageJson.name}`}\n title={context.packageJson.name!}\n />\n </Show>\n {code`package. These values can be updated in the \\`.env\\` file in the root of the project.`}\n <hbr />\n <Heading level={2 + levelOffset}>Environment Variables</Heading>\n {code`The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.`}\n <hbr />\n <MarkdownTable\n data={\n reflection.data\n ?.getProperties()\n .filter(\n property => property.getNameAsString() !== \"__STORM_INJECTED__\"\n )\n .sort((a, b) =>\n a.getNameAsString().localeCompare(b.getNameAsString())\n )\n .map(reflectionProperty => {\n return {\n name: reflectionProperty.getNameAsString().trim(),\n description: (reflectionProperty.getDescription() ?? \"\").trim(),\n type: stringifyType(reflectionProperty.getType())\n .trim()\n .replaceAll(\" | \", \", or \"),\n defaultValue: reflectionProperty.hasDefault()\n ? String(reflectionProperty.getDefaultValue())?.includes('\"')\n ? reflectionProperty.getDefaultValue()\n : `\\`${reflectionProperty.getDefaultValue()}\\``\n : \"\",\n required: reflectionProperty.isValueRequired() ? \"\" : \"✔\"\n };\n }) ?? []\n }\n />\n </MarkdownFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+CA,SAAgBW,YAAYC,OAAyB;CACnD,MAAM,EAAE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BAAmBQ,YAAY,GACzCC,OAAOT,mBAAmBU,iBAAiB,CAAC,EAAEC,SAAS,KAAI,GACzDX,mBAAmBU,iBAAiB,GACpC,KAAKV,mBAAmBU,iBAAiB,CAAA,MAC3C;MACJE,UAAUZ,mBAAmBa,iBAAiB,GAAG,KAAK;MACvD;MACD,IAAI,EAAE;MAAA,CAAA;GAAA;IAAA,CAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-BIyd8CTA.d.cts","names":[],"sources":["../src/components/env.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAwEA;AACc,iBADE,iBAAA,CACF,KAAA,EAAL,IAAK,CAAA,wBAAA,EAAA,MAAA,CAAA,CAAA,EAAiC,QAAjC;AAAL,UAoMQ,eAAA,SAAwB,IApMhC,CAoMqC,gBApMrC,EAAA,IAAA,CAAA,CAAA;EAAsC,aAAA,CAAA,EAqM7B,QArM6B;;AAoM/C;;;AAAyC,iBAWzB,UAAA,CAXyB,KAAA,EAWP,eAXO,CAAA,EAWQ,QAXR;AAAI,kCAAA,GAAA,EAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-BKmI7DyR.d.mts","names":[],"sources":["../src/components/env.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAwEA;AACc,iBADE,iBAAA,CACF,KAAA,EAAL,IAAK,CAAA,wBAAA,EAAA,MAAA,CAAA,CAAA,EAAiC,QAAjC;AAAL,UAoMQ,eAAA,SAAwB,IApMhC,CAoMqC,gBApMrC,EAAA,IAAA,CAAA,CAAA;EAAsC,aAAA,CAAA,EAqM7B,QArM6B;;AAoM/C;;;AAAyC,iBAWzB,UAAA,CAXyB,KAAA,EAWP,eAXO,CAAA,EAWQ,QAXR;AAAI,kCAAA,GAAA,EAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-D9oCn-AS.mjs","names":["code","computed","For","Show","splitProps","ClassDeclaration","ClassMethod","ElseIfClause","FunctionDeclaration","IfStatement","NewExpression","TypeDeclaration","VarDeclaration","ReflectionClass","ReflectionKind","usePowerlinesSafe","refkey","BuiltinFile","TSDoc","TSDocExample","TSDocLink","TSDocParam","TSDocRemarks","TSDocReturns","TSDocThrows","TypeScriptInterface","TypescriptObject","titleCase","isNull","defu","createReflectionResource","loadEnvFromContext","EnvTypeDefinition","props","defaultValue","reflection","context","_$createComponent","name","_$createIntrinsic","heading","children","config","env","prefix","map","replace","join","ConfigPropertyConditional","sort","a","b","startsWith","localeCompare","toLowerCase","ConfigPropertyGet","property","index","condition","getNameAsString","when","_$memo","getAlias","length","each","joiner","alias","ConfigPropertySet","createEnvRefkey","envRefkey","envSerializerRefkey","EnvBuiltin","defaultConfig","rest","process","envInstance","result","kind","objectLiteral","description","types","data","undefined","reflectionGetProperties","getProperties","filter","isIgnored","reflectionSetProperties","isReadonly","_$mergeProps","id","imports","value","type","doc","initializer","args","target","Boolean","entryPath","async","parameters","optional","default","returnType","ender"],"sources":["../src/components/env.tsx"],"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 {\n Children,\n code,\n computed,\n For,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n ClassDeclaration,\n ClassMethod,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n NewExpression,\n TypeDeclaration,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport {\n ReflectionClass,\n ReflectionKind,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { usePowerlinesSafe } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { refkey } from \"@powerlines/plugin-alloy/helpers/refkey\";\nimport { ComponentProps } from \"@powerlines/plugin-alloy/types/components\";\nimport {\n BuiltinFile,\n BuiltinFileProps\n} from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n TSDoc,\n TSDocExample,\n TSDocLink,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns,\n TSDocThrows\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport {\n TypeScriptInterface,\n TypeScriptInterfaceProps\n} from \"@powerlines/plugin-alloy/typescript/components/typescript-interface\";\nimport { TypescriptObject } from \"@powerlines/plugin-alloy/typescript/components/typescript-object\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isNull } from \"@stryke/type-checks/is-null\";\nimport defu from \"defu\";\nimport { createReflectionResource } from \"../helpers/create-reflection-resource\";\nimport { loadEnvFromContext } from \"../helpers/load\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/**\n * Generates the environment configuration typescript definition for the Powerlines project.\n */\nexport function EnvTypeDefinition(\n props: Omit<TypeScriptInterfaceProps, \"name\">\n) {\n const [{ defaultValue, reflection }] = splitProps(props, [\n \"defaultValue\",\n \"reflection\"\n ]);\n\n const context = usePowerlinesSafe<EnvPluginContext>();\n if (!context) {\n return null;\n }\n\n return (\n <>\n <TypeScriptInterface\n name=\" EnvBase\"\n defaultValue={defaultValue}\n reflection={reflection}\n export={true}\n />\n <hbr />\n <hbr />\n\n <TSDoc heading=\"The environment configuration object with prefixed keys.\">\n <TSDocRemarks>\n {`The \\`Env\\` type extends the \\`EnvBase\\` interface by including additional keys that are prefixed according to the project's configuration. This allows for flexibility in accessing environment variables with different naming conventions.`}\n </TSDocRemarks>\n </TSDoc>\n <TypeDeclaration name=\"Env\" export={true}>\n {code` {\n [Key in keyof EnvBase as Key ${context.config.env.prefix\n .map(prefix => `| \\`${prefix.replace(/_$/g, \"\")}_\\${Key}\\``)\n .join(\" \")}]: EnvBase[Key];\n}\n`}\n </TypeDeclaration>\n <hbr />\n <hbr />\n </>\n );\n}\n\ninterface ConfigPropertyConditionalProps extends ComponentProps {\n context: EnvPluginContext | undefined;\n name: string;\n}\n\nfunction ConfigPropertyConditional(props: ConfigPropertyConditionalProps) {\n const [{ context, name }] = splitProps(props, [\"context\", \"name\"]);\n\n if (!context) {\n return null;\n }\n\n return code`propertyName === \"${name}\" || propertyName.replace(/^(${context.config.env.prefix\n .sort((a, b) =>\n a.startsWith(b) ? -1 : b.startsWith(a) ? 1 : a.localeCompare(b)\n )\n .map(prefix => `${prefix.replace(/_$/, \"\")}_`)\n .join(\"|\")})/g, \"\").toLowerCase().replace(/[\\\\s\\\\-_]+/g, \"\") === \"${name\n .toLowerCase()\n .replace(/[\\s\\-_]+/g, \"\")}\"`;\n}\n\ninterface ConfigPropertyProps extends ComponentProps {\n index: number;\n context: EnvPluginContext | undefined;\n property: ReflectionProperty;\n}\n\nfunction ConfigPropertyGet(props: ConfigPropertyProps) {\n const [{ context, property, index }] = splitProps(props, [\n \"context\",\n \"property\",\n \"index\"\n ]);\n\n if (!context) {\n return null;\n }\n\n return (\n <>\n {index === 0 ? (\n <IfStatement\n condition={\n <>\n <ConfigPropertyConditional\n name={property.getNameAsString()}\n context={context}\n />\n <Show\n when={property.getAlias() && property.getAlias().length > 0}>\n {code` || `}\n <For each={property.getAlias()} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`return target[\"${property.getNameAsString()}\"];`}\n </IfStatement>\n ) : (\n <ElseIfClause\n condition={\n <>\n <ConfigPropertyConditional\n name={property.getNameAsString()}\n context={context}\n />\n <Show\n when={property.getAlias() && property.getAlias().length > 0}>\n {code` || `}\n <For each={property.getAlias()} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`return target[\"${property.getNameAsString()}\"];`}\n </ElseIfClause>\n )}\n </>\n );\n}\n\nfunction ConfigPropertySet(props: ConfigPropertyProps) {\n const [{ context, property, index }] = splitProps(props, [\n \"context\",\n \"property\",\n \"index\"\n ]);\n\n if (!context) {\n return null;\n }\n\n return (\n <>\n {index === 0 ? (\n <IfStatement\n condition={\n <>\n <ConfigPropertyConditional\n name={property.getNameAsString()}\n context={context}\n />\n <Show\n when={property.getAlias() && property.getAlias().length > 0}>\n {code` || `}\n <For each={property.getAlias()} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`\n target[\"${property.getNameAsString()}\"] = newValue;\n return true;\n`}\n </IfStatement>\n ) : (\n <ElseIfClause\n condition={\n <>\n <ConfigPropertyConditional\n name={property.getNameAsString()}\n context={context}\n />\n <Show\n when={property.getAlias() && property.getAlias().length > 0}>\n {code` || `}\n <For each={property.getAlias()} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`\n target[\"${property.getNameAsString()}\"] = newValue;\n return true;\n`}\n </ElseIfClause>\n )}\n </>\n );\n}\n\nexport interface EnvBuiltinProps extends Omit<BuiltinFileProps, \"id\"> {\n defaultConfig?: Children;\n}\n\nconst createEnvRefkey = refkey(\"createEnv\");\nconst envRefkey = refkey(\"env\");\nconst envSerializerRefkey = refkey(\"EnvSerializer\");\n\n/**\n * Generates the environment configuration module for the Powerlines project.\n */\nexport function EnvBuiltin(props: EnvBuiltinProps) {\n const [{ defaultConfig, children }, rest] = splitProps(props, [\n \"defaultConfig\",\n \"children\"\n ]);\n\n const context = usePowerlinesSafe<EnvPluginContext>();\n\n const defaultValue = computed(\n () => context && loadEnvFromContext(context, process.env)\n );\n const reflection = createReflectionResource(context);\n\n const envInstance = computed(() => {\n const result = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n description: `The initial environment configuration state for the ${titleCase(\n context?.config?.name\n )} project.`,\n types: []\n },\n reflection.data ?? undefined\n );\n\n return result;\n });\n\n const reflectionGetProperties = computed(\n () =>\n reflection.data\n ?.getProperties()\n .filter(property => !property.isIgnored())\n .sort((a, b) =>\n a.getNameAsString().localeCompare(b.getNameAsString())\n ) ?? []\n );\n\n const reflectionSetProperties = computed(\n () =>\n reflection.data\n ?.getProperties()\n .filter(property => !property.isIgnored() && !property.isReadonly())\n .sort((a, b) =>\n a.getNameAsString().localeCompare(b.getNameAsString())\n ) ?? []\n );\n\n return (\n <BuiltinFile\n id=\"env\"\n description=\"The environment configuration module provides an interface to define environment configuration parameters.\"\n {...rest}\n imports={defu(\n {\n \"@powerlines/deepkit/vendor/type\": [\n \"stringify\",\n \"serializer\",\n \"serializeFunction\",\n \"deserializeFunction\",\n \"ReflectionKind\",\n \"Serializer\",\n \"TemplateState\",\n \"Type\",\n \"TypeProperty\",\n \"TypePropertySignature\"\n ]\n },\n rest.imports ?? {}\n )}>\n <Show when={!isNull(reflection.data)}>\n <EnvTypeDefinition\n defaultValue={defaultValue.value}\n reflection={reflection.data!}\n />\n <hbr />\n <hbr />\n </Show>\n\n <TypescriptObject\n name=\"initialEnv\"\n type=\"Partial<EnvBase>\"\n defaultValue={defaultValue}\n reflection={envInstance}\n export={true}\n const={true}\n doc=\"The initial environment configuration object values for the runtime.\"\n />\n <hbr />\n <hbr />\n\n <TSDoc heading=\"The environment configuration serializer for the Powerlines application.\">\n <TSDocLink>\n {`https://deepkit.io/docs/serialization/serializers`}\n </TSDocLink>\n <TSDocLink>\n {`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}\n </TSDocLink>\n <TSDocRemarks>\n {`This serializer is used to serialize and deserialize the Powerlines environment configuration.`}\n </TSDocRemarks>\n </TSDoc>\n <ClassDeclaration\n refkey={envSerializerRefkey}\n name=\"EnvSerializer\"\n extends=\"Serializer\"\n export={true}>\n <ClassMethod\n name=\"constructor\"\n public={true}\n doc=\"Initializes a new instance of the `EnvSerializer` class.\">\n {code`\n super(\"env\");\n\n this.deserializeRegistry.register(\n ReflectionKind.boolean,\n (type: Type, state: TemplateState) => {\n state.addSetter(\n \\`typeof \\${state.accessor.toString()} !== \"boolean\" ? \\${state.accessor.toString()} === 1 || \\${state.accessor.toString()} === \"1\" || \\${state.accessor.toString()}.toLowerCase() === \"t\" || \\${state.accessor.toString()}.toLowerCase() === \"true\" || \\${state.accessor.toString()}.toLowerCase() === \"y\" || \\${state.accessor.toString()}.toLowerCase() === \"yes\" : \\${state.accessor.toString()}\\`\n );\n }\n );\n`}\n </ClassMethod>\n </ClassDeclaration>\n <hbr />\n <hbr />\n\n <TSDoc heading=\"A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.\">\n <TSDocLink>\n {`https://deepkit.io/docs/serialization/serializers`}\n </TSDocLink>\n <TSDocLink>\n {`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}\n </TSDocLink>\n <TSDocRemarks>\n {`This serializer is used to serialize and deserialize the Powerlines environment configuration.`}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n name=\"envSerializer\"\n export={false}\n const={true}\n initializer={<NewExpression args={[]} target=\"EnvSerializer\" />}\n />\n <hbr />\n <hbr />\n\n <TSDoc heading=\"Serialize a environment configuration object to JSON data objects (not a JSON string).\">\n <TSDocRemarks>\n {`The resulting JSON object can be stringified using \\`JSON.stringify()\\`.`}\n </TSDocRemarks>\n <TSDocExample>{`const json = serializeEnv(env);`}</TSDocExample>\n <TSDocThrows>\n {`ValidationError when serialization or validation fails.`}\n </TSDocThrows>\n </TSDoc>\n <VarDeclaration\n name=\"serializeEnv\"\n export={true}\n const={true}\n initializer={\"serializeFunction<EnvBase>(envSerializer)\"}\n />\n <hbr />\n <hbr />\n\n <TSDoc heading=\"Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.\">\n <TSDocRemarks>\n {`Types that are already correct will be used as-is.`}\n </TSDocRemarks>\n <TSDocExample>{`const env = deserializeEnv(json);`}</TSDocExample>\n <TSDocThrows>\n {`ValidationError when deserialization fails.`}\n </TSDocThrows>\n </TSDoc>\n <VarDeclaration\n name=\"deserializeEnv\"\n export={true}\n const={true}\n initializer=\"deserializeFunction<EnvBase>(envSerializer)\"\n />\n <hbr />\n <hbr />\n\n <TSDoc heading=\"Initializes the Powerlines environment configuration module.\">\n <TSDocRemarks>\n {`This function initializes the Powerlines environment configuration object.`}\n </TSDocRemarks>\n <TSDocParam name=\"environmentConfig\">\n {`The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`}\n </TSDocParam>\n <TSDocReturns>\n {`The initialized Powerlines configuration object.`}\n </TSDocReturns>\n </TSDoc>\n <Show when={Boolean(context?.entryPath)}>\n <FunctionDeclaration\n refkey={createEnvRefkey}\n async={false}\n export={true}\n name=\"createEnv\"\n parameters={[\n {\n name: \"environmentConfig\",\n type: `Partial<Env>`,\n optional: false,\n default: \"{}\"\n }\n ]}\n returnType=\"Env\">\n {code`\n return new Proxy<Env>(\n deserializeEnv({\n ...initialEnv,\n ...environmentConfig\n }) as Env,\n {\n get: (target: EnvBase, propertyName: string) => { `}\n <hbr />\n\n <For each={reflectionGetProperties}>\n {(property: ReflectionProperty, index: number) => (\n <ConfigPropertyGet\n index={index}\n context={context}\n property={property}\n />\n )}\n </For>\n {code`\n return undefined;\n }, `}\n\n <hbr />\n <hbr />\n {code` set: (target: EnvBase, propertyName: string, newValue: any) => { `}\n <hbr />\n\n <For each={reflectionSetProperties} ender={code` else `}>\n {(property: ReflectionProperty, index: number) => (\n <ConfigPropertySet\n index={index}\n context={context}\n property={property}\n />\n )}\n </For>\n\n <hbr />\n {code`return false;\n }\n }\n );\n`}\n </FunctionDeclaration>\n </Show>\n <hbr />\n <hbr />\n <hbr />\n\n <TSDoc heading=\"The environment configuration object.\">\n <TSDocRemarks>\n {`This object provides access to the environment configuration parameters in the application runtime.`}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n refkey={envRefkey}\n name=\"env\"\n type=\"Env\"\n export={true}\n const={true}\n initializer={\n <>{code`createEnv(${defaultConfig || \"{}\"} as Partial<Env>);`}</>\n }\n />\n <hbr />\n <hbr />\n\n <VarDeclaration\n export\n const\n name=\"isCI\"\n doc=\"Detect if the application is running in a continuous integration (CI) environment.\"\n initializer={code`Boolean(\n env.CI ||\n env.RUN_ID ||\n env.AGOLA_GIT_REF ||\n env.AC_APPCIRCLE ||\n env.APPVEYOR ||\n env.CODEBUILD ||\n env.TF_BUILD ||\n env.bamboo_planKey ||\n env.BITBUCKET_COMMIT ||\n env.BITRISE_IO ||\n env.BUDDY_WORKSPACE_ID ||\n env.BUILDKITE ||\n env.CIRCLECI ||\n env.CIRRUS_CI ||\n env.CF_BUILD_ID ||\n env.CM_BUILD_ID ||\n env.CI_NAME ||\n env.DRONE ||\n env.DSARI ||\n env.EARTHLY_CI ||\n env.EAS_BUILD ||\n env.GERRIT_PROJECT ||\n env.GITEA_ACTIONS ||\n env.GITHUB_ACTIONS ||\n env.GITLAB_CI ||\n env.GOCD ||\n env.BUILDER_OUTPUT ||\n env.HARNESS_BUILD_ID ||\n env.JENKINS_URL ||\n env.LAYERCI ||\n env.MAGNUM ||\n env.NETLIFY ||\n env.NEVERCODE ||\n env.PROW_JOB_ID ||\n env.RELEASE_BUILD_ID ||\n env.RENDER ||\n env.SAILCI ||\n env.HUDSON ||\n env.SCREWDRIVER ||\n env.SEMAPHORE ||\n env.SOURCEHUT ||\n env.STRIDER ||\n env.TASK_ID ||\n env.RUN_ID ||\n env.TEAMCITY_VERSION ||\n env.TRAVIS ||\n env.VELA ||\n env.NOW_BUILDER ||\n env.APPCENTER_BUILD_ID ||\n env.CI_XCODE_PROJECT ||\n env.XCS || false\n );\n `}\n />\n <hbr />\n <hbr />\n\n <TSDoc heading=\"Detect the \\`mode\\` of the current runtime environment.\">\n <TSDocRemarks>\n {code`The \\`mode\\` is determined by the \\`MODE\\` environment variable, or falls back to the \\`NEXT_PUBLIC_VERCEL_ENV\\`, \\`NODE_ENV\\`, or defaults to \\`production\\`. While the value can potentially be any string, it is generally recommended to only allow a value in the following list:\n - \\`production\\`\n - \\`test\\`\n - \\`development\\`\n `}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n export\n const\n name=\"mode\"\n initializer={code`String(env.MODE) || \"production\"; `}\n />\n <hbr />\n <hbr />\n\n <VarDeclaration\n export\n const\n name=\"isProduction\"\n doc='Detect if the application is running in `\"production\"` mode'\n initializer={code`[\"prd\", \"prod\", \"production\"].includes(mode.toLowerCase()); `}\n />\n <hbr />\n <hbr />\n\n <VarDeclaration\n export\n const\n name=\"isTest\"\n doc='Detect if the application is running in `\"test\"` mode'\n initializer={code`[\"tst\", \"test\", \"testing\", \"stg\", \"stage\", \"staging\"].includes(mode.toLowerCase()) || env.TEST; `}\n />\n <hbr />\n <hbr />\n\n <VarDeclaration\n export\n const\n name=\"isDevelopment\"\n doc='Detect if the application is running in `\"development\"` mode'\n initializer={code`[\"dev\", \"development\"].includes(mode.toLowerCase()); `}\n />\n <hbr />\n <hbr />\n\n <VarDeclaration\n export\n const\n name=\"isDebug\"\n doc=\"Detect if the application is currently being debugged\"\n initializer={code`Boolean(isDevelopment && env.DEBUG); `}\n />\n <hbr />\n <hbr />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwEA,SAAgBgC,kBACdC,OACA;CACA,MAAM,CAAC,EAAEC,cAAcC,gBAAgB/B,WAAW6B,OAAO,CACvD,gBACA,aACD,CAAC;CAEF,MAAMG,UAAUrB,mBAAqC;AACrD,KAAI,CAACqB,QACH,QAAO;AAGT,QAAA;EAAAC,gBAEKZ,qBAAmB;GAClBa,MAAI;GACUJ;GACFC;GAAU,UACd;GAAI,CAAA;EAAAI,gBAAA,OAAA,EAAA,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAAF,gBAKbnB,OAAK;GAACsB,SAAO;GAAA,IAAAC,WAAA;AAAA,WAAAJ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