@powerlines/plugin-env 0.16.157 → 0.16.158
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/package.json +9 -9
- package/dist/_virtual/_rolldown/runtime.cjs +0 -1
- package/dist/babel/index.cjs +0 -1
- package/dist/babel/index.d.cts +0 -2
- package/dist/babel/index.d.mts +0 -2
- package/dist/babel/index.mjs +0 -1
- package/dist/babel/plugin.cjs +0 -5
- package/dist/babel/plugin.d.cts +0 -8
- package/dist/babel/plugin.d.cts.map +0 -1
- package/dist/babel/plugin.d.mts +0 -8
- package/dist/babel/plugin.d.mts.map +0 -1
- package/dist/babel/plugin.mjs +0 -6
- package/dist/babel/plugin.mjs.map +0 -1
- package/dist/components/docs.cjs +0 -1
- package/dist/components/docs.d.cts +0 -24
- package/dist/components/docs.d.cts.map +0 -1
- package/dist/components/docs.d.mts +0 -24
- package/dist/components/docs.d.mts.map +0 -1
- package/dist/components/docs.mjs +0 -2
- package/dist/components/docs.mjs.map +0 -1
- package/dist/components/env-builtin.cjs +0 -98
- package/dist/components/env-builtin.d.cts +0 -21
- package/dist/components/env-builtin.d.cts.map +0 -1
- package/dist/components/env-builtin.d.mts +0 -21
- package/dist/components/env-builtin.d.mts.map +0 -1
- package/dist/components/env-builtin.mjs +0 -96
- package/dist/components/env-builtin.mjs.map +0 -1
- package/dist/components/index.cjs +0 -1
- package/dist/components/index.d.cts +0 -3
- package/dist/components/index.d.mts +0 -3
- package/dist/components/index.mjs +0 -1
- package/dist/helpers/automd-generator.cjs +0 -1
- package/dist/helpers/automd-generator.d.cts +0 -14
- package/dist/helpers/automd-generator.d.cts.map +0 -1
- package/dist/helpers/automd-generator.d.mts +0 -14
- package/dist/helpers/automd-generator.d.mts.map +0 -1
- package/dist/helpers/automd-generator.mjs +0 -2
- package/dist/helpers/automd-generator.mjs.map +0 -1
- package/dist/helpers/create-reflection-resource.cjs +0 -1
- package/dist/helpers/create-reflection-resource.d.cts +0 -13
- package/dist/helpers/create-reflection-resource.d.cts.map +0 -1
- package/dist/helpers/create-reflection-resource.d.mts +0 -13
- package/dist/helpers/create-reflection-resource.d.mts.map +0 -1
- package/dist/helpers/create-reflection-resource.mjs +0 -2
- package/dist/helpers/create-reflection-resource.mjs.map +0 -1
- package/dist/helpers/index.cjs +0 -1
- package/dist/helpers/index.d.cts +0 -7
- package/dist/helpers/index.d.mts +0 -7
- package/dist/helpers/index.mjs +0 -1
- package/dist/helpers/load.cjs +0 -1
- package/dist/helpers/load.d.cts +0 -36
- package/dist/helpers/load.d.cts.map +0 -1
- package/dist/helpers/load.d.mts +0 -36
- package/dist/helpers/load.d.mts.map +0 -1
- package/dist/helpers/load.mjs +0 -2
- package/dist/helpers/load.mjs.map +0 -1
- package/dist/helpers/persistence.cjs +0 -1
- package/dist/helpers/persistence.d.cts +0 -84
- package/dist/helpers/persistence.d.cts.map +0 -1
- package/dist/helpers/persistence.d.mts +0 -84
- package/dist/helpers/persistence.d.mts.map +0 -1
- package/dist/helpers/persistence.mjs +0 -2
- package/dist/helpers/persistence.mjs.map +0 -1
- package/dist/helpers/reflect.cjs +0 -1
- package/dist/helpers/reflect.d.cts +0 -68
- package/dist/helpers/reflect.d.cts.map +0 -1
- package/dist/helpers/reflect.d.mts +0 -68
- package/dist/helpers/reflect.d.mts.map +0 -1
- package/dist/helpers/reflect.mjs +0 -2
- package/dist/helpers/reflect.mjs.map +0 -1
- package/dist/helpers/source-file-env.cjs +0 -1
- package/dist/helpers/source-file-env.d.cts +0 -9
- package/dist/helpers/source-file-env.d.cts.map +0 -1
- package/dist/helpers/source-file-env.d.mts +0 -9
- package/dist/helpers/source-file-env.d.mts.map +0 -1
- package/dist/helpers/source-file-env.mjs +0 -2
- package/dist/helpers/source-file-env.mjs.map +0 -1
- package/dist/helpers/template-helpers.cjs +0 -1
- package/dist/helpers/template-helpers.d.cts +0 -15
- package/dist/helpers/template-helpers.d.cts.map +0 -1
- package/dist/helpers/template-helpers.d.mts +0 -15
- package/dist/helpers/template-helpers.d.mts.map +0 -1
- package/dist/helpers/template-helpers.mjs +0 -2
- package/dist/helpers/template-helpers.mjs.map +0 -1
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +0 -17
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts +0 -17
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +0 -1
- package/dist/types/index.cjs +0 -1
- package/dist/types/index.d.cts +0 -3
- package/dist/types/index.d.mts +0 -3
- package/dist/types/index.mjs +0 -1
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +0 -163
- package/dist/types/plugin.d.cts.map +0 -1
- package/dist/types/plugin.d.mts +0 -163
- package/dist/types/plugin.d.mts.map +0 -1
- package/dist/types/plugin.mjs +0 -2
- package/dist/types/plugin.mjs.map +0 -1
- package/dist/types/runtime.cjs +0 -1
- package/dist/types/runtime.d.cts +0 -934
- package/dist/types/runtime.d.cts.map +0 -1
- package/dist/types/runtime.d.mts +0 -934
- package/dist/types/runtime.d.mts.map +0 -1
- package/dist/types/runtime.mjs +0 -2
- package/dist/types/runtime.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
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,C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AAC,CAAA,EAAY,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACZ,OAAU,GACV,MAAA,GACD,KAAA,gBACA,IAAA,oIAEA,CAAA,CAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACC,OAAA,GACA,MAAA,GACA,KAAM,UACN,IAAK,wDACL,YAAa,CAAI,wCAClB,CAAC,CAAE,EAAQ,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACV,IAAE,MAAI,CACJ,MAAI,EAAA,GAEA,WACP,CAAC,CAAC,EAEN,CAAC,CAAC,CAEL,EAAU,OAAI,KAAY,EAAA,QAAA,aAAA,6EAAA,aAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./docs.cjs`),t=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 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import { UnresolvedContext } from "powerlines";
|
|
2
|
-
import * as _$automd from "automd";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/automd-generator.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* AutoMD generator to generate environment variable documentation
|
|
7
|
-
*
|
|
8
|
-
* @param context - The generator context.
|
|
9
|
-
* @returns The generated documentation content.
|
|
10
|
-
*/
|
|
11
|
-
declare const env: (context: UnresolvedContext) => _$automd.Generator;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { env };
|
|
14
|
-
//# sourceMappingURL=automd-generator.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automd-generator.d.cts","names":[],"sources":["../../src/helpers/automd-generator.ts"],"mappings":";;;;;;;AA6BA;;;cAAa,GAAA,GAAO,OAAA,EAAS,iBAAA,KAAiB,QAAA,CAAA,SAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as _$automd from "automd";
|
|
2
|
-
import { UnresolvedContext } from "powerlines";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/automd-generator.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* AutoMD generator to generate environment variable documentation
|
|
7
|
-
*
|
|
8
|
-
* @param context - The generator context.
|
|
9
|
-
* @returns The generated documentation content.
|
|
10
|
-
*/
|
|
11
|
-
declare const env: (context: UnresolvedContext) => _$automd.Generator;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { env };
|
|
14
|
-
//# sourceMappingURL=automd-generator.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automd-generator.d.mts","names":[],"sources":["../../src/helpers/automd-generator.ts"],"mappings":";;;;;;;AA6BA;;;cAAa,GAAA,GAAO,OAAA,EAAS,iBAAA,KAAiB,QAAA,CAAA,SAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
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};
|
|
2
|
-
//# sourceMappingURL=automd-generator.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,13 +0,0 @@
|
|
|
1
|
-
import { EnvPluginContext } from "../types/plugin.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/helpers/create-reflection-resource.d.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
|
-
declare function createReflection(_context: EnvPluginContext): {};
|
|
11
|
-
//#endregion
|
|
12
|
-
export { createReflection };
|
|
13
|
-
//# sourceMappingURL=create-reflection-resource.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-reflection-resource.d.cts","names":[],"sources":["../../src/helpers/create-reflection-resource.ts"],"mappings":";;;;;AA0BA;;;;iBAAgB,gBAAA,CAAiB,QAAA,EAAU,gBAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EnvPluginContext } from "../types/plugin.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/helpers/create-reflection-resource.d.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
|
-
declare function createReflection(_context: EnvPluginContext): {};
|
|
11
|
-
//#endregion
|
|
12
|
-
export { createReflection };
|
|
13
|
-
//# sourceMappingURL=create-reflection-resource.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-reflection-resource.d.mts","names":[],"sources":["../../src/helpers/create-reflection-resource.ts"],"mappings":";;;;;AA0BA;;;;iBAAgB,gBAAA,CAAiB,QAAA,EAAU,gBAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
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};
|
|
2
|
-
//# sourceMappingURL=create-reflection-resource.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/helpers/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;
|
package/dist/helpers/index.d.cts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createReflection } from "./create-reflection-resource.cjs";
|
|
2
|
-
import { loadEnv, loadEnvFromContext } from "./load.cjs";
|
|
3
|
-
import { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection } from "./persistence.cjs";
|
|
4
|
-
import { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from "./reflect.cjs";
|
|
5
|
-
import { formatEnvField, removeEnvPrefix } from "./source-file-env.cjs";
|
|
6
|
-
import { createTemplateReflection } from "./template-helpers.cjs";
|
|
7
|
-
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 };
|
package/dist/helpers/index.d.mts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createReflection } from "./create-reflection-resource.mjs";
|
|
2
|
-
import { loadEnv, loadEnvFromContext } from "./load.mjs";
|
|
3
|
-
import { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection } from "./persistence.mjs";
|
|
4
|
-
import { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from "./reflect.mjs";
|
|
5
|
-
import { formatEnvField, removeEnvPrefix } from "./source-file-env.mjs";
|
|
6
|
-
import { createTemplateReflection } from "./template-helpers.mjs";
|
|
7
|
-
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 };
|
package/dist/helpers/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/helpers/load.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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/load-env`),o=require(`@stryke/string-format/kebab-case`),s=require(`@stryke/type-checks/is-set-object`),c=require(`c12`),l=require(`defu`);l=e.__toESM(l,1);let u=require(`powerlines/constants`);function d(e,t){return e.__type=t,e}async function f(e,t,r){let i=await(0,a.loadEnv)(r,t);if(e.additionalFiles&&e.additionalFiles?.length>0){let t=await Promise.all(e.additionalFiles.map(d(async e=>(0,a.loadEnvFile)(e,r),[`additionalEnvFile`,``,`P"2!"/"`])));for(let e of t)i=(0,l.default)(e,i)}return n.removeEnvPrefix(i)}f.__type=[()=>t.__ΩEnvPluginOptions,`options`,`mode`,`cwd`,`loadEnvFiles`,'Pn!2"&2#&2$"`/%'];async function p(e,t,n,i,a,o,s){let[u,d]=await Promise.all([(f.Ω=[[`!`]],f(t,i,n)),(0,c.loadConfig)({cwd:n,name:`storm`,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,l.default)(u,d.config,s)}p.__type=[()=>t.__ΩEnvPluginContext,`context`,()=>t.__ΩEnvPluginOptions,`options`,`directory`,`mode`,`cacheDir`,`packageJson`,`workspaceConfig`,`loadEnvDirectory`,`Pn!2"n#2$&2%&2&&2'!2(!2)8"\`/*`];function m(e,t,n){return(0,l.default)({APP_NAME:(0,o.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,o.kebabCase)(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:n?.locale,DEFAULT_TIMEZONE:n?.timezone,LOG_LEVEL:e.config.logLevel===`trace`?`debug`:e.config.logLevel,ERROR_URL:n?.error?.url,ORGANIZATION:e.config.organization||((0,s.isSetObject)(n?.organization)?n.organization.name:n?.organization),PLATFORM:e.config.platform,MODE:e.config.mode,TEST:e.config.mode===`test`,DEBUG:e.config.mode===`development`,STACKTRACE:e.config.mode!==`production`,ENVIRONMENT:!e.environment.name||e.environment.name===u.DEFAULT_ENVIRONMENT?e.config.mode:e.environment.name},(0,s.isSetObject)(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce(d((e,n)=>(e[n.name]=t[n.name]??n.getDefaultValue(),e),[`ret`,`prop`,``,`P"2!"2""/#`]),{}):{})}m.__type=[()=>t.__ΩEnvPluginContext,`context`,`parsed`,`workspaceConfig`,`loadEnvFromContext`,`Retrieves various dotenv configuration parameters from the context.`,`Pn!2"!2#!2$8"/%?&`];async function h(e,t){let n=await(0,i.tryGetWorkspaceConfig)(),[r,a,o]=await Promise.all([(p.Ω=[[`!`]],p(e,t,e.config.root,e.config.mode,e.cachePath,e.packageJson,n)),(p.Ω=[[`!`]],p(e,t,e.config.cwd,e.config.mode,e.cachePath,e.packageJson,n)),(p.Ω=[[`!`]],p(e,t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,n))]);return(0,l.default)(m(e,process.env,n),r,a,o)}h.__type=[()=>t.__ΩEnvPluginContext,`context`,()=>t.__ΩEnvPluginOptions,`options`,`loadEnv`,'Pn!2"n#2$"`/%'],exports.loadEnv=h,exports.loadEnvFromContext=m;
|
package/dist/helpers/load.d.cts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { EnvPluginContext, EnvPluginOptions } from "../types/plugin.cjs";
|
|
2
|
-
import { WorkspaceConfig } from "powerlines";
|
|
3
|
-
import { DotenvParseOutput } from "@stryke/env/types";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/load.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Retrieves various dotenv configuration parameters from the context.
|
|
8
|
-
*
|
|
9
|
-
* @param context - The context to retrieve the dotenv configuration from.
|
|
10
|
-
* @param parsed - The parsed dotenv configuration.
|
|
11
|
-
* @returns An object containing the dotenv configuration.
|
|
12
|
-
*/
|
|
13
|
-
declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvParseOutput, workspaceConfig?: WorkspaceConfig): {
|
|
14
|
-
APP_NAME: string;
|
|
15
|
-
APP_VERSION: string | undefined;
|
|
16
|
-
BUILD_ID: string;
|
|
17
|
-
BUILD_TIMESTAMP: string;
|
|
18
|
-
BUILD_CHECKSUM: string;
|
|
19
|
-
RELEASE_ID: string;
|
|
20
|
-
RELEASE_TAG: string;
|
|
21
|
-
DEFAULT_LOCALE: string | undefined;
|
|
22
|
-
DEFAULT_TIMEZONE: string | undefined;
|
|
23
|
-
LOG_LEVEL: "error" | "warn" | "info" | "debug" | null;
|
|
24
|
-
ERROR_URL: string | undefined;
|
|
25
|
-
ORGANIZATION: string | undefined;
|
|
26
|
-
PLATFORM: "node" | "browser" | "neutral";
|
|
27
|
-
MODE: "test" | "development" | "production";
|
|
28
|
-
TEST: boolean;
|
|
29
|
-
DEBUG: boolean;
|
|
30
|
-
STACKTRACE: boolean;
|
|
31
|
-
ENVIRONMENT: string;
|
|
32
|
-
};
|
|
33
|
-
declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { loadEnv, loadEnvFromContext };
|
|
36
|
-
//# sourceMappingURL=load.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.cts","names":[],"sources":["../../src/helpers/load.ts"],"mappings":";;;;;;;AAqGA;;;;;iBAAgB,kBAAA,CACd,OAAA,EAAS,gBAAA,EACT,MAAA,EAAQ,iBAAA,EACR,eAAA,GAAkB,eAAA;;;;;;;;;;;;;;;;;;;;iBA4CE,OAAA,cACP,iBAAA,GAAoB,iBAAA,CAAA,CACjC,OAAA,EAAS,gBAAA,EAAkB,OAAA,EAAS,gBAAA,GAAmB,OAAA,CAAQ,IAAA"}
|
package/dist/helpers/load.d.mts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { EnvPluginContext, EnvPluginOptions } from "../types/plugin.mjs";
|
|
2
|
-
import { DotenvParseOutput } from "@stryke/env/types";
|
|
3
|
-
import { WorkspaceConfig } from "powerlines";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/load.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Retrieves various dotenv configuration parameters from the context.
|
|
8
|
-
*
|
|
9
|
-
* @param context - The context to retrieve the dotenv configuration from.
|
|
10
|
-
* @param parsed - The parsed dotenv configuration.
|
|
11
|
-
* @returns An object containing the dotenv configuration.
|
|
12
|
-
*/
|
|
13
|
-
declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvParseOutput, workspaceConfig?: WorkspaceConfig): {
|
|
14
|
-
APP_NAME: string;
|
|
15
|
-
APP_VERSION: string | undefined;
|
|
16
|
-
BUILD_ID: string;
|
|
17
|
-
BUILD_TIMESTAMP: string;
|
|
18
|
-
BUILD_CHECKSUM: string;
|
|
19
|
-
RELEASE_ID: string;
|
|
20
|
-
RELEASE_TAG: string;
|
|
21
|
-
DEFAULT_LOCALE: string | undefined;
|
|
22
|
-
DEFAULT_TIMEZONE: string | undefined;
|
|
23
|
-
LOG_LEVEL: "error" | "warn" | "info" | "debug" | null;
|
|
24
|
-
ERROR_URL: string | undefined;
|
|
25
|
-
ORGANIZATION: string | undefined;
|
|
26
|
-
PLATFORM: "node" | "browser" | "neutral";
|
|
27
|
-
MODE: "test" | "development" | "production";
|
|
28
|
-
TEST: boolean;
|
|
29
|
-
DEBUG: boolean;
|
|
30
|
-
STACKTRACE: boolean;
|
|
31
|
-
ENVIRONMENT: string;
|
|
32
|
-
};
|
|
33
|
-
declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { loadEnv, loadEnvFromContext };
|
|
36
|
-
//# sourceMappingURL=load.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.mts","names":[],"sources":["../../src/helpers/load.ts"],"mappings":";;;;;;;AAqGA;;;;;iBAAgB,kBAAA,CACd,OAAA,EAAS,gBAAA,EACT,MAAA,EAAQ,iBAAA,EACR,eAAA,GAAkB,eAAA;;;;;;;;;;;;;;;;;;;;iBA4CE,OAAA,cACP,iBAAA,GAAoB,iBAAA,CAAA,CACjC,OAAA,EAAS,gBAAA,EAAkB,OAAA,EAAS,gBAAA,GAAmB,OAAA,CAAQ,IAAA"}
|
package/dist/helpers/load.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__ΩEnvPluginContext as e,__ΩEnvPluginOptions as t}from"../types/plugin.mjs";import{removeEnvPrefix as n}from"./source-file-env.mjs";import{joinPaths as r}from"@stryke/path/join-paths";import{tryGetWorkspaceConfig as i}from"@storm-software/config-tools/get-config";import{loadEnv as a,loadEnvFile as o}from"@stryke/env/load-env";import{kebabCase as s}from"@stryke/string-format/kebab-case";import{isSetObject as c}from"@stryke/type-checks/is-set-object";import{loadConfig as l}from"c12";import u from"defu";import{DEFAULT_ENVIRONMENT as d}from"powerlines/constants";function f(e,t){return e.__type=t,e}async function p(e,t,r){let i=await a(r,t);if(e.additionalFiles&&e.additionalFiles?.length>0){let t=await Promise.all(e.additionalFiles.map(f(async e=>o(e,r),[`additionalEnvFile`,``,`P"2!"/"`])));for(let e of t)i=u(e,i)}return n(i)}p.__type=[()=>t,`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)),l({cwd:n,name:`storm`,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:r(a,`jiti`),moduleCache:!0}})]);return u(c,d.config,s)}m.__type=[()=>e,`context`,()=>t,`options`,`directory`,`mode`,`cacheDir`,`packageJson`,`workspaceConfig`,`loadEnvDirectory`,`Pn!2"n#2$&2%&2&&2'!2(!2)8"\`/*`];function h(e,t,n){return u({APP_NAME:s(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:`${s(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:n?.locale,DEFAULT_TIMEZONE:n?.timezone,LOG_LEVEL:e.config.logLevel===`trace`?`debug`:e.config.logLevel,ERROR_URL:n?.error?.url,ORGANIZATION:e.config.organization||(c(n?.organization)?n.organization.name:n?.organization),PLATFORM:e.config.platform,MODE:e.config.mode,TEST:e.config.mode===`test`,DEBUG:e.config.mode===`development`,STACKTRACE:e.config.mode!==`production`,ENVIRONMENT:!e.environment.name||e.environment.name===d?e.config.mode:e.environment.name},c(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=[()=>e,`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 i(),[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 u(h(e,process.env,n),r,a,o)}g.__type=[()=>e,`context`,()=>t,`options`,`loadEnv`,'Pn!2"n#2$"`/%'];export{g as loadEnv,h as loadEnvFromContext};
|
|
2
|
-
//# sourceMappingURL=load.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load.mjs","names":[],"sources":["../../src/helpers/load.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 { tryGetWorkspaceConfig } from \"@storm-software/config-tools/get-config\";\nimport {\n loadEnv as loadEnvBase,\n loadEnvFile as loadEnvFileBase\n} from \"@stryke/env/load-env\";\nimport type { DotenvParseOutput } from \"@stryke/env/types\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type { PackageJson } from \"@stryke/types/package-json\";\nimport { loadConfig } from \"c12\";\nimport defu from \"defu\";\nimport { WorkspaceConfig } from \"powerlines\";\nimport { DEFAULT_ENVIRONMENT } from \"powerlines/constants\";\nimport { EnvPluginContext, EnvPluginOptions } from \"../types/plugin\";\nimport { removeEnvPrefix } from \"./source-file-env\";\n\nasync function loadEnvFiles<TEnv extends DotenvParseOutput = DotenvParseOutput>(\n options: EnvPluginOptions,\n mode: string,\n cwd: string\n): Promise<TEnv> {\n let env = await loadEnvBase(cwd, mode);\n if (options.additionalFiles && options.additionalFiles?.length > 0) {\n const additionalEnvFiles = await Promise.all(\n options.additionalFiles.map(async additionalEnvFile =>\n loadEnvFileBase(additionalEnvFile, cwd)\n )\n );\n\n for (const additionalEnvFile of additionalEnvFiles) {\n env = defu(additionalEnvFile, env);\n }\n }\n\n return removeEnvPrefix(env) as TEnv;\n}\n\nasync function loadEnvDirectory<\n TEnv extends DotenvParseOutput = DotenvParseOutput\n>(\n context: EnvPluginContext,\n options: EnvPluginOptions,\n directory: string,\n mode: string,\n cacheDir: string,\n packageJson: PackageJson,\n workspaceConfig?: WorkspaceConfig\n): Promise<TEnv> {\n const [envResult, c12Result] = await Promise.all([\n loadEnvFiles<TEnv>(options, mode, directory),\n loadConfig({\n cwd: directory,\n name: \"storm\",\n envName: mode,\n defaults: {\n NAME:\n workspaceConfig?.namespace && packageJson.name\n ? packageJson.name?.replace(`@${workspaceConfig.namespace}/`, \"\")\n : context.config.name,\n MODE: mode,\n ORG: context.config.organization || workspaceConfig?.organization\n },\n globalRc: true,\n packageJson: true,\n dotenv: true,\n jitiOptions: {\n fsCache: joinPaths(cacheDir, \"jiti\"),\n moduleCache: true\n }\n })\n ]);\n\n return defu(envResult as any, c12Result.config, workspaceConfig) as TEnv;\n}\n\n/**\n * Retrieves various dotenv configuration parameters from the context.\n *\n * @param context - The context to retrieve the dotenv configuration from.\n * @param parsed - The parsed dotenv configuration.\n * @returns An object containing the dotenv configuration.\n */\nexport function loadEnvFromContext(\n context: EnvPluginContext,\n parsed: DotenvParseOutput,\n workspaceConfig?: WorkspaceConfig\n) {\n return defu(\n {\n APP_NAME: kebabCase(context.config.name),\n APP_VERSION: context.packageJson.version,\n BUILD_ID: context.meta.buildId,\n BUILD_TIMESTAMP: new Date(context.meta.timestamp).toISOString(),\n BUILD_CHECKSUM: context.meta.checksum,\n RELEASE_ID: context.meta.releaseId,\n RELEASE_TAG: `${kebabCase(context.config.name)}@${context.packageJson.version}`,\n DEFAULT_LOCALE: workspaceConfig?.locale,\n DEFAULT_TIMEZONE: workspaceConfig?.timezone,\n LOG_LEVEL:\n context.config.logLevel === \"trace\" ? \"debug\" : context.config.logLevel,\n ERROR_URL: workspaceConfig?.error?.url,\n ORGANIZATION:\n context.config.organization ||\n (isSetObject(workspaceConfig?.organization)\n ? workspaceConfig.organization.name\n : workspaceConfig?.organization),\n PLATFORM: context.config.platform,\n MODE: context.config.mode,\n TEST: context.config.mode === \"test\",\n DEBUG: context.config.mode === \"development\",\n STACKTRACE: context.config.mode !== \"production\",\n ENVIRONMENT:\n !context.environment.name ||\n context.environment.name === DEFAULT_ENVIRONMENT\n ? context.config.mode\n : context.environment.name\n },\n isSetObject(context?.env?.types?.env)\n ? context.env.types.env?.getProperties().reduce(\n (ret, prop) => {\n ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();\n return ret;\n },\n {} as Record<string, any>\n )\n : {}\n );\n}\n\nexport async function loadEnv<\n TEnv extends DotenvParseOutput = DotenvParseOutput\n>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv> {\n const workspaceConfig = await tryGetWorkspaceConfig();\n\n const [project, workspace, config] = await Promise.all([\n loadEnvDirectory<TEnv>(\n context,\n options,\n context.config.root,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n workspaceConfig\n ),\n loadEnvDirectory<TEnv>(\n context,\n options,\n context.config.cwd,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n workspaceConfig\n ),\n loadEnvDirectory<TEnv>(\n context,\n options,\n context.envPaths.config,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n workspaceConfig\n )\n ]);\n\n return defu(\n loadEnvFromContext(context, process.env, workspaceConfig),\n project,\n workspace,\n config\n ) as TEnv;\n}\n"],"mappings":"4jBAIA,SAAM,EAAS,EAAW,EAAM,CAE/B,MADA,GAAG,OAAU,EACL,0BA6BT,IAAM,EAAA,MAAS,EAAa,EAAK,EAAO,CACtC,GAAA,EAAS,iBAAgB,EAAA,iBAAA,OAAA,EAAA,CACzB,IAAM,EAAM,MAAA,QAAA,IAAA,EAAA,gBAAA,IAAA,EAAA,KAAA,IAAA,EAAA,EAAA,EAAA,CAAA,CAAA,oBAAA,GAAA,UAAA,CAAA,CAAA,CAAA,CACZ,IAAK,IAAA,KAAA,EACJ,EAAQ,EAAM,EAAA,EAAA,CAGf,OAAO,EAAC,EAAmB,CAE7B,EAAQ,OAAA,KAAgB,EAAsB,UAAA,OAAA,MAAA,eAAA,kBAAA,CAC9C,eAAM,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CACJ,GAAG,CAAA,EAAA,GAAA,MAAA,QAAA,IAAA,EAAA,EAAA,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A,EAAA,iBAAA,CACC,GACF,CAAA,MAAA,OAAA,GAAA,aAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAED,EAAmB,OAAI,KAAO,EAAoB,UAAA,SAAA,kBAAA,qBAAA,sEAAA,oBAAA,CAClD,eAAsB,EAAA,EAAe,EAAO,CAC1C,IAAA,EAAA,MAAA,GAAA,CACK,CAAA,EAAS,EAAA,GAAkB,MAAA,QAAA,IAAA,EAAA,EAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,EAAA,EAAA,EAAA,EAAA,OAAA,KAAA,EAAA,OAAA,KAAA,EAAA,UAAA,EAAA,YAAA,EAAA,GAAA,EAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,EAAA,OAAA,KAAA,EAAA,UAAA,EAAA,YAAA,EAAA,GAAA,EAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,EAAA,EAAA,EAAA,EAAA,SAAA,OAAA,EAAA,OAAA,KAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,CAAA,CAChC,OAAO,EAAE,EAAgB,EAAA,QAAA,IAAA,EAAA,CAAA,EAAA,EAAA,EAAA,CAE3B,EAAE,OAAe,KAAG,EAAA,cAAA,EAAA,UAAA,UAAA,gBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../types/plugin.cjs`),n=require(`./reflect.cjs`);let r=require(`@powerlines/deepkit/capnp`),i=require(`@powerlines/deepkit/resolve-reflections`),a=require(`@powerlines/deepkit/schemas/reflection`),o=require(`@powerlines/deepkit/vendor/type`),s=require(`@stryke/capnp`);s=e.__toESM(s,1);let c=require(`@stryke/fs/buffer`),l=require(`@stryke/path/join-paths`),u=require(`@stryke/type-checks/is-empty-object`),d=require(`node:fs`);async function f(e){let t=await e.fs.resolve(`@powerlines/plugin-env/types/runtime`);if(!t)throw Error(`Failed to resolve the runtime type definition file for the environment variables. Please ensure that the "@powerlines/plugin-env" package is installed.`);return t}f.__type=[`context`,`resolveRuntimeTypeFile`,`Resolves the runtime type definition file for the environment variables.`,'P!2!&`/"?#'];async function p(e){return{file:await f(e),name:`EnvInterface`}}p.__type=[`context`,`getEnvDefaultTypeDefinition`,`Gets the default type definition for the environment variables.`,'P!2!!`/"?#'];async function m(e){return{file:await f(e),name:`SecretsInterface`}}m.__type=[`context`,`getSecretsDefaultTypeDefinition`,'P!2!!`/"'];function h(e,t=`env`){return(0,l.joinPaths)((0,i.getReflectionsPath)(e),`env`,`${t}-types.bin`)}h.__type=[`context`,()=>t.__ΩEnvType,`name`,()=>`env`,`getEnvTypeReflectionsPath`,`Gets the path to the environment type reflections.`,`P!2!n"2#>$&/%?&`];async function g(e,t=`env`){let i=h(e,t);if(!(0,d.existsSync)(i)){if(!e.env.types.env||(0,u.isEmptyObject)(e.env.types.env)){let r=n.createEnvReflection(e),i=new s.Message;r.messageRoot=i.initRoot(a.SerializedTypes),r.dataBuffer=i.toArrayBuffer(),e.env.types.env=r,await _(e,e.env.types.env,t)}return e.env.types.env}let l=await(0,c.readFileBuffer)(i),f=new s.Message(l,!1).getRoot(a.SerializedTypes),p=(0,o.resolveClassType)((0,o.deserializeType)((0,r.convertFromCapnp)(f.types)));return e.env.types[t]=p,e.env.types[t].messageRoot=f,e.env.types[t].dataBuffer=l,p}g.__type=[()=>t.__ΩEnvPluginContext,`context`,()=>t.__ΩEnvType,`name`,()=>`env`,`readEnvTypeReflection`,`Reads the environment type reflection from the file system.`,`Pn!2"n#2$>%!\`/&?'`];async function _(e,t,n=`env`){let i=t.serializeType(),o=new s.Message;(0,r.convertToCapnp)(i,o.initRoot(a.SerializedTypes)._initTypes(i.length)),await(0,c.writeFileBuffer)(h(e,n),o.toArrayBuffer())}_.__type=[()=>t.__ΩEnvPluginContext,`context`,`reflection`,()=>t.__ΩEnvType,`name`,()=>`env`,`writeEnvTypeReflection`,`Writes the environment type reflection to the file system.`,`Pn!2"!2#n$2%>&"/'?(`];function v(e,t){return(0,l.joinPaths)((0,i.getReflectionsPath)(e),`env`,`${t}.bin`)}v.__type=[()=>t.__ΩEnvPluginContext,`context`,()=>t.__ΩEnvType,`name`,`getEnvReflectionsPath`,`Pn!2"n#2$&/%`];async function y(e){let t=v(e,`env`);if(!(0,d.existsSync)(t)){if(e.env.types.env||(e.env.types.env=await g(e,`env`)),!e.env.used.env||(0,u.isEmptyObject)(e.env.used.env)){let t=n.createEnvReflection(e,{type:{kind:o.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:`application`}.`,types:[]},superReflection:e.env.types.env});t.name=`Env`;let r=new s.Message;t.messageRoot=r.initRoot(a.SerializedTypes),t.dataBuffer=r.toArrayBuffer(),e.env.used.env=t,await x(e,e.env.used.env,`env`)}return e.env.used.env}let i=await(0,c.readFileBuffer)(t),l=new s.Message(i,!1).getRoot(a.SerializedTypes),f=(0,o.resolveClassType)((0,o.deserializeType)((0,r.convertFromCapnp)(l.types)));return e.env.used.env=f,e.env.used.env.messageRoot=l,e.env.used.env.dataBuffer=i,f}y.__type=[()=>t.__ΩEnvPluginContext,`context`,`readEnvReflection`,`Reads the environment reflection data from the file system.`,'Pn!2"!`/#?$'];async function b(e){let t=v(e,`secrets`);if(!(0,d.existsSync)(t)){if(e.env.types.secrets||(e.env.types.secrets=await g(e,`secrets`)),!e.env.used.secrets||(0,u.isEmptyObject)(e.env.used.secrets)){let t=n.createEnvReflection(e,{type:{kind:o.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:`application`}.`,types:[]},superReflection:e.env.types.secrets});t.name=`Secrets`;let r=new s.Message;t.messageRoot=r.initRoot(a.SerializedTypes),t.dataBuffer=r.toArrayBuffer(),e.env.used.secrets=t,await x(e,e.env.used.secrets,`secrets`)}return e.env.used.secrets}let i=await(0,c.readFileBuffer)(t),l=new s.Message(i,!1).getRoot(a.SerializedTypes),f=(0,o.resolveClassType)((0,o.deserializeType)((0,r.convertFromCapnp)(l.types)));return e.env.used.secrets=f,e.env.used.secrets.messageRoot=l,e.env.used.secrets.dataBuffer=i,f}b.__type=[()=>t.__ΩEnvPluginContext,`context`,`readSecretsReflection`,`Reads the secret environment reflection data from the file system.`,'Pn!2"!`/#?$'];async function x(e,t,n=`env`){let i=t.serializeType(),o=new s.Message;(0,r.convertToCapnp)(i,o.initRoot(a.SerializedTypes)._initTypes(i.length)),await(0,c.writeFileBuffer)(v(e,n),o.toArrayBuffer())}x.__type=[()=>t.__ΩEnvPluginContext,`context`,`reflection`,()=>t.__ΩEnvType,`name`,()=>`env`,`writeEnvReflection`,`Writes the environment reflection data to the file system.`,`Pn!2"!2#n$2%>&"/'?(`];function S(e,t,n=`env`){let i=t.serializeType(),o=new s.Message;(0,r.convertToCapnp)(i,o.initRoot(a.SerializedTypes)._initTypes(i.length)),(0,c.writeFileBufferSync)(v(e,n),o.toArrayBuffer())}S.__type=[()=>t.__ΩEnvPluginContext,`context`,`reflection`,()=>t.__ΩEnvType,`name`,()=>`env`,`writeEnvReflectionSync`,`Writes the environment reflection data to the file system.`,`Pn!2"!2#n$2%>&"/'?(`],exports.getEnvDefaultTypeDefinition=p,exports.getEnvReflectionsPath=v,exports.getEnvTypeReflectionsPath=h,exports.getSecretsDefaultTypeDefinition=m,exports.readEnvReflection=y,exports.readEnvTypeReflection=g,exports.readSecretsReflection=b,exports.resolveRuntimeTypeFile=f,exports.writeEnvReflection=x,exports.writeEnvReflectionSync=S,exports.writeEnvTypeReflection=_;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { EnvPluginContext, EnvPluginResolvedConfig, EnvType } from "../types/plugin.cjs";
|
|
2
|
-
import { Context, UnresolvedContext } from "powerlines";
|
|
3
|
-
import { TypeDefinition } from "@stryke/types/configuration";
|
|
4
|
-
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
5
|
-
|
|
6
|
-
//#region src/helpers/persistence.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* Resolves the runtime type definition file for the environment variables.
|
|
9
|
-
*
|
|
10
|
-
* @param context - The plugin context.
|
|
11
|
-
* @returns The runtime type definition file for the environment variables.
|
|
12
|
-
*/
|
|
13
|
-
declare function resolveRuntimeTypeFile(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<string>;
|
|
14
|
-
/**
|
|
15
|
-
* Gets the default type definition for the environment variables.
|
|
16
|
-
*
|
|
17
|
-
* @param context - The plugin context.
|
|
18
|
-
* @returns The default type definition for the environment variables.
|
|
19
|
-
*/
|
|
20
|
-
declare function getEnvDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
|
|
21
|
-
/** Gets the default type definition for the environment secrets.
|
|
22
|
-
*
|
|
23
|
-
* @param context - The plugin context.
|
|
24
|
-
* @returns The default type definition for the environment secrets.
|
|
25
|
-
*/
|
|
26
|
-
declare function getSecretsDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
|
|
27
|
-
/**
|
|
28
|
-
* Gets the path to the environment type reflections.
|
|
29
|
-
*
|
|
30
|
-
* @param context - The plugin context.
|
|
31
|
-
* @param name - The name of the type reflections.
|
|
32
|
-
* @returns The path to the environment type reflections.
|
|
33
|
-
*/
|
|
34
|
-
declare function getEnvTypeReflectionsPath(context: Context<EnvPluginResolvedConfig>, name?: EnvType): string;
|
|
35
|
-
/**
|
|
36
|
-
* Reads the environment type reflection from the file system.
|
|
37
|
-
*
|
|
38
|
-
* @param context - The plugin context.
|
|
39
|
-
* @param name - The name of the type reflections.
|
|
40
|
-
* @returns The environment type reflection.
|
|
41
|
-
*/
|
|
42
|
-
declare function readEnvTypeReflection(context: EnvPluginContext, name?: EnvType): Promise<ReflectionClass<any>>;
|
|
43
|
-
/**
|
|
44
|
-
* Writes the environment type reflection to the file system.
|
|
45
|
-
*
|
|
46
|
-
* @param context - The plugin context.
|
|
47
|
-
* @param reflection - The environment type reflection to write.
|
|
48
|
-
* @param name - The name of the type reflections.
|
|
49
|
-
*/
|
|
50
|
-
declare function writeEnvTypeReflection(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): Promise<void>;
|
|
51
|
-
declare function getEnvReflectionsPath(context: EnvPluginContext, name: EnvType): string;
|
|
52
|
-
/**
|
|
53
|
-
* Reads the environment reflection data from the file system.
|
|
54
|
-
*
|
|
55
|
-
* @param context - The plugin context.
|
|
56
|
-
* @returns The environment reflection data.
|
|
57
|
-
*/
|
|
58
|
-
declare function readEnvReflection(context: EnvPluginContext): Promise<ReflectionClass<any>>;
|
|
59
|
-
/**
|
|
60
|
-
* Reads the secret environment reflection data from the file system.
|
|
61
|
-
*
|
|
62
|
-
* @param context - The plugin context.
|
|
63
|
-
* @returns The environment reflection data.
|
|
64
|
-
*/
|
|
65
|
-
declare function readSecretsReflection(context: EnvPluginContext): Promise<ReflectionClass<any>>;
|
|
66
|
-
/**
|
|
67
|
-
* Writes the environment reflection data to the file system.
|
|
68
|
-
*
|
|
69
|
-
* @param context - The plugin context.
|
|
70
|
-
* @param reflection - The reflection data to write.
|
|
71
|
-
* @param name - The name of the reflection (either "env" or "secrets").
|
|
72
|
-
*/
|
|
73
|
-
declare function writeEnvReflection(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* Writes the environment reflection data to the file system.
|
|
76
|
-
*
|
|
77
|
-
* @param context - The plugin context.
|
|
78
|
-
* @param reflection - The reflection data to write.
|
|
79
|
-
* @param name - The name of the reflection (either "env" or "secrets").
|
|
80
|
-
*/
|
|
81
|
-
declare function writeEnvReflectionSync(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): void;
|
|
82
|
-
//#endregion
|
|
83
|
-
export { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
|
|
84
|
-
//# sourceMappingURL=persistence.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.d.cts","names":[],"sources":["../../src/helpers/persistence.ts"],"mappings":";;;;;;;;AAoDA;;;;iBAAsB,sBAAA,CACpB,OAAA,EAAS,iBAAA,CAAkB,uBAAA,IAC1B,OAAA;;;;;;;iBAmBmB,2BAAA,CACpB,OAAA,EAAS,iBAAA,CAAkB,uBAAA,IAC1B,OAAA,CAAQ,cAAA;;;AAFX;;;iBAcsB,+BAAA,CACpB,OAAA,EAAS,iBAAA,CAAkB,uBAAA,IAC1B,OAAA,CAAQ,cAAA;;;;;;;;iBAcK,yBAAA,CACd,OAAA,EAAS,OAAA,CAAQ,uBAAA,GACjB,IAAA,GAAM,OAAA;;;;;AAlBR;;;iBA8BsB,qBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,IAAA,GAAM,OAAA,GACL,OAAA,CAAQ,eAAA;;;;;;;;iBAuCW,sBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,UAAA,EAAY,eAAA,OACZ,IAAA,GAAM,OAAA,GAAe,OAAA;AAAA,iBAeP,qBAAA,CACd,OAAA,EAAS,gBAAA,EACT,IAAA,EAAM,OAAA;;;;AA5ER;;;iBAuFsB,iBAAA,CACpB,OAAA,EAAS,gBAAA,GACR,OAAA,CAAQ,eAAA;;;;;;;iBAuDW,qBAAA,CACpB,OAAA,EAAS,gBAAA,GACR,OAAA,CAAQ,eAAA;;;;;AApIX;;;iBA+LsB,kBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,UAAA,EAAY,eAAA,OACZ,IAAA,GAAM,OAAA,GAAe,OAAA;;;;;;;;iBAsBP,sBAAA,CACd,OAAA,EAAS,gBAAA,EACT,UAAA,EAAY,eAAA,OACZ,IAAA,GAAM,OAAA"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { EnvPluginContext, EnvPluginResolvedConfig, EnvType } from "../types/plugin.mjs";
|
|
2
|
-
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
3
|
-
import { Context, UnresolvedContext } from "powerlines";
|
|
4
|
-
import { TypeDefinition } from "@stryke/types/configuration";
|
|
5
|
-
|
|
6
|
-
//#region src/helpers/persistence.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* Resolves the runtime type definition file for the environment variables.
|
|
9
|
-
*
|
|
10
|
-
* @param context - The plugin context.
|
|
11
|
-
* @returns The runtime type definition file for the environment variables.
|
|
12
|
-
*/
|
|
13
|
-
declare function resolveRuntimeTypeFile(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<string>;
|
|
14
|
-
/**
|
|
15
|
-
* Gets the default type definition for the environment variables.
|
|
16
|
-
*
|
|
17
|
-
* @param context - The plugin context.
|
|
18
|
-
* @returns The default type definition for the environment variables.
|
|
19
|
-
*/
|
|
20
|
-
declare function getEnvDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
|
|
21
|
-
/** Gets the default type definition for the environment secrets.
|
|
22
|
-
*
|
|
23
|
-
* @param context - The plugin context.
|
|
24
|
-
* @returns The default type definition for the environment secrets.
|
|
25
|
-
*/
|
|
26
|
-
declare function getSecretsDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
|
|
27
|
-
/**
|
|
28
|
-
* Gets the path to the environment type reflections.
|
|
29
|
-
*
|
|
30
|
-
* @param context - The plugin context.
|
|
31
|
-
* @param name - The name of the type reflections.
|
|
32
|
-
* @returns The path to the environment type reflections.
|
|
33
|
-
*/
|
|
34
|
-
declare function getEnvTypeReflectionsPath(context: Context<EnvPluginResolvedConfig>, name?: EnvType): string;
|
|
35
|
-
/**
|
|
36
|
-
* Reads the environment type reflection from the file system.
|
|
37
|
-
*
|
|
38
|
-
* @param context - The plugin context.
|
|
39
|
-
* @param name - The name of the type reflections.
|
|
40
|
-
* @returns The environment type reflection.
|
|
41
|
-
*/
|
|
42
|
-
declare function readEnvTypeReflection(context: EnvPluginContext, name?: EnvType): Promise<ReflectionClass<any>>;
|
|
43
|
-
/**
|
|
44
|
-
* Writes the environment type reflection to the file system.
|
|
45
|
-
*
|
|
46
|
-
* @param context - The plugin context.
|
|
47
|
-
* @param reflection - The environment type reflection to write.
|
|
48
|
-
* @param name - The name of the type reflections.
|
|
49
|
-
*/
|
|
50
|
-
declare function writeEnvTypeReflection(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): Promise<void>;
|
|
51
|
-
declare function getEnvReflectionsPath(context: EnvPluginContext, name: EnvType): string;
|
|
52
|
-
/**
|
|
53
|
-
* Reads the environment reflection data from the file system.
|
|
54
|
-
*
|
|
55
|
-
* @param context - The plugin context.
|
|
56
|
-
* @returns The environment reflection data.
|
|
57
|
-
*/
|
|
58
|
-
declare function readEnvReflection(context: EnvPluginContext): Promise<ReflectionClass<any>>;
|
|
59
|
-
/**
|
|
60
|
-
* Reads the secret environment reflection data from the file system.
|
|
61
|
-
*
|
|
62
|
-
* @param context - The plugin context.
|
|
63
|
-
* @returns The environment reflection data.
|
|
64
|
-
*/
|
|
65
|
-
declare function readSecretsReflection(context: EnvPluginContext): Promise<ReflectionClass<any>>;
|
|
66
|
-
/**
|
|
67
|
-
* Writes the environment reflection data to the file system.
|
|
68
|
-
*
|
|
69
|
-
* @param context - The plugin context.
|
|
70
|
-
* @param reflection - The reflection data to write.
|
|
71
|
-
* @param name - The name of the reflection (either "env" or "secrets").
|
|
72
|
-
*/
|
|
73
|
-
declare function writeEnvReflection(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* Writes the environment reflection data to the file system.
|
|
76
|
-
*
|
|
77
|
-
* @param context - The plugin context.
|
|
78
|
-
* @param reflection - The reflection data to write.
|
|
79
|
-
* @param name - The name of the reflection (either "env" or "secrets").
|
|
80
|
-
*/
|
|
81
|
-
declare function writeEnvReflectionSync(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): void;
|
|
82
|
-
//#endregion
|
|
83
|
-
export { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
|
|
84
|
-
//# sourceMappingURL=persistence.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.d.mts","names":[],"sources":["../../src/helpers/persistence.ts"],"mappings":";;;;;;;;AAoDA;;;;iBAAsB,sBAAA,CACpB,OAAA,EAAS,iBAAA,CAAkB,uBAAA,IAC1B,OAAA;;;;;;;iBAmBmB,2BAAA,CACpB,OAAA,EAAS,iBAAA,CAAkB,uBAAA,IAC1B,OAAA,CAAQ,cAAA;;;AAFX;;;iBAcsB,+BAAA,CACpB,OAAA,EAAS,iBAAA,CAAkB,uBAAA,IAC1B,OAAA,CAAQ,cAAA;;;;;;;;iBAcK,yBAAA,CACd,OAAA,EAAS,OAAA,CAAQ,uBAAA,GACjB,IAAA,GAAM,OAAA;;;;;AAlBR;;;iBA8BsB,qBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,IAAA,GAAM,OAAA,GACL,OAAA,CAAQ,eAAA;;;;;;;;iBAuCW,sBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,UAAA,EAAY,eAAA,OACZ,IAAA,GAAM,OAAA,GAAe,OAAA;AAAA,iBAeP,qBAAA,CACd,OAAA,EAAS,gBAAA,EACT,IAAA,EAAM,OAAA;;;;AA5ER;;;iBAuFsB,iBAAA,CACpB,OAAA,EAAS,gBAAA,GACR,OAAA,CAAQ,eAAA;;;;;;;iBAuDW,qBAAA,CACpB,OAAA,EAAS,gBAAA,GACR,OAAA,CAAQ,eAAA;;;;;AApIX;;;iBA+LsB,kBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,UAAA,EAAY,eAAA,OACZ,IAAA,GAAM,OAAA,GAAe,OAAA;;;;;;;;iBAsBP,sBAAA,CACd,OAAA,EAAS,gBAAA,EACT,UAAA,EAAY,eAAA,OACZ,IAAA,GAAM,OAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__ΩEnvPluginContext as e,__ΩEnvType as t}from"../types/plugin.mjs";import{createEnvReflection as n}from"./reflect.mjs";import{convertFromCapnp as r,convertToCapnp as i}from"@powerlines/deepkit/capnp";import{getReflectionsPath as a}from"@powerlines/deepkit/resolve-reflections";import{SerializedTypes as o}from"@powerlines/deepkit/schemas/reflection";import{ReflectionKind as s,deserializeType as c,resolveClassType as l}from"@powerlines/deepkit/vendor/type";import*as u from"@stryke/capnp";import{readFileBuffer as d,writeFileBuffer as f,writeFileBufferSync as p}from"@stryke/fs/buffer";import{joinPaths as m}from"@stryke/path/join-paths";import{isEmptyObject as h}from"@stryke/type-checks/is-empty-object";import{existsSync as g}from"node:fs";async function _(e){let t=await e.fs.resolve(`@powerlines/plugin-env/types/runtime`);if(!t)throw Error(`Failed to resolve the runtime type definition file for the environment variables. Please ensure that the "@powerlines/plugin-env" package is installed.`);return t}_.__type=[`context`,`resolveRuntimeTypeFile`,`Resolves the runtime type definition file for the environment variables.`,'P!2!&`/"?#'];async function v(e){return{file:await _(e),name:`EnvInterface`}}v.__type=[`context`,`getEnvDefaultTypeDefinition`,`Gets the default type definition for the environment variables.`,'P!2!!`/"?#'];async function y(e){return{file:await _(e),name:`SecretsInterface`}}y.__type=[`context`,`getSecretsDefaultTypeDefinition`,'P!2!!`/"'];function b(e,t=`env`){return m(a(e),`env`,`${t}-types.bin`)}b.__type=[`context`,()=>t,`name`,()=>`env`,`getEnvTypeReflectionsPath`,`Gets the path to the environment type reflections.`,`P!2!n"2#>$&/%?&`];async function x(e,t=`env`){let i=b(e,t);if(!g(i)){if(!e.env.types.env||h(e.env.types.env)){let r=n(e),i=new u.Message;r.messageRoot=i.initRoot(o),r.dataBuffer=i.toArrayBuffer(),e.env.types.env=r,await S(e,e.env.types.env,t)}return e.env.types.env}let a=await d(i),s=new u.Message(a,!1).getRoot(o),f=l(c(r(s.types)));return e.env.types[t]=f,e.env.types[t].messageRoot=s,e.env.types[t].dataBuffer=a,f}x.__type=[()=>e,`context`,()=>t,`name`,()=>`env`,`readEnvTypeReflection`,`Reads the environment type reflection from the file system.`,`Pn!2"n#2$>%!\`/&?'`];async function S(e,t,n=`env`){let r=t.serializeType(),a=new u.Message;i(r,a.initRoot(o)._initTypes(r.length)),await f(b(e,n),a.toArrayBuffer())}S.__type=[()=>e,`context`,`reflection`,()=>t,`name`,()=>`env`,`writeEnvTypeReflection`,`Writes the environment type reflection to the file system.`,`Pn!2"!2#n$2%>&"/'?(`];function C(e,t){return m(a(e),`env`,`${t}.bin`)}C.__type=[()=>e,`context`,()=>t,`name`,`getEnvReflectionsPath`,`Pn!2"n#2$&/%`];async function w(e){let t=C(e,`env`);if(!g(t)){if(e.env.types.env||(e.env.types.env=await x(e,`env`)),!e.env.used.env||h(e.env.used.env)){let t=n(e,{type:{kind:s.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:`application`}.`,types:[]},superReflection:e.env.types.env});t.name=`Env`;let r=new u.Message;t.messageRoot=r.initRoot(o),t.dataBuffer=r.toArrayBuffer(),e.env.used.env=t,await E(e,e.env.used.env,`env`)}return e.env.used.env}let i=await d(t),a=new u.Message(i,!1).getRoot(o),f=l(c(r(a.types)));return e.env.used.env=f,e.env.used.env.messageRoot=a,e.env.used.env.dataBuffer=i,f}w.__type=[()=>e,`context`,`readEnvReflection`,`Reads the environment reflection data from the file system.`,'Pn!2"!`/#?$'];async function T(e){let t=C(e,`secrets`);if(!g(t)){if(e.env.types.secrets||(e.env.types.secrets=await x(e,`secrets`)),!e.env.used.secrets||h(e.env.used.secrets)){let t=n(e,{type:{kind:s.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters that are used (at least once) by the ${e.config.name?`${e.config.name} application`:`application`}.`,types:[]},superReflection:e.env.types.secrets});t.name=`Secrets`;let r=new u.Message;t.messageRoot=r.initRoot(o),t.dataBuffer=r.toArrayBuffer(),e.env.used.secrets=t,await E(e,e.env.used.secrets,`secrets`)}return e.env.used.secrets}let i=await d(t),a=new u.Message(i,!1).getRoot(o),f=l(c(r(a.types)));return e.env.used.secrets=f,e.env.used.secrets.messageRoot=a,e.env.used.secrets.dataBuffer=i,f}T.__type=[()=>e,`context`,`readSecretsReflection`,`Reads the secret environment reflection data from the file system.`,'Pn!2"!`/#?$'];async function E(e,t,n=`env`){let r=t.serializeType(),a=new u.Message;i(r,a.initRoot(o)._initTypes(r.length)),await f(C(e,n),a.toArrayBuffer())}E.__type=[()=>e,`context`,`reflection`,()=>t,`name`,()=>`env`,`writeEnvReflection`,`Writes the environment reflection data to the file system.`,`Pn!2"!2#n$2%>&"/'?(`];function D(e,t,n=`env`){let r=t.serializeType(),a=new u.Message;i(r,a.initRoot(o)._initTypes(r.length)),p(C(e,n),a.toArrayBuffer())}D.__type=[()=>e,`context`,`reflection`,()=>t,`name`,()=>`env`,`writeEnvReflectionSync`,`Writes the environment reflection data to the file system.`,`Pn!2"!2#n$2%>&"/'?(`];export{v as getEnvDefaultTypeDefinition,C as getEnvReflectionsPath,b as getEnvTypeReflectionsPath,y as getSecretsDefaultTypeDefinition,w as readEnvReflection,x as readEnvTypeReflection,T as readSecretsReflection,_ as resolveRuntimeTypeFile,E as writeEnvReflection,D as writeEnvReflectionSync,S as writeEnvTypeReflection};
|
|
2
|
-
//# sourceMappingURL=persistence.mjs.map
|