@powerlines/plugin-env 0.16.183 → 0.16.184

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -1
  2. package/dist/babel/index.cjs +4 -1
  3. package/dist/babel/index.mjs +3 -1
  4. package/dist/babel/plugin.cjs +137 -4
  5. package/dist/babel/plugin.mjs +135 -4
  6. package/dist/babel/plugin.mjs.map +1 -1
  7. package/dist/components/docs.cjs +111 -1
  8. package/dist/components/docs.mjs +108 -1
  9. package/dist/components/docs.mjs.map +1 -1
  10. package/dist/components/env-builtin.cjs +730 -13
  11. package/dist/components/env-builtin.mjs +726 -11
  12. package/dist/components/env-builtin.mjs.map +1 -1
  13. package/dist/components/index.cjs +9 -1
  14. package/dist/components/index.mjs +4 -1
  15. package/dist/helpers/automd-generator.cjs +32 -1
  16. package/dist/helpers/automd-generator.mjs +30 -1
  17. package/dist/helpers/automd-generator.mjs.map +1 -1
  18. package/dist/helpers/create-reflection-resource.cjs +23 -1
  19. package/dist/helpers/create-reflection-resource.mjs +22 -1
  20. package/dist/helpers/create-reflection-resource.mjs.map +1 -1
  21. package/dist/helpers/index.cjs +34 -1
  22. package/dist/helpers/index.mjs +8 -1
  23. package/dist/helpers/load.cjs +141 -1
  24. package/dist/helpers/load.d.cts +1 -1
  25. package/dist/helpers/load.d.mts +1 -1
  26. package/dist/helpers/load.mjs +137 -1
  27. package/dist/helpers/load.mjs.map +1 -1
  28. package/dist/helpers/persistence.cjs +308 -1
  29. package/dist/helpers/persistence.mjs +295 -1
  30. package/dist/helpers/persistence.mjs.map +1 -1
  31. package/dist/helpers/reflect.cjs +290 -1
  32. package/dist/helpers/reflect.mjs +280 -1
  33. package/dist/helpers/reflect.mjs.map +1 -1
  34. package/dist/helpers/source-file-env.cjs +59 -1
  35. package/dist/helpers/source-file-env.mjs +56 -1
  36. package/dist/helpers/source-file-env.mjs.map +1 -1
  37. package/dist/helpers/template-helpers.cjs +70 -1
  38. package/dist/helpers/template-helpers.mjs +68 -1
  39. package/dist/helpers/template-helpers.mjs.map +1 -1
  40. package/dist/index.cjs +310 -7
  41. package/dist/index.mjs +296 -7
  42. package/dist/index.mjs.map +1 -1
  43. package/dist/types/env.cjs +541 -1
  44. package/dist/types/env.mjs +538 -1
  45. package/dist/types/env.mjs.map +1 -1
  46. package/dist/types/index.cjs +11 -1
  47. package/dist/types/index.mjs +4 -1
  48. package/dist/types/plugin.cjs +115 -1
  49. package/dist/types/plugin.mjs +109 -1
  50. package/dist/types/plugin.mjs.map +1 -1
  51. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"env-builtin.mjs","names":[],"sources":["../../src/components/env-builtin.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 InterfaceDeclaration as BaseInterfaceDeclaration,\n ClassDeclaration,\n ClassMethod,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceMember,\n NewExpression,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport {\n ReflectionClass,\n ReflectionKind,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } 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 type { InterfaceDeclarationProps } from \"@powerlines/plugin-alloy/typescript/components/interface-declaration\";\nimport { InterfaceDeclaration } from \"@powerlines/plugin-alloy/typescript/components/interface-declaration\";\nimport { ObjectDeclaration } from \"@powerlines/plugin-alloy/typescript/components/object-declaration\";\nimport {\n TSDoc,\n TSDocExample,\n TSDocLink,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns,\n TSDocThrows\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TSDocReflectionProperty } from \"@powerlines/plugin-alloy/typescript/components/tsdoc-reflection\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport defu from \"defu\";\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<InterfaceDeclarationProps, \"name\">\n) {\n const [{ defaultValue, reflection }] = splitProps(props, [\n \"defaultValue\",\n \"reflection\"\n ]);\n\n const context = usePowerlines<EnvPluginContext>();\n\n return (\n <>\n <InterfaceDeclaration\n name=\"UnprefixedEnv\"\n defaultValue={defaultValue}\n reflection={reflection}\n export\n />\n <Spacing />\n <TSDoc heading=\"The environment configuration object with prefixed keys.\">\n <TSDocRemarks>\n {`The \\`Env\\` type extends the \\`UnprefixedEnv\\` 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 <BaseInterfaceDeclaration name=\"Env\" export extends=\"UnprefixedEnv\">\n <For\n each={getUnique(context.config.env.prefix).map(prefix =>\n prefix.replace(/_$/, \"\")\n )}\n doubleHardline>\n {prefix => (\n <For\n each={\n reflection\n ?.getProperties()\n .filter(property => !property.isIgnored()) ?? []\n }\n doubleHardline>\n {property => (\n <>\n <TSDocReflectionProperty reflection={property} />\n <InterfaceMember\n name={`${prefix}_${property.getNameAsString()}`}\n type={`UnprefixedEnv[\"${property.getNameAsString()}\"]`}\n readonly={property.isReadonly()}\n />\n </>\n )}\n </For>\n )}\n </For>\n </BaseInterfaceDeclaration>\n <Spacing />\n </>\n );\n}\n\ninterface ConfigPropertyConditionalProps extends ComponentProps {\n context: EnvPluginContext;\n name: string;\n}\n\nfunction ConfigPropertyConditional(props: ConfigPropertyConditionalProps) {\n const [{ context, name }] = splitProps(props, [\"context\", \"name\"]);\n\n return code`propertyName === \"${name}\" || propertyName.replace(/^(${getUnique(\n 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;\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 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 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 reflection: ReflectionClass<any>;\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, reflection, children }, rest] = splitProps(props, [\n \"defaultConfig\",\n \"reflection\",\n \"children\"\n ]);\n\n const context = usePowerlines<EnvPluginContext>();\n const defaultValue = computed(\n () => context && loadEnvFromContext(context, process.env)\n );\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\n );\n\n result\n .getProperties()\n .filter(\n property => property.isRuntime() || property.getTags().runtime === true\n )\n .forEach(property => {\n result.removeProperty(property.getNameAsString());\n });\n\n return result;\n });\n\n const reflectionGetProperties = computed(\n () =>\n reflection\n ?.getProperties()\n .filter(property => !property.isIgnored())\n .sort((a, b) =>\n a.getNameAsString().localeCompare(b.getNameAsString())\n ) ?? []\n );\n const reflectionSetProperties = computed(\n () =>\n reflection\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 \"serializeFunction\",\n \"deserializeFunction\",\n \"ReflectionKind\",\n \"Serializer\",\n \"NamingStrategy\",\n \"TemplateState\",\n \"Type\",\n \"TypeProperty\",\n \"TypePropertySignature\"\n ]\n },\n rest.imports ?? {}\n )}>\n <Show when={Boolean(reflection)}>\n <EnvTypeDefinition\n defaultValue={defaultValue}\n reflection={reflection}\n />\n <hbr />\n <hbr />\n </Show>\n\n <ObjectDeclaration\n name=\"initialEnv\"\n type=\"Partial<Env>\"\n defaultValue={defaultValue}\n reflection={envInstance}\n export\n const\n doc=\"The initial environment configuration object values for the runtime.\"\n />\n <Spacing />\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>\n <ClassMethod\n name=\"constructor\"\n public\n doc=\"Initializes a new instance of the `EnvSerializer` class.\">\n {code`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 </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n\n <VarDeclaration\n name=\"envNamingStrategy\"\n const\n doc=\"The environment naming strategy for the runtime.\"\n initializer={code`new class extends NamingStrategy {\n constructor() {\n super(\"env\");\n }\n\n getPropertyName(type: TypeProperty | TypePropertySignature, forSerializer: string): string | undefined {\n const name = super.getPropertyName(type, forSerializer);\n if (!name) {\n return name;\n }\n\n return name.replace(/^(${getUnique(\n context.config.env.prefix\n )\n .map(prefix => prefix.replace(/_$/, \"\"))\n .join(\"|\")})_/, \"\");\n }\n }; `}\n />\n <Spacing />\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 const\n initializer={<NewExpression args={[]} target=\"EnvSerializer\" />}\n />\n <Spacing />\n\n <VarDeclaration\n name=\"_serializeEnv\"\n const\n initializer={\"serializeFunction<Env>(envSerializer, envNamingStrategy)\"}\n />\n <Spacing />\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 <Spacing />\n <TSDocParam name=\"input\">\n {`The environment configuration object to serialize.`}\n </TSDocParam>\n <TSDocReturns>\n {`The serialized environment configuration as JSON data objects.`}\n </TSDocReturns>\n <TSDocThrows>\n {`ValidationError when serialization or validation fails.`}\n </TSDocThrows>\n </TSDoc>\n <FunctionDeclaration\n name=\"serializeEnv\"\n export\n parameters={[\n {\n name: \"input\",\n type: \"Env\"\n }\n ]}>\n {code` return _serializeEnv(input, { loosely: true }); `}\n </FunctionDeclaration>\n <Spacing />\n\n <VarDeclaration\n name=\"_deserializeEnv\"\n const\n initializer=\"deserializeFunction<Env>(envSerializer, envNamingStrategy)\"\n />\n <Spacing />\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 <FunctionDeclaration\n name=\"deserializeEnv\"\n export\n parameters={[\n {\n name: \"input\",\n type: \"Env\"\n }\n ]}>\n {code` return _deserializeEnv(input, { loosely: true }); `}\n </FunctionDeclaration>\n <Spacing />\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\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: UnprefixedEnv, 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 <Spacing />\n {code` set: (target: UnprefixedEnv, propertyName: string, newValue: any) => { `}\n <hbr />\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 <Spacing />\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\n const\n initializer={\n <>{code`createEnv(${defaultConfig || \"{}\"} as Partial<Env>);`}</>\n }\n />\n <Spacing />\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 <Spacing />\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 <Spacing />\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 <Spacing />\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 <Spacing />\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 <Spacing />\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 <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":"klDAEM,EAAU,CAAC,IAAI,IAAM,OAAQ,4BAAG,6DAItC,SAAS,EAAY,EAAI,EAAO,OAC/B,GAAI,OAAS,IAsCd,SAAS,EAAwB,EAAA,CACjC,GAAO,CAAA,CACL,eACA,eACK,EAAE,EAAW,CAAM,eAAO,aAAsB,CAAA,CAChD,GAAO,EAAA,EAAA,CAAA,KAA4B,EAAwB,KAAC,CAAK,CAAC,GAAW,EACpF,MAAS,CAAA,EAAA,EAAyC,CAClD,KAAS,gBACF,eACA,aACL,OAAY,GACZ,CAAA,CAAA,EAAS,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACT,QAAU,2DACV,IAAA,UAAY,CACZ,OAAA,EAAY,EAAA,CACZ,SAAA,kPACK,CAAC,EAER,CAAA,CAAM,EAAe,EAA0B,CAC/C,KAAS,MACT,OAAY,GACZ,QAAS,gBACT,IAAQ,UAAC,aAEP,IAAA,MAAA,CACC,OAAc,EAAA,EAAY,OAAa,IAAC,OAAU,CAAC,IAAA,EAAe,GAAI,EAAW,QAAO,KAAA,GAAA,CAAA,CAAA,SAAA,GAAA,UAAA,CAAA,CAAA,EAEpF,eAAS,GACR,IAAC,UAAK,CACZ,OAAA,EAAA,GAAA,EAAA,EAAA,CACS,IAAA,MAAY,CAClB,OAAa,GAAA,eAAA,CAAA,OAAA,EAAA,GAAA,CAAA,EAAA,WAAA,CAAA,CAAA,WAAA,GAAA,UAAA,CAAA,CAAA,EAAA,EAAA,EAEd,eA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EAEN,CAAC,CAAC,CAEL,EAAU,OAAI,KAAY,EAAA,QAAA,aAAA,6EAAA,aAAA"}
1
+ {"version":3,"file":"env-builtin.mjs","names":[],"sources":["../../src/components/env-builtin.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 InterfaceDeclaration as BaseInterfaceDeclaration,\n ClassDeclaration,\n ClassMethod,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceMember,\n NewExpression,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport {\n ReflectionClass,\n ReflectionKind,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } 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 type { InterfaceDeclarationProps } from \"@powerlines/plugin-alloy/typescript/components/interface-declaration\";\nimport { InterfaceDeclaration } from \"@powerlines/plugin-alloy/typescript/components/interface-declaration\";\nimport { ObjectDeclaration } from \"@powerlines/plugin-alloy/typescript/components/object-declaration\";\nimport {\n TSDoc,\n TSDocExample,\n TSDocLink,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns,\n TSDocThrows\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TSDocReflectionProperty } from \"@powerlines/plugin-alloy/typescript/components/tsdoc-reflection\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport defu from \"defu\";\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<InterfaceDeclarationProps, \"name\">\n) {\n const [{ defaultValue, reflection }] = splitProps(props, [\n \"defaultValue\",\n \"reflection\"\n ]);\n\n const context = usePowerlines<EnvPluginContext>();\n\n return (\n <>\n <InterfaceDeclaration\n name=\"UnprefixedEnv\"\n defaultValue={defaultValue}\n reflection={reflection}\n export\n />\n <Spacing />\n <TSDoc heading=\"The environment configuration object with prefixed keys.\">\n <TSDocRemarks>\n {`The \\`Env\\` type extends the \\`UnprefixedEnv\\` 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 <BaseInterfaceDeclaration name=\"Env\" export extends=\"UnprefixedEnv\">\n <For\n each={getUnique(context.config.env.prefix).map(prefix =>\n prefix.replace(/_$/, \"\")\n )}\n doubleHardline>\n {prefix => (\n <For\n each={\n reflection\n ?.getProperties()\n .filter(property => !property.isIgnored()) ?? []\n }\n doubleHardline>\n {property => (\n <>\n <TSDocReflectionProperty reflection={property} />\n <InterfaceMember\n name={`${prefix}_${property.getNameAsString()}`}\n type={`UnprefixedEnv[\"${property.getNameAsString()}\"]`}\n readonly={property.isReadonly()}\n />\n </>\n )}\n </For>\n )}\n </For>\n </BaseInterfaceDeclaration>\n <Spacing />\n </>\n );\n}\n\ninterface ConfigPropertyConditionalProps extends ComponentProps {\n context: EnvPluginContext;\n name: string;\n}\n\nfunction ConfigPropertyConditional(props: ConfigPropertyConditionalProps) {\n const [{ context, name }] = splitProps(props, [\"context\", \"name\"]);\n\n return code`propertyName === \"${name}\" || propertyName.replace(/^(${getUnique(\n 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;\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 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 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 reflection: ReflectionClass<any>;\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, reflection, children }, rest] = splitProps(props, [\n \"defaultConfig\",\n \"reflection\",\n \"children\"\n ]);\n\n const context = usePowerlines<EnvPluginContext>();\n const defaultValue = computed(\n () => context && loadEnvFromContext(context, process.env)\n );\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\n );\n\n result\n .getProperties()\n .filter(\n property => property.isRuntime() || property.getTags().runtime === true\n )\n .forEach(property => {\n result.removeProperty(property.getNameAsString());\n });\n\n return result;\n });\n\n const reflectionGetProperties = computed(\n () =>\n reflection\n ?.getProperties()\n .filter(property => !property.isIgnored())\n .sort((a, b) =>\n a.getNameAsString().localeCompare(b.getNameAsString())\n ) ?? []\n );\n const reflectionSetProperties = computed(\n () =>\n reflection\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 \"serializeFunction\",\n \"deserializeFunction\",\n \"ReflectionKind\",\n \"Serializer\",\n \"NamingStrategy\",\n \"TemplateState\",\n \"Type\",\n \"TypeProperty\",\n \"TypePropertySignature\"\n ]\n },\n rest.imports ?? {}\n )}>\n <Show when={Boolean(reflection)}>\n <EnvTypeDefinition\n defaultValue={defaultValue}\n reflection={reflection}\n />\n <hbr />\n <hbr />\n </Show>\n\n <ObjectDeclaration\n name=\"initialEnv\"\n type=\"Partial<Env>\"\n defaultValue={defaultValue}\n reflection={envInstance}\n export\n const\n doc=\"The initial environment configuration object values for the runtime.\"\n />\n <Spacing />\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>\n <ClassMethod\n name=\"constructor\"\n public\n doc=\"Initializes a new instance of the `EnvSerializer` class.\">\n {code`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 </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n\n <VarDeclaration\n name=\"envNamingStrategy\"\n const\n doc=\"The environment naming strategy for the runtime.\"\n initializer={code`new class extends NamingStrategy {\n constructor() {\n super(\"env\");\n }\n\n getPropertyName(type: TypeProperty | TypePropertySignature, forSerializer: string): string | undefined {\n const name = super.getPropertyName(type, forSerializer);\n if (!name) {\n return name;\n }\n\n return name.replace(/^(${getUnique(\n context.config.env.prefix\n )\n .map(prefix => prefix.replace(/_$/, \"\"))\n .join(\"|\")})_/, \"\");\n }\n }; `}\n />\n <Spacing />\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 const\n initializer={<NewExpression args={[]} target=\"EnvSerializer\" />}\n />\n <Spacing />\n\n <VarDeclaration\n name=\"_serializeEnv\"\n const\n initializer={\"serializeFunction<Env>(envSerializer, envNamingStrategy)\"}\n />\n <Spacing />\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 <Spacing />\n <TSDocParam name=\"input\">\n {`The environment configuration object to serialize.`}\n </TSDocParam>\n <TSDocReturns>\n {`The serialized environment configuration as JSON data objects.`}\n </TSDocReturns>\n <TSDocThrows>\n {`ValidationError when serialization or validation fails.`}\n </TSDocThrows>\n </TSDoc>\n <FunctionDeclaration\n name=\"serializeEnv\"\n export\n parameters={[\n {\n name: \"input\",\n type: \"Env\"\n }\n ]}>\n {code` return _serializeEnv(input, { loosely: true }); `}\n </FunctionDeclaration>\n <Spacing />\n\n <VarDeclaration\n name=\"_deserializeEnv\"\n const\n initializer=\"deserializeFunction<Env>(envSerializer, envNamingStrategy)\"\n />\n <Spacing />\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 <FunctionDeclaration\n name=\"deserializeEnv\"\n export\n parameters={[\n {\n name: \"input\",\n type: \"Env\"\n }\n ]}>\n {code` return _deserializeEnv(input, { loosely: true }); `}\n </FunctionDeclaration>\n <Spacing />\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\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: UnprefixedEnv, 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 <Spacing />\n {code` set: (target: UnprefixedEnv, propertyName: string, newValue: any) => { `}\n <hbr />\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 <Spacing />\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\n const\n initializer={\n <>{code`createEnv(${defaultConfig || \"{}\"} as Partial<Env>);`}</>\n }\n />\n <Spacing />\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 <Spacing />\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 <Spacing />\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 <Spacing />\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 <Spacing />\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 <Spacing />\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 <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;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=require(`./env-builtin.cjs`);exports.EnvBuiltin=t.EnvBuiltin,exports.EnvDocsFile=e.EnvDocsFile,exports.EnvTypeDefinition=t.EnvTypeDefinition,exports.__ΩEnvBuiltinProps=t.__ΩEnvBuiltinProps,exports.__ΩEnvDocsFileProps=e.__ΩEnvDocsFileProps;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_components_docs = require('./docs.cjs');
3
+ const require_components_env_builtin = require('./env-builtin.cjs');
4
+
5
+ exports.EnvBuiltin = require_components_env_builtin.EnvBuiltin;
6
+ exports.EnvDocsFile = require_components_docs.EnvDocsFile;
7
+ exports.EnvTypeDefinition = require_components_env_builtin.EnvTypeDefinition;
8
+ exports.__ΩEnvBuiltinProps = require_components_env_builtin.__ΩEnvBuiltinProps;
9
+ exports.__ΩEnvDocsFileProps = require_components_docs.__ΩEnvDocsFileProps;
@@ -1 +1,4 @@
1
- import{EnvDocsFile as e,__ΩEnvDocsFileProps as t}from"./docs.mjs";import{EnvBuiltin as n,EnvTypeDefinition as r,__ΩEnvBuiltinProps as i}from"./env-builtin.mjs";export{n as EnvBuiltin,e as EnvDocsFile,r as EnvTypeDefinition,i as __ΩEnvBuiltinProps,t as __ΩEnvDocsFileProps};
1
+ import { EnvDocsFile, __ΩEnvDocsFileProps } from "./docs.mjs";
2
+ import { EnvBuiltin, EnvTypeDefinition, __ΩEnvBuiltinProps } from "./env-builtin.mjs";
3
+
4
+ export { EnvBuiltin, EnvDocsFile, EnvTypeDefinition, __ΩEnvBuiltinProps, __ΩEnvDocsFileProps };
@@ -1 +1,32 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@stryke/path/join-paths`),t=require(`automd`),n=require(`powerlines/plugin-utils`);function r(e,t){return e.__type=t,e}const i=r(i=>(0,t.defineGenerator)({name:`env`,generate:r(async function(){let t=(0,e.joinPaths)((0,n.getDocsOutputPath)(i.config.root),`env.md`);return i.fs.existsSync(t)?{contents:await i.fs.read(t)||``}:{contents:``}},[`generate`,`P"/!`])}),[`context`,``,`P!2!"/"`]);exports.env=i;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _stryke_path_join_paths = require("@stryke/path/join-paths");
4
+ let automd = require("automd");
5
+ let powerlines_plugin_utils = require("powerlines/plugin-utils");
6
+
7
+ //#region src/helpers/automd-generator.ts
8
+ function __assignType(fn, args) {
9
+ fn.__type = args;
10
+ return fn;
11
+ }
12
+ /**
13
+ * AutoMD generator to generate environment variable documentation
14
+ *
15
+ * @param context - The generator context.
16
+ * @returns The generated documentation content.
17
+ */
18
+ const env = __assignType((context) => (0, automd.defineGenerator)({
19
+ name: "env",
20
+ generate: __assignType(async function generate() {
21
+ const envDocFile = (0, _stryke_path_join_paths.joinPaths)((0, powerlines_plugin_utils.getDocsOutputPath)(context.config.root), "env.md");
22
+ if (!context.fs.existsSync(envDocFile)) return { contents: "" };
23
+ return { contents: await context.fs.read(envDocFile) || "" };
24
+ }, ["generate", "P\"/!"])
25
+ }), [
26
+ "context",
27
+ "",
28
+ "P!2!\"/\""
29
+ ]);
30
+
31
+ //#endregion
32
+ exports.env = env;
@@ -1,2 +1,31 @@
1
- import{joinPaths as e}from"@stryke/path/join-paths";import{defineGenerator as t}from"automd";import{getDocsOutputPath as n}from"powerlines/plugin-utils";function r(e,t){return e.__type=t,e}const i=r(i=>t({name:`env`,generate:r(async function(){let t=e(n(i.config.root),`env.md`);return i.fs.existsSync(t)?{contents:await i.fs.read(t)||``}:{contents:``}},[`generate`,`P"/!`])}),[`context`,``,`P!2!"/"`]);export{i as env};
1
+ import { joinPaths } from "@stryke/path/join-paths";
2
+ import { defineGenerator } from "automd";
3
+ import { getDocsOutputPath } from "powerlines/plugin-utils";
4
+
5
+ //#region src/helpers/automd-generator.ts
6
+ function __assignType(fn, args) {
7
+ fn.__type = args;
8
+ return fn;
9
+ }
10
+ /**
11
+ * AutoMD generator to generate environment variable documentation
12
+ *
13
+ * @param context - The generator context.
14
+ * @returns The generated documentation content.
15
+ */
16
+ const env = __assignType((context) => defineGenerator({
17
+ name: "env",
18
+ generate: __assignType(async function generate() {
19
+ const envDocFile = joinPaths(getDocsOutputPath(context.config.root), "env.md");
20
+ if (!context.fs.existsSync(envDocFile)) return { contents: "" };
21
+ return { contents: await context.fs.read(envDocFile) || "" };
22
+ }, ["generate", "P\"/!"])
23
+ }), [
24
+ "context",
25
+ "",
26
+ "P!2!\"/\""
27
+ ]);
28
+
29
+ //#endregion
30
+ export { env };
2
31
  //# sourceMappingURL=automd-generator.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"automd-generator.mjs","names":[],"sources":["../../src/helpers/automd-generator.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 { joinPaths } from \"@stryke/path/join-paths\";\nimport { defineGenerator } from \"automd\";\nimport { UnresolvedContext } from \"powerlines\";\nimport { getDocsOutputPath } from \"powerlines/plugin-utils\";\n\n/**\n * AutoMD generator to generate environment variable documentation\n *\n * @param context - The generator context.\n * @returns The generated documentation content.\n */\nexport const env = (context: UnresolvedContext) =>\n defineGenerator({\n name: \"env\",\n async generate() {\n const envDocFile = joinPaths(\n getDocsOutputPath(context.config.root),\n \"env.md\"\n );\n\n if (!context.fs.existsSync(envDocFile)) {\n return {\n contents: \"\"\n };\n }\n\n const contents = await context.fs.read(envDocFile);\n\n return {\n contents: contents || \"\"\n };\n }\n });\n"],"mappings":"yJAAA,SAAS,EAAa,EAAI,EAAM,CAE9B,kBAAO,EA4BT,MAAE,EAAgB,EAAA,GAAA,EAAA,CAChB,KAAM,MACN,SAAQ,EAAW,gBAAA,CACjB,IAAE,EAAiB,EAAE,EAAS,EAAA,OAAA,KAAA,CAAA,SAAA,CAO9B,OANI,EAAA,GAAA,WAAkB,EAAe,CAM/B,CACJ,SAAG,MAFM,EAAA,GAAA,KAAA,EAAA,EAEN,GACJ,CAPQ,CACN,SAAA,GAAA,uBAQN,CAAC,CAAE,CAAC,UAAO,GAAQ,UAAS,CAAA"}
1
+ {"version":3,"file":"automd-generator.mjs","names":[],"sources":["../../src/helpers/automd-generator.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 { joinPaths } from \"@stryke/path/join-paths\";\nimport { defineGenerator } from \"automd\";\nimport { UnresolvedContext } from \"powerlines\";\nimport { getDocsOutputPath } from \"powerlines/plugin-utils\";\n\n/**\n * AutoMD generator to generate environment variable documentation\n *\n * @param context - The generator context.\n * @returns The generated documentation content.\n */\nexport const env = (context: UnresolvedContext) =>\n defineGenerator({\n name: \"env\",\n async generate() {\n const envDocFile = joinPaths(\n getDocsOutputPath(context.config.root),\n \"env.md\"\n );\n\n if (!context.fs.existsSync(envDocFile)) {\n return {\n contents: \"\"\n };\n }\n\n const contents = await context.fs.read(envDocFile);\n\n return {\n contents: contents || \"\"\n };\n }\n });\n"],"mappings":";;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE9B,QAAO;;;;;;;;AA4BT,MAAE,MAAgB,cAAA,YAAA,gBAAA;CAChB,MAAM;CACN,UAAQ,aAAW,eAAA,WAAA;EACjB,MAAE,aAAiB,UAAE,kBAAS,QAAA,OAAA,KAAA,EAAA,SAAA;AAC9B,MAAI,CAAA,QAAA,GAAA,WAAkB,WAAe,CACnC,QAAO,EACN,UAAA;AAIH,SAAM,EACJ,UAAG,MAFM,QAAA,GAAA,KAAA,WAAA,IAEN,IACJ;;CAEJ,CAAC,EAAE;CAAC;CAAO;CAAQ;CAAS,CAAA"}
@@ -1 +1,23 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../types/plugin.cjs`);function t(e){return{}}t.__type=[()=>e.__ΩEnvPluginContext,`_context`,`createReflection`,`Creates a reflection resource for the environment configuration.`,`Pn!2""/#?$`],exports.createReflection=t;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_types_plugin = require('../types/plugin.cjs');
3
+
4
+ //#region src/helpers/create-reflection-resource.ts
5
+ /**
6
+ * Creates a reflection resource for the environment configuration.
7
+ *
8
+ * @param _context - The environment plugin context.
9
+ * @returns A resource that provides the reflection of the environment configuration.
10
+ */
11
+ function createReflection(_context) {
12
+ return {};
13
+ }
14
+ createReflection.__type = [
15
+ () => require_types_plugin.__ΩEnvPluginContext,
16
+ "_context",
17
+ "createReflection",
18
+ "Creates a reflection resource for the environment configuration.",
19
+ "Pn!2\"\"/#?$"
20
+ ];
21
+
22
+ //#endregion
23
+ exports.createReflection = createReflection;
@@ -1,2 +1,23 @@
1
- import{__ΩEnvPluginContext as e}from"../types/plugin.mjs";function t(e){return{}}t.__type=[()=>e,`_context`,`createReflection`,`Creates a reflection resource for the environment configuration.`,`Pn!2""/#?$`];export{t as createReflection};
1
+ import { __ΩEnvPluginContext } from "../types/plugin.mjs";
2
+
3
+ //#region src/helpers/create-reflection-resource.ts
4
+ /**
5
+ * Creates a reflection resource for the environment configuration.
6
+ *
7
+ * @param _context - The environment plugin context.
8
+ * @returns A resource that provides the reflection of the environment configuration.
9
+ */
10
+ function createReflection(_context) {
11
+ return {};
12
+ }
13
+ createReflection.__type = [
14
+ () => __ΩEnvPluginContext,
15
+ "_context",
16
+ "createReflection",
17
+ "Creates a reflection resource for the environment configuration.",
18
+ "Pn!2\"\"/#?$"
19
+ ];
20
+
21
+ //#endregion
22
+ export { createReflection };
2
23
  //# sourceMappingURL=create-reflection-resource.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-reflection-resource.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 { EnvPluginContext } from \"../types/plugin\";\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 createReflection(_context: EnvPluginContext) {\n // const defaultValue = computed(\n // () => context && loadEnvFromContext(context, process.env)\n // );\n\n return {};\n\n // return computed(() => {\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}\n"],"mappings":"wEAYC,MAAQ,EAAE,CA4CX,EAAe,OAAQ,KAAK,EAAU,WAAA,mBAAA,mEAAA,aAAA"}
1
+ {"version":3,"file":"create-reflection-resource.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 { EnvPluginContext } from \"../types/plugin\";\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 createReflection(_context: EnvPluginContext) {\n // const defaultValue = computed(\n // () => context && loadEnvFromContext(context, process.env)\n // );\n\n return {};\n\n // return computed(() => {\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}\n"],"mappings":";;;;;;;;;;AAYC,QAAQ,EAAE;;AA4CX,iBAAe,SAAQ;OAAK;CAAU;CAAA;CAAA;CAAA;CAAA"}
@@ -1 +1,34 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./reflect.cjs`),t=require(`./persistence.cjs`),n=require(`./template-helpers.cjs`),r=require(`./source-file-env.cjs`),i=require(`./load.cjs`),a=require(`./create-reflection-resource.cjs`);exports.BaseEnv=e.BaseEnv,exports.BaseSecrets=e.BaseSecrets,exports.__ΩCreateEnvReflectionOptions=e.__ΩCreateEnvReflectionOptions,exports.createEnvReflection=e.createEnvReflection,exports.createReflection=a.createReflection,exports.createSecretsReflection=e.createSecretsReflection,exports.createTemplateReflection=n.createTemplateReflection,exports.formatEnvField=r.formatEnvField,exports.getEnvDefaultTypeDefinition=t.getEnvDefaultTypeDefinition,exports.getEnvReflectionsPath=t.getEnvReflectionsPath,exports.getEnvTypeReflectionsPath=t.getEnvTypeReflectionsPath,exports.getSecretsDefaultTypeDefinition=t.getSecretsDefaultTypeDefinition,exports.loadEnv=i.loadEnv,exports.loadEnvFromContext=i.loadEnvFromContext,exports.mergeEnvReflections=e.mergeEnvReflections,exports.mergeSecretsReflections=e.mergeSecretsReflections,exports.readEnvReflection=t.readEnvReflection,exports.readEnvTypeReflection=t.readEnvTypeReflection,exports.readSecretsReflection=t.readSecretsReflection,exports.reflectEnv=e.reflectEnv,exports.reflectSecrets=e.reflectSecrets,exports.removeEnvPrefix=r.removeEnvPrefix,exports.resolveRuntimeTypeFile=t.resolveRuntimeTypeFile,exports.writeEnvReflection=t.writeEnvReflection,exports.writeEnvReflectionSync=t.writeEnvReflectionSync,exports.writeEnvTypeReflection=t.writeEnvTypeReflection;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_helpers_reflect = require('./reflect.cjs');
3
+ const require_helpers_persistence = require('./persistence.cjs');
4
+ const require_helpers_template_helpers = require('./template-helpers.cjs');
5
+ const require_helpers_source_file_env = require('./source-file-env.cjs');
6
+ const require_helpers_load = require('./load.cjs');
7
+ const require_helpers_create_reflection_resource = require('./create-reflection-resource.cjs');
8
+
9
+ exports.BaseEnv = require_helpers_reflect.BaseEnv;
10
+ exports.BaseSecrets = require_helpers_reflect.BaseSecrets;
11
+ exports.__ΩCreateEnvReflectionOptions = require_helpers_reflect.__ΩCreateEnvReflectionOptions;
12
+ exports.createEnvReflection = require_helpers_reflect.createEnvReflection;
13
+ exports.createReflection = require_helpers_create_reflection_resource.createReflection;
14
+ exports.createSecretsReflection = require_helpers_reflect.createSecretsReflection;
15
+ exports.createTemplateReflection = require_helpers_template_helpers.createTemplateReflection;
16
+ exports.formatEnvField = require_helpers_source_file_env.formatEnvField;
17
+ exports.getEnvDefaultTypeDefinition = require_helpers_persistence.getEnvDefaultTypeDefinition;
18
+ exports.getEnvReflectionsPath = require_helpers_persistence.getEnvReflectionsPath;
19
+ exports.getEnvTypeReflectionsPath = require_helpers_persistence.getEnvTypeReflectionsPath;
20
+ exports.getSecretsDefaultTypeDefinition = require_helpers_persistence.getSecretsDefaultTypeDefinition;
21
+ exports.loadEnv = require_helpers_load.loadEnv;
22
+ exports.loadEnvFromContext = require_helpers_load.loadEnvFromContext;
23
+ exports.mergeEnvReflections = require_helpers_reflect.mergeEnvReflections;
24
+ exports.mergeSecretsReflections = require_helpers_reflect.mergeSecretsReflections;
25
+ exports.readEnvReflection = require_helpers_persistence.readEnvReflection;
26
+ exports.readEnvTypeReflection = require_helpers_persistence.readEnvTypeReflection;
27
+ exports.readSecretsReflection = require_helpers_persistence.readSecretsReflection;
28
+ exports.reflectEnv = require_helpers_reflect.reflectEnv;
29
+ exports.reflectSecrets = require_helpers_reflect.reflectSecrets;
30
+ exports.removeEnvPrefix = require_helpers_source_file_env.removeEnvPrefix;
31
+ exports.resolveRuntimeTypeFile = require_helpers_persistence.resolveRuntimeTypeFile;
32
+ exports.writeEnvReflection = require_helpers_persistence.writeEnvReflection;
33
+ exports.writeEnvReflectionSync = require_helpers_persistence.writeEnvReflectionSync;
34
+ exports.writeEnvTypeReflection = require_helpers_persistence.writeEnvTypeReflection;
@@ -1 +1,8 @@
1
- import{BaseEnv as e,BaseSecrets as t,__ΩCreateEnvReflectionOptions as n,createEnvReflection as r,createSecretsReflection as i,mergeEnvReflections as a,mergeSecretsReflections as o,reflectEnv as s,reflectSecrets as c}from"./reflect.mjs";import{getEnvDefaultTypeDefinition as l,getEnvReflectionsPath as u,getEnvTypeReflectionsPath as d,getSecretsDefaultTypeDefinition as f,readEnvReflection as p,readEnvTypeReflection as m,readSecretsReflection as h,resolveRuntimeTypeFile as g,writeEnvReflection as _,writeEnvReflectionSync as v,writeEnvTypeReflection as y}from"./persistence.mjs";import{createTemplateReflection as b}from"./template-helpers.mjs";import{formatEnvField as x,removeEnvPrefix as S}from"./source-file-env.mjs";import{loadEnv as C,loadEnvFromContext as w}from"./load.mjs";import{createReflection as T}from"./create-reflection-resource.mjs";export{e as BaseEnv,t as BaseSecrets,n as __ΩCreateEnvReflectionOptions,r as createEnvReflection,T as createReflection,i as createSecretsReflection,b as createTemplateReflection,x as formatEnvField,l as getEnvDefaultTypeDefinition,u as getEnvReflectionsPath,d as getEnvTypeReflectionsPath,f as getSecretsDefaultTypeDefinition,C as loadEnv,w as loadEnvFromContext,a as mergeEnvReflections,o as mergeSecretsReflections,p as readEnvReflection,m as readEnvTypeReflection,h as readSecretsReflection,s as reflectEnv,c as reflectSecrets,S as removeEnvPrefix,g as resolveRuntimeTypeFile,_ as writeEnvReflection,v as writeEnvReflectionSync,y as writeEnvTypeReflection};
1
+ import { BaseEnv, BaseSecrets, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from "./reflect.mjs";
2
+ import { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection } from "./persistence.mjs";
3
+ import { createTemplateReflection } from "./template-helpers.mjs";
4
+ import { formatEnvField, removeEnvPrefix } from "./source-file-env.mjs";
5
+ import { loadEnv, loadEnvFromContext } from "./load.mjs";
6
+ import { createReflection } from "./create-reflection-resource.mjs";
7
+
8
+ export { BaseEnv, BaseSecrets, __ΩCreateEnvReflectionOptions, createEnvReflection, createReflection, createSecretsReflection, createTemplateReflection, formatEnvField, getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, loadEnv, loadEnvFromContext, mergeEnvReflections, mergeSecretsReflections, readEnvReflection, readEnvTypeReflection, readSecretsReflection, reflectEnv, reflectSecrets, removeEnvPrefix, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
@@ -1 +1,141 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../types/plugin.cjs`),n=require(`./source-file-env.cjs`);let r=require(`@stryke/path/join-paths`),i=require(`@storm-software/config-tools/get-config`),a=require(`@stryke/env/environment-checks`),o=require(`@stryke/env/load-env`),s=require(`@stryke/string-format/kebab-case`),c=require(`@stryke/type-checks/is-set-object`),l=require(`c12`),u=require(`defu`);u=e.__toESM(u,1);let d=require(`powerlines/constants`);function f(e,t){return e.__type=t,e}async function p(e,t,r){let i=await(0,o.loadEnv)(r,t);if(e.additionalFiles&&e.additionalFiles?.length>0){let t=await Promise.all(e.additionalFiles.map(f(async e=>(0,o.loadEnvFile)(e,r),[`additionalEnvFile`,``,`P"2!"/"`])));for(let e of t)i=(0,u.default)(e,i)}return n.removeEnvPrefix(i)}p.__type=[()=>t.__ΩEnvPluginOptions,`options`,`mode`,`cwd`,`loadEnvFiles`,'Pn!2"&2#&2$"`/%'];async function m(e,t,n,i,a,o,s){let[c,d]=await Promise.all([(p.Ω=[[`!`]],p(t,i,n)),(0,l.loadConfig)({cwd:n,name:e.config.framework,envName:i,defaults:{NAME:s?.namespace&&o.name?o.name?.replace(`@${s.namespace}/`,``):e.config.name,MODE:i,ORG:e.config.organization||s?.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:(0,r.joinPaths)(a,`jiti`),moduleCache:!0}})]);return(0,u.default)(c,d.config,s)}m.__type=[()=>t.__ΩEnvPluginContext,`context`,()=>t.__ΩEnvPluginOptions,`options`,`directory`,`mode`,`cacheDir`,`packageJson`,`workspaceConfig`,`loadEnvDirectory`,`Pn!2"n#2$&2%&2&&2'!2(!2)8"\`/*`];function h(e,t,n){return(0,u.default)({APP_NAME:(0,s.kebabCase)(e.config.name),APP_VERSION:e.packageJson.version,BUILD_ID:e.meta.buildId,BUILD_TIMESTAMP:new Date(e.meta.timestamp).toISOString(),BUILD_CHECKSUM:e.meta.checksum,RELEASE_ID:e.meta.releaseId,RELEASE_TAG:`${(0,s.kebabCase)(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:n?.locale,DEFAULT_TIMEZONE:n?.timezone,LOG_LEVEL:e.config.logLevel.general===`trace`?`debug`:e.config.logLevel.general,ERROR_URL:n?.error?.url,ORGANIZATION:e.config.organization||((0,c.isSetObject)(n?.organization)?n.organization.name:n?.organization),PLATFORM:e.config.platform,MODE:(0,a.toMode)(e.config.mode),TEST:(0,a.isTestMode)(e.config.mode),DEBUG:(0,a.isDevelopmentMode)(e.config.mode),STACKTRACE:e.config.mode!==`production`,RUNTIME:e.config.environment.runtime,ENVIRONMENT:!e.config.environment.name||e.config.environment.name===d.DEFAULT_ENVIRONMENT?e.config.mode:e.config.environment.name},(0,c.isSetObject)(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce(f((e,n)=>(e[n.name]=t[n.name]??n.getDefaultValue(),e),[`ret`,`prop`,``,`P"2!"2""/#`]),{}):{})}h.__type=[()=>t.__ΩEnvPluginContext,`context`,`parsed`,`workspaceConfig`,`loadEnvFromContext`,`Retrieves various dotenv configuration parameters from the context.`,`Pn!2"!2#!2$8"/%?&`];async function g(e,t){let n=await(0,i.tryGetWorkspaceConfig)(),[r,a,o]=await Promise.all([(m.Ω=[[`!`]],m(e,t,e.config.root,e.config.mode,e.cachePath,e.packageJson,n)),(m.Ω=[[`!`]],m(e,t,e.config.cwd,e.config.mode,e.cachePath,e.packageJson,n)),(m.Ω=[[`!`]],m(e,t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,n))]);return(0,u.default)(h(e,process.env,n),r,a,o)}g.__type=[()=>t.__ΩEnvPluginContext,`context`,()=>t.__ΩEnvPluginOptions,`options`,`loadEnv`,'Pn!2"n#2$"`/%'],exports.loadEnv=g,exports.loadEnvFromContext=h;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_types_plugin = require('../types/plugin.cjs');
4
+ const require_helpers_source_file_env = require('./source-file-env.cjs');
5
+ let _stryke_path_join_paths = require("@stryke/path/join-paths");
6
+ let _storm_software_config_tools_get_config = require("@storm-software/config-tools/get-config");
7
+ let _stryke_env_environment_checks = require("@stryke/env/environment-checks");
8
+ let _stryke_env_load_env = require("@stryke/env/load-env");
9
+ let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
10
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
11
+ let c12 = require("c12");
12
+ let defu = require("defu");
13
+ defu = require_runtime.__toESM(defu, 1);
14
+ let powerlines_constants = require("powerlines/constants");
15
+
16
+ //#region src/helpers/load.ts
17
+ function __assignType(fn, args) {
18
+ fn.__type = args;
19
+ return fn;
20
+ }
21
+ async function loadEnvFiles(options, mode, cwd) {
22
+ let env = await (0, _stryke_env_load_env.loadEnv)(cwd, mode);
23
+ if (options.additionalFiles && options.additionalFiles?.length > 0) {
24
+ const additionalEnvFiles = await Promise.all(options.additionalFiles.map(__assignType(async (additionalEnvFile) => (0, _stryke_env_load_env.loadEnvFile)(additionalEnvFile, cwd), [
25
+ "additionalEnvFile",
26
+ "",
27
+ "P\"2!\"/\""
28
+ ])));
29
+ for (const additionalEnvFile of additionalEnvFiles) env = (0, defu.default)(additionalEnvFile, env);
30
+ }
31
+ return require_helpers_source_file_env.removeEnvPrefix(env);
32
+ }
33
+ loadEnvFiles.__type = [
34
+ () => require_types_plugin.__ΩEnvPluginOptions,
35
+ "options",
36
+ "mode",
37
+ "cwd",
38
+ "loadEnvFiles",
39
+ "Pn!2\"&2#&2$\"`/%"
40
+ ];
41
+ async function loadEnvDirectory(context, options, directory, mode, cacheDir, packageJson, workspaceConfig) {
42
+ const [envResult, c12Result] = await Promise.all([(loadEnvFiles.Ω = [["!"]], loadEnvFiles(options, mode, directory)), (0, c12.loadConfig)({
43
+ cwd: directory,
44
+ name: context.config.framework,
45
+ envName: mode,
46
+ defaults: {
47
+ NAME: workspaceConfig?.namespace && packageJson.name ? packageJson.name?.replace(`@${workspaceConfig.namespace}/`, "") : context.config.name,
48
+ MODE: mode,
49
+ ORG: context.config.organization || workspaceConfig?.organization
50
+ },
51
+ globalRc: true,
52
+ packageJson: true,
53
+ dotenv: true,
54
+ jitiOptions: {
55
+ fsCache: (0, _stryke_path_join_paths.joinPaths)(cacheDir, "jiti"),
56
+ moduleCache: true
57
+ }
58
+ })]);
59
+ return (0, defu.default)(envResult, c12Result.config, workspaceConfig);
60
+ }
61
+ loadEnvDirectory.__type = [
62
+ () => require_types_plugin.__ΩEnvPluginContext,
63
+ "context",
64
+ () => require_types_plugin.__ΩEnvPluginOptions,
65
+ "options",
66
+ "directory",
67
+ "mode",
68
+ "cacheDir",
69
+ "packageJson",
70
+ "workspaceConfig",
71
+ "loadEnvDirectory",
72
+ "Pn!2\"n#2$&2%&2&&2'!2(!2)8\"`/*"
73
+ ];
74
+ /**
75
+ * Retrieves various dotenv configuration parameters from the context.
76
+ *
77
+ * @param context - The context to retrieve the dotenv configuration from.
78
+ * @param parsed - The parsed dotenv configuration.
79
+ * @returns An object containing the dotenv configuration.
80
+ */
81
+ function loadEnvFromContext(context, parsed, workspaceConfig) {
82
+ return (0, defu.default)({
83
+ APP_NAME: (0, _stryke_string_format_kebab_case.kebabCase)(context.config.name),
84
+ APP_VERSION: context.packageJson.version,
85
+ BUILD_ID: context.meta.buildId,
86
+ BUILD_TIMESTAMP: new Date(context.meta.timestamp).toISOString(),
87
+ BUILD_CHECKSUM: context.meta.checksum,
88
+ RELEASE_ID: context.meta.releaseId,
89
+ RELEASE_TAG: `${(0, _stryke_string_format_kebab_case.kebabCase)(context.config.name)}@${context.packageJson.version}`,
90
+ DEFAULT_LOCALE: workspaceConfig?.locale,
91
+ DEFAULT_TIMEZONE: workspaceConfig?.timezone,
92
+ LOG_LEVEL: context.config.logLevel.general === "trace" ? "debug" : context.config.logLevel.general,
93
+ ERROR_URL: workspaceConfig?.error?.url,
94
+ ORGANIZATION: context.config.organization || ((0, _stryke_type_checks_is_set_object.isSetObject)(workspaceConfig?.organization) ? workspaceConfig.organization.name : workspaceConfig?.organization),
95
+ PLATFORM: context.config.platform,
96
+ MODE: (0, _stryke_env_environment_checks.toMode)(context.config.mode),
97
+ TEST: (0, _stryke_env_environment_checks.isTestMode)(context.config.mode),
98
+ DEBUG: (0, _stryke_env_environment_checks.isDevelopmentMode)(context.config.mode),
99
+ STACKTRACE: context.config.mode !== "production",
100
+ RUNTIME: context.config.environment.runtime,
101
+ ENVIRONMENT: !context.config.environment.name || context.config.environment.name === powerlines_constants.DEFAULT_ENVIRONMENT ? context.config.mode : context.config.environment.name
102
+ }, (0, _stryke_type_checks_is_set_object.isSetObject)(context?.env?.types?.env) ? context.env.types.env?.getProperties().reduce(__assignType((ret, prop) => {
103
+ ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();
104
+ return ret;
105
+ }, [
106
+ "ret",
107
+ "prop",
108
+ "",
109
+ "P\"2!\"2\"\"/#"
110
+ ]), {}) : {});
111
+ }
112
+ loadEnvFromContext.__type = [
113
+ () => require_types_plugin.__ΩEnvPluginContext,
114
+ "context",
115
+ "parsed",
116
+ "workspaceConfig",
117
+ "loadEnvFromContext",
118
+ "Retrieves various dotenv configuration parameters from the context.",
119
+ "Pn!2\"!2#!2$8\"/%?&"
120
+ ];
121
+ async function loadEnv(context, options) {
122
+ const workspaceConfig = await (0, _storm_software_config_tools_get_config.tryGetWorkspaceConfig)();
123
+ const [project, workspace, config] = await Promise.all([
124
+ (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(context, options, context.config.root, context.config.mode, context.cachePath, context.packageJson, workspaceConfig)),
125
+ (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(context, options, context.config.cwd, context.config.mode, context.cachePath, context.packageJson, workspaceConfig)),
126
+ (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(context, options, context.envPaths.config, context.config.mode, context.cachePath, context.packageJson, workspaceConfig))
127
+ ]);
128
+ return (0, defu.default)(loadEnvFromContext(context, process.env, workspaceConfig), project, workspace, config);
129
+ }
130
+ loadEnv.__type = [
131
+ () => require_types_plugin.__ΩEnvPluginContext,
132
+ "context",
133
+ () => require_types_plugin.__ΩEnvPluginOptions,
134
+ "options",
135
+ "loadEnv",
136
+ "Pn!2\"n#2$\"`/%"
137
+ ];
138
+
139
+ //#endregion
140
+ exports.loadEnv = loadEnv;
141
+ exports.loadEnvFromContext = loadEnvFromContext;
@@ -28,7 +28,7 @@ declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvPar
28
28
  TEST: boolean;
29
29
  DEBUG: boolean;
30
30
  STACKTRACE: boolean;
31
- RUNTIME: "browser" | "nodejs" | "workerd" | "edge" | undefined;
31
+ RUNTIME: "edge" | "browser" | "nodejs" | "workerd" | undefined;
32
32
  ENVIRONMENT: string;
33
33
  };
34
34
  declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
@@ -28,7 +28,7 @@ declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvPar
28
28
  TEST: boolean;
29
29
  DEBUG: boolean;
30
30
  STACKTRACE: boolean;
31
- RUNTIME: "browser" | "nodejs" | "workerd" | "edge" | undefined;
31
+ RUNTIME: "edge" | "browser" | "nodejs" | "workerd" | undefined;
32
32
  ENVIRONMENT: string;
33
33
  };
34
34
  declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;