@powerlines/plugin-env 0.14.4 → 0.14.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{_virtual/rolldown_runtime.mjs → chunk-D1UamjDs.mjs} +1 -1
- package/dist/components/docs.cjs +1 -1
- package/dist/components/docs.d.cts +1 -8
- package/dist/components/docs.d.mts +1 -8
- package/dist/components/docs.mjs +1 -1
- package/dist/components/env.cjs +1 -34
- package/dist/components/env.d.cts +1 -19
- package/dist/components/env.d.mts +1 -19
- package/dist/components/env.mjs +1 -31
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.cts +3 -2
- package/dist/components/index.d.mts +3 -2
- package/dist/components/index.mjs +1 -1
- package/dist/components-ByVHjWXF.mjs +1 -0
- package/dist/components-C9bYrQVK.cjs +0 -0
- package/dist/create-reflection-resource-BtYlphp1.mjs +17 -0
- package/dist/create-reflection-resource-CdrQyUuT.cjs +17 -0
- package/dist/docs-CKCRAUnO.d.mts +9 -0
- package/dist/docs-CMoOO30q.mjs +1 -0
- package/dist/docs-CdtUw4WA.d.cts +9 -0
- package/dist/docs-DWXbRrEK.cjs +1 -0
- package/dist/env-Bwys2dqb.mjs +31 -0
- package/dist/env-COWzTupf.d.cts +20 -0
- package/dist/env-DqPOEUEu.d.mts +20 -0
- package/dist/env-mhFQyGk4.cjs +34 -0
- package/dist/index-B_e8BwCm.d.cts +1 -0
- package/dist/index-CW2WHUXP.d.mts +1 -0
- package/dist/index-DCQ5Y2ED.d.mts +1 -0
- package/dist/index-DWPDThxu.d.cts +1 -0
- package/dist/index.cjs +8 -4
- package/dist/index.d.cts +185 -12
- package/dist/index.d.mts +185 -17
- package/dist/index.mjs +8 -4
- package/dist/{deepkit/schemas/reflection.d.mts → plugin-CuDS8_K8.d.mts} +261 -1
- package/dist/plugin-CyRU_Pln.mjs +1 -0
- package/dist/plugin-D5qyQPqC.cjs +0 -0
- package/dist/{deepkit/schemas/reflection.d.cts → plugin-vBgCrEuY.d.cts} +260 -1
- package/dist/runtime-Bisl_1Ja.cjs +0 -0
- package/dist/runtime-CRLPiOqf.d.mts +2499 -0
- package/dist/runtime-g_eXGBBi.mjs +1 -0
- package/dist/runtime-rhT2IfSg.d.cts +2497 -0
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.mts +3 -2
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +2 -148
- package/dist/types/plugin.d.mts +2 -149
- package/dist/types/plugin.mjs +1 -1
- package/dist/types/runtime.cjs +1 -0
- package/dist/types/runtime.d.cts +1 -793
- package/dist/types/runtime.d.mts +1 -793
- package/dist/types/runtime.mjs +1 -1
- package/dist/types-DMh7K7VC.mjs +1 -0
- package/dist/types-MYBaygjr.cjs +0 -0
- package/package.json +10 -8
- package/dist/_virtual/rolldown_runtime.cjs +0 -1
- package/dist/alloy/src/core/components/output.cjs +0 -1
- package/dist/alloy/src/core/components/output.mjs +0 -1
- package/dist/alloy/src/core/components/single-line-comment.cjs +0 -1
- package/dist/alloy/src/core/components/single-line-comment.mjs +0 -1
- package/dist/alloy/src/core/components/source-file.cjs +0 -1
- package/dist/alloy/src/core/components/source-file.d.cts +0 -22
- package/dist/alloy/src/core/components/source-file.d.mts +0 -22
- package/dist/alloy/src/core/components/source-file.mjs +0 -1
- package/dist/alloy/src/core/contexts/context.cjs +0 -1
- package/dist/alloy/src/core/contexts/context.mjs +0 -1
- package/dist/alloy/src/core/contexts/reflection.cjs +0 -1
- package/dist/alloy/src/core/contexts/reflection.mjs +0 -1
- package/dist/alloy/src/create-plugin.cjs +0 -2
- package/dist/alloy/src/create-plugin.mjs +0 -2
- package/dist/alloy/src/helpers/refkey.cjs +0 -1
- package/dist/alloy/src/helpers/refkey.mjs +0 -1
- package/dist/alloy/src/markdown/components/markdown-file.cjs +0 -1
- package/dist/alloy/src/markdown/components/markdown-file.mjs +0 -1
- package/dist/alloy/src/markdown/components/markdown-table.cjs +0 -1
- package/dist/alloy/src/markdown/components/markdown-table.mjs +0 -1
- package/dist/alloy/src/markdown/contexts/markdown-table.cjs +0 -1
- package/dist/alloy/src/markdown/contexts/markdown-table.mjs +0 -1
- package/dist/alloy/src/types/components.d.cts +0 -19
- package/dist/alloy/src/types/components.d.mts +0 -23
- package/dist/alloy/src/typescript/components/builtin-file.cjs +0 -1
- package/dist/alloy/src/typescript/components/builtin-file.d.cts +0 -25
- package/dist/alloy/src/typescript/components/builtin-file.d.mts +0 -26
- package/dist/alloy/src/typescript/components/builtin-file.mjs +0 -1
- package/dist/alloy/src/typescript/components/tsdoc-reflection.cjs +0 -1
- package/dist/alloy/src/typescript/components/tsdoc-reflection.mjs +0 -1
- package/dist/alloy/src/typescript/components/tsdoc.cjs +0 -1
- package/dist/alloy/src/typescript/components/tsdoc.d.cts +0 -27
- package/dist/alloy/src/typescript/components/tsdoc.d.mts +0 -28
- package/dist/alloy/src/typescript/components/tsdoc.mjs +0 -1
- package/dist/alloy/src/typescript/components/typescript-file.cjs +0 -1
- package/dist/alloy/src/typescript/components/typescript-file.d.cts +0 -14
- package/dist/alloy/src/typescript/components/typescript-file.d.mts +0 -15
- package/dist/alloy/src/typescript/components/typescript-file.mjs +0 -1
- package/dist/alloy/src/typescript/components/typescript-interface.cjs +0 -1
- package/dist/alloy/src/typescript/components/typescript-interface.d.cts +0 -11
- package/dist/alloy/src/typescript/components/typescript-interface.d.mts +0 -12
- package/dist/alloy/src/typescript/components/typescript-interface.mjs +0 -1
- package/dist/alloy/src/typescript/components/typescript-object.cjs +0 -1
- package/dist/alloy/src/typescript/components/typescript-object.mjs +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 -7
- package/dist/babel/plugin.d.mts +0 -9
- package/dist/babel/plugin.mjs +0 -5
- package/dist/deepkit/schemas/reflection.cjs +0 -1
- package/dist/deepkit/schemas/reflection.mjs +0 -1
- package/dist/deepkit/schemas/reflection2.cjs +0 -1
- package/dist/deepkit/schemas/reflection2.mjs +0 -1
- package/dist/deepkit/src/capnp.cjs +0 -1
- package/dist/deepkit/src/capnp.mjs +0 -1
- package/dist/deepkit/src/esbuild-plugin.cjs +0 -4
- package/dist/deepkit/src/esbuild-plugin.mjs +0 -4
- package/dist/deepkit/src/reflect-type.cjs +0 -1
- package/dist/deepkit/src/reflect-type.mjs +0 -1
- package/dist/deepkit/src/resolve-reflections.cjs +0 -1
- package/dist/deepkit/src/resolve-reflections.mjs +0 -1
- package/dist/deepkit/src/transformer.cjs +0 -1
- package/dist/deepkit/src/transformer.mjs +0 -1
- package/dist/deepkit/src/transpile.cjs +0 -1
- package/dist/deepkit/src/transpile.mjs +0 -1
- package/dist/deepkit/src/types.d.cts +0 -10
- package/dist/deepkit/src/types.d.mts +0 -10
- package/dist/deepkit/src/utilities.cjs +0 -1
- package/dist/deepkit/src/utilities.mjs +0 -1
- package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -1
- package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -1
- package/dist/deepkit/src/vendor/type.cjs +0 -1
- package/dist/deepkit/src/vendor/type.d.cts +0 -7
- package/dist/deepkit/src/vendor/type.d.mts +0 -7
- package/dist/deepkit/src/vendor/type.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.mts +0 -14
- package/dist/helpers/automd-generator.mjs +0 -1
- package/dist/helpers/create-reflection-resource.cjs +0 -1
- package/dist/helpers/create-reflection-resource.d.cts +0 -15
- package/dist/helpers/create-reflection-resource.d.mts +0 -15
- package/dist/helpers/create-reflection-resource.mjs +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 -35
- package/dist/helpers/load.d.mts +0 -36
- package/dist/helpers/load.mjs +0 -1
- package/dist/helpers/persistence.cjs +0 -1
- package/dist/helpers/persistence.d.cts +0 -84
- package/dist/helpers/persistence.d.mts +0 -84
- package/dist/helpers/persistence.mjs +0 -1
- package/dist/helpers/reflect.cjs +0 -1
- package/dist/helpers/reflect.d.cts +0 -46
- package/dist/helpers/reflect.d.mts +0 -46
- package/dist/helpers/reflect.mjs +0 -1
- package/dist/helpers/source-file-env.cjs +0 -1
- package/dist/helpers/source-file-env.d.cts +0 -8
- package/dist/helpers/source-file-env.d.mts +0 -8
- package/dist/helpers/source-file-env.mjs +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.mts +0 -15
- package/dist/helpers/template-helpers.mjs +0 -1
- package/dist/plugin-automd/src/index.cjs +0 -1
- package/dist/plugin-automd/src/index.mjs +0 -1
- package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
- package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
- package/dist/plugin-automd/src/types/toc.d.cts +0 -33
- package/dist/plugin-automd/src/types/toc.d.mts +0 -33
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -1
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -1
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -1
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -1
- package/dist/plugin-babel/src/helpers/filters.cjs +0 -1
- package/dist/plugin-babel/src/helpers/filters.mjs +0 -1
- package/dist/plugin-babel/src/helpers/index.cjs +0 -1
- package/dist/plugin-babel/src/helpers/index.mjs +0 -1
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -1
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -1
- package/dist/plugin-babel/src/helpers/options.cjs +0 -1
- package/dist/plugin-babel/src/helpers/options.mjs +0 -1
- package/dist/plugin-babel/src/index.cjs +0 -1
- package/dist/plugin-babel/src/index.mjs +0 -1
- package/dist/plugin-babel/src/types/index.d.mts +0 -1
- package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
- package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
- package/dist/powerlines/schemas/fs.d.mts +0 -1
- package/dist/powerlines/src/api.d.mts +0 -7
- package/dist/powerlines/src/index.d.mts +0 -12
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -5
- package/dist/powerlines/src/lib/build/esbuild.cjs +0 -14
- package/dist/powerlines/src/lib/build/esbuild.mjs +0 -14
- package/dist/powerlines/src/lib/entry.cjs +0 -1
- package/dist/powerlines/src/lib/entry.mjs +0 -1
- package/dist/powerlines/src/lib/logger.cjs +0 -1
- package/dist/powerlines/src/lib/logger.mjs +0 -1
- package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -1
- package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -1
- package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -1
- package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -1
- package/dist/powerlines/src/plugin-utils/helpers.cjs +0 -1
- package/dist/powerlines/src/plugin-utils/helpers.mjs +0 -1
- package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
- package/dist/powerlines/src/plugin-utils/paths.mjs +0 -1
- package/dist/powerlines/src/types/api.d.mts +0 -5
- package/dist/powerlines/src/types/babel.d.cts +0 -23
- package/dist/powerlines/src/types/babel.d.mts +0 -23
- package/dist/powerlines/src/types/build.d.cts +0 -145
- package/dist/powerlines/src/types/build.d.mts +0 -147
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -9
- package/dist/powerlines/src/types/config.d.cts +0 -368
- package/dist/powerlines/src/types/config.d.mts +0 -369
- package/dist/powerlines/src/types/context.d.cts +0 -373
- package/dist/powerlines/src/types/context.d.mts +0 -375
- package/dist/powerlines/src/types/fs.d.cts +0 -458
- package/dist/powerlines/src/types/fs.d.mts +0 -458
- package/dist/powerlines/src/types/hooks.d.mts +0 -2
- package/dist/powerlines/src/types/index.d.mts +0 -12
- package/dist/powerlines/src/types/plugin.d.cts +0 -232
- package/dist/powerlines/src/types/plugin.d.mts +0 -232
- package/dist/powerlines/src/types/resolved.d.cts +0 -82
- package/dist/powerlines/src/types/resolved.d.mts +0 -83
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
- package/dist/powerlines/src/types/unplugin.d.mts +0 -7
package/dist/helpers/load.d.mts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { EnvironmentResolvedConfig } from "../powerlines/src/types/resolved.mjs";
|
|
2
|
-
import "../powerlines/src/index.mjs";
|
|
3
|
-
import { EnvPluginContext, EnvPluginOptions } from "../types/plugin.mjs";
|
|
4
|
-
import { DotenvParseOutput } from "@stryke/env/types";
|
|
5
|
-
|
|
6
|
-
//#region src/helpers/load.d.ts
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves various dotenv configuration parameters from the context.
|
|
10
|
-
*
|
|
11
|
-
* @param context - The context to retrieve the dotenv configuration from.
|
|
12
|
-
* @param parsed - The parsed dotenv configuration.
|
|
13
|
-
* @returns An object containing the dotenv configuration.
|
|
14
|
-
*/
|
|
15
|
-
declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvParseOutput): {
|
|
16
|
-
APP_NAME: string | undefined;
|
|
17
|
-
APP_VERSION: string | undefined;
|
|
18
|
-
BUILD_ID: string;
|
|
19
|
-
BUILD_TIMESTAMP: string;
|
|
20
|
-
BUILD_CHECKSUM: string;
|
|
21
|
-
RELEASE_ID: string;
|
|
22
|
-
RELEASE_TAG: string;
|
|
23
|
-
DEFAULT_LOCALE: string | undefined;
|
|
24
|
-
DEFAULT_TIMEZONE: string | undefined;
|
|
25
|
-
LOG_LEVEL: "error" | "warn" | "info" | "debug" | "trace" | null;
|
|
26
|
-
ERROR_URL: string | undefined;
|
|
27
|
-
ORGANIZATION: string | undefined;
|
|
28
|
-
PLATFORM: "node" | "browser" | "neutral" | undefined;
|
|
29
|
-
MODE: "test" | "development" | "production" | undefined;
|
|
30
|
-
DEBUG: boolean;
|
|
31
|
-
STACKTRACE: boolean;
|
|
32
|
-
ENVIRONMENT: EnvironmentResolvedConfig;
|
|
33
|
-
};
|
|
34
|
-
declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { loadEnv, loadEnvFromContext };
|
package/dist/helpers/load.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{removeEnvPrefix as e}from"./source-file-env.mjs";import{joinPaths as t}from"@stryke/path/join-paths";import n from"defu";import{isSetString as r}from"@stryke/type-checks/is-set-string";import{loadEnv as i,loadEnvFile as a}from"@stryke/env/load-env";import{kebabCase as o}from"@stryke/string-format/kebab-case";import{isSetObject as s}from"@stryke/type-checks/is-set-object";import{loadConfig as c}from"c12";async function l(t,r,o){let s=await i(o,r);if(t.additionalFiles&&t.additionalFiles?.length>0){let e=await Promise.all(t.additionalFiles.map(async e=>a(e,o)));for(let t of e)s=n(t,s)}return e(s)}async function u(e,r,i,a,o,s){let[u,d]=await Promise.all([l(e,i,r),c({cwd:r,name:`storm`,envName:i,defaults:{NAME:o.name?.replace(`@${s.namespace}/`,``),MODE:i,ORG:s.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:t(a,`jiti`),moduleCache:!0}})]);return n(u,d.config,s)}function d(e,t){return n({APP_NAME:o(e.config.name||e.packageJson.name?.replace(`/${e.workspaceConfig.namespace}`,``)),APP_VERSION:e.packageJson.version,BUILD_ID:e.meta.buildId,BUILD_TIMESTAMP:new Date(e.meta.timestamp).toISOString(),BUILD_CHECKSUM:e.meta.checksum,RELEASE_ID:e.meta.releaseId,RELEASE_TAG:`${o(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:e.workspaceConfig.locale,DEFAULT_TIMEZONE:e.workspaceConfig.timezone,LOG_LEVEL:e.config.logLevel,ERROR_URL:e.workspaceConfig.error?.url,ORGANIZATION:r(e.workspaceConfig.organization)?e.workspaceConfig.organization:e.workspaceConfig.organization?.name,PLATFORM:e.config.build.platform,MODE:e.workspaceConfig.mode,DEBUG:e.workspaceConfig.mode===`development`,STACKTRACE:e.workspaceConfig.mode===`development`,ENVIRONMENT:e.environment},s(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce((e,n)=>(e[n.name]=t[n.name]??n.getDefaultValue(),e),{}):{})}async function f(e,t){let[r,i,a]=await Promise.all([u(t,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return n(d(e,process.env),r,i,a)}export{f as loadEnv,d as loadEnvFromContext};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../deepkit/src/vendor/type.cjs`),n=require(`../deepkit/src/capnp.cjs`),r=require(`../deepkit/src/resolve-reflections.cjs`),i=require(`../deepkit/schemas/reflection2.cjs`),a=require(`./reflect.cjs`);let o=require(`@stryke/capnp`);o=e.__toESM(o);let s=require(`@stryke/path/join-paths`),c=require(`@stryke/fs/buffer`),l=require(`@stryke/fs/resolve`),u=require(`@stryke/type-checks/is-empty-object`),d=require(`node:fs`);async function f(e){return(0,l.resolvePackage)(`@powerlines/plugin-env/types/runtime`,{paths:[e.workspaceConfig.workspaceRoot,(0,s.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot)]})}async function p(e){return{file:await f(e),name:`EnvInterface`}}async function m(e){return{file:await f(e),name:`SecretsInterface`}}function h(e,t=`env`){return(0,s.joinPaths)(r.getReflectionsPath(e),`env`,`${t}-types.bin`)}async function g(e,r=`env`){let s=h(e,r);if(!(0,d.existsSync)(s)){if(!e.env.types.env||(0,u.isEmptyObject)(e.env.types.env)){let t=a.createEnvReflection(e),n=new o.Message;t.messageRoot=n.initRoot(i.SerializedTypes),t.dataBuffer=n.toArrayBuffer(),e.env.types.env=t,await _(e,e.env.types.env,r)}return e.env.types.env}let l=await(0,c.readFileBuffer)(s),f=new o.Message(l,!1).getRoot(i.SerializedTypes),p=(0,t.type_exports.resolveClassType)((0,t.type_exports.deserializeType)(n.convertFromCapnp(f.types)));return e.env.types[r]=p,e.env.types[r].messageRoot=f,e.env.types[r].dataBuffer=l,p}async function _(e,t,r=`env`){let a=t.serializeType(),s=new o.Message;n.convertToCapnp(a,s.initRoot(i.SerializedTypes)._initTypes(a.length)),await(0,c.writeFileBuffer)(h(e,r),s.toArrayBuffer())}function v(e,t){return(0,s.joinPaths)(r.getReflectionsPath(e),`env`,`${t}.bin`)}async function y(e){let r=v(e,`env`);if(!(0,d.existsSync)(r)){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 n=a.createEnvReflection(e,{type:{kind:t.type_exports.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});n.name=`Env`;let r=new o.Message;n.messageRoot=r.initRoot(i.SerializedTypes),n.dataBuffer=r.toArrayBuffer(),e.env.used.env=n,await x(e,e.env.used.env,`env`)}return e.env.used.env}let s=await(0,c.readFileBuffer)(r),l=new o.Message(s,!1).getRoot(i.SerializedTypes),f=(0,t.type_exports.resolveClassType)((0,t.type_exports.deserializeType)(n.convertFromCapnp(l.types)));return e.env.used.env=f,e.env.used.env.messageRoot=l,e.env.used.env.dataBuffer=s,f}async function b(e){let r=v(e,`secrets`);if(!(0,d.existsSync)(r)){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 n=a.createEnvReflection(e,{type:{kind:t.type_exports.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});n.name=`Secrets`;let r=new o.Message;n.messageRoot=r.initRoot(i.SerializedTypes),n.dataBuffer=r.toArrayBuffer(),e.env.used.secrets=n,await x(e,e.env.used.secrets,`secrets`)}return e.env.used.secrets}let s=await(0,c.readFileBuffer)(r),l=new o.Message(s,!1).getRoot(i.SerializedTypes),f=(0,t.type_exports.resolveClassType)((0,t.type_exports.deserializeType)(n.convertFromCapnp(l.types)));return e.env.used.secrets=f,e.env.used.secrets.messageRoot=l,e.env.used.secrets.dataBuffer=s,f}async function x(e,t,r=`env`){let a=t.serializeType(),s=new o.Message;n.convertToCapnp(a,s.initRoot(i.SerializedTypes)._initTypes(a.length)),await(0,c.writeFileBuffer)(v(e,r),s.toArrayBuffer())}function S(e,t,r=`env`){let a=t.serializeType(),s=new o.Message;n.convertToCapnp(a,s.initRoot(i.SerializedTypes)._initTypes(a.length)),(0,c.writeFileBufferSync)(v(e,r),s.toArrayBuffer())}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 { Context, UnresolvedContext } from "../powerlines/src/types/context.cjs";
|
|
2
|
-
import { type_d_exports } from "../deepkit/src/vendor/type.cjs";
|
|
3
|
-
import { EnvPluginContext, EnvPluginResolvedConfig, EnvType } from "../types/plugin.cjs";
|
|
4
|
-
import { TypeDefinition } from "@stryke/types/configuration";
|
|
5
|
-
|
|
6
|
-
//#region src/helpers/persistence.d.ts
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Resolves the runtime type definition file for the environment variables.
|
|
10
|
-
*
|
|
11
|
-
* @param context - The plugin context.
|
|
12
|
-
* @returns The runtime type definition file for the environment variables.
|
|
13
|
-
*/
|
|
14
|
-
declare function resolveRuntimeTypeFile(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<string>;
|
|
15
|
-
/**
|
|
16
|
-
* Gets the default type definition for the environment variables.
|
|
17
|
-
*
|
|
18
|
-
* @param context - The plugin context.
|
|
19
|
-
* @returns The default type definition for the environment variables.
|
|
20
|
-
*/
|
|
21
|
-
declare function getEnvDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
|
|
22
|
-
/** Gets the default type definition for the environment secrets.
|
|
23
|
-
*
|
|
24
|
-
* @param context - The plugin context.
|
|
25
|
-
* @returns The default type definition for the environment secrets.
|
|
26
|
-
*/
|
|
27
|
-
declare function getSecretsDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
|
|
28
|
-
/**
|
|
29
|
-
* Gets the path to the environment type reflections.
|
|
30
|
-
*
|
|
31
|
-
* @param context - The plugin context.
|
|
32
|
-
* @param name - The name of the type reflections.
|
|
33
|
-
* @returns The path to the environment type reflections.
|
|
34
|
-
*/
|
|
35
|
-
declare function getEnvTypeReflectionsPath(context: Context<EnvPluginResolvedConfig>, name?: EnvType): string;
|
|
36
|
-
/**
|
|
37
|
-
* Reads the environment type reflection from the file system.
|
|
38
|
-
*
|
|
39
|
-
* @param context - The plugin context.
|
|
40
|
-
* @param name - The name of the type reflections.
|
|
41
|
-
* @returns The environment type reflection.
|
|
42
|
-
*/
|
|
43
|
-
declare function readEnvTypeReflection(context: EnvPluginContext, name?: EnvType): Promise<type_d_exports.ReflectionClass<any>>;
|
|
44
|
-
/**
|
|
45
|
-
* Writes the environment type reflection to the file system.
|
|
46
|
-
*
|
|
47
|
-
* @param context - The plugin context.
|
|
48
|
-
* @param reflection - The environment type reflection to write.
|
|
49
|
-
* @param name - The name of the type reflections.
|
|
50
|
-
*/
|
|
51
|
-
declare function writeEnvTypeReflection(context: EnvPluginContext, reflection: type_d_exports.ReflectionClass<any>, name?: EnvType): Promise<void>;
|
|
52
|
-
declare function getEnvReflectionsPath(context: EnvPluginContext, name: EnvType): string;
|
|
53
|
-
/**
|
|
54
|
-
* Reads the environment reflection data from the file system.
|
|
55
|
-
*
|
|
56
|
-
* @param context - The plugin context.
|
|
57
|
-
* @returns The environment reflection data.
|
|
58
|
-
*/
|
|
59
|
-
declare function readEnvReflection(context: EnvPluginContext): Promise<type_d_exports.ReflectionClass<any>>;
|
|
60
|
-
/**
|
|
61
|
-
* Reads the secret environment reflection data from the file system.
|
|
62
|
-
*
|
|
63
|
-
* @param context - The plugin context.
|
|
64
|
-
* @returns The environment reflection data.
|
|
65
|
-
*/
|
|
66
|
-
declare function readSecretsReflection(context: EnvPluginContext): Promise<type_d_exports.ReflectionClass<any>>;
|
|
67
|
-
/**
|
|
68
|
-
* Writes the environment reflection data to the file system.
|
|
69
|
-
*
|
|
70
|
-
* @param context - The plugin context.
|
|
71
|
-
* @param reflection - The reflection data to write.
|
|
72
|
-
* @param name - The name of the reflection (either "env" or "secrets").
|
|
73
|
-
*/
|
|
74
|
-
declare function writeEnvReflection(context: EnvPluginContext, reflection: type_d_exports.ReflectionClass<any>, name?: EnvType): Promise<void>;
|
|
75
|
-
/**
|
|
76
|
-
* Writes the environment reflection data to the file system.
|
|
77
|
-
*
|
|
78
|
-
* @param context - The plugin context.
|
|
79
|
-
* @param reflection - The reflection data to write.
|
|
80
|
-
* @param name - The name of the reflection (either "env" or "secrets").
|
|
81
|
-
*/
|
|
82
|
-
declare function writeEnvReflectionSync(context: EnvPluginContext, reflection: type_d_exports.ReflectionClass<any>, name?: EnvType): void;
|
|
83
|
-
//#endregion
|
|
84
|
-
export { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { Context, UnresolvedContext } from "../powerlines/src/types/context.mjs";
|
|
2
|
-
import { type_d_exports } from "../deepkit/src/vendor/type.mjs";
|
|
3
|
-
import { EnvPluginContext, EnvPluginResolvedConfig, EnvType } from "../types/plugin.mjs";
|
|
4
|
-
import { TypeDefinition } from "@stryke/types/configuration";
|
|
5
|
-
|
|
6
|
-
//#region src/helpers/persistence.d.ts
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Resolves the runtime type definition file for the environment variables.
|
|
10
|
-
*
|
|
11
|
-
* @param context - The plugin context.
|
|
12
|
-
* @returns The runtime type definition file for the environment variables.
|
|
13
|
-
*/
|
|
14
|
-
declare function resolveRuntimeTypeFile(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<string>;
|
|
15
|
-
/**
|
|
16
|
-
* Gets the default type definition for the environment variables.
|
|
17
|
-
*
|
|
18
|
-
* @param context - The plugin context.
|
|
19
|
-
* @returns The default type definition for the environment variables.
|
|
20
|
-
*/
|
|
21
|
-
declare function getEnvDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
|
|
22
|
-
/** Gets the default type definition for the environment secrets.
|
|
23
|
-
*
|
|
24
|
-
* @param context - The plugin context.
|
|
25
|
-
* @returns The default type definition for the environment secrets.
|
|
26
|
-
*/
|
|
27
|
-
declare function getSecretsDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
|
|
28
|
-
/**
|
|
29
|
-
* Gets the path to the environment type reflections.
|
|
30
|
-
*
|
|
31
|
-
* @param context - The plugin context.
|
|
32
|
-
* @param name - The name of the type reflections.
|
|
33
|
-
* @returns The path to the environment type reflections.
|
|
34
|
-
*/
|
|
35
|
-
declare function getEnvTypeReflectionsPath(context: Context<EnvPluginResolvedConfig>, name?: EnvType): string;
|
|
36
|
-
/**
|
|
37
|
-
* Reads the environment type reflection from the file system.
|
|
38
|
-
*
|
|
39
|
-
* @param context - The plugin context.
|
|
40
|
-
* @param name - The name of the type reflections.
|
|
41
|
-
* @returns The environment type reflection.
|
|
42
|
-
*/
|
|
43
|
-
declare function readEnvTypeReflection(context: EnvPluginContext, name?: EnvType): Promise<type_d_exports.ReflectionClass<any>>;
|
|
44
|
-
/**
|
|
45
|
-
* Writes the environment type reflection to the file system.
|
|
46
|
-
*
|
|
47
|
-
* @param context - The plugin context.
|
|
48
|
-
* @param reflection - The environment type reflection to write.
|
|
49
|
-
* @param name - The name of the type reflections.
|
|
50
|
-
*/
|
|
51
|
-
declare function writeEnvTypeReflection(context: EnvPluginContext, reflection: type_d_exports.ReflectionClass<any>, name?: EnvType): Promise<void>;
|
|
52
|
-
declare function getEnvReflectionsPath(context: EnvPluginContext, name: EnvType): string;
|
|
53
|
-
/**
|
|
54
|
-
* Reads the environment reflection data from the file system.
|
|
55
|
-
*
|
|
56
|
-
* @param context - The plugin context.
|
|
57
|
-
* @returns The environment reflection data.
|
|
58
|
-
*/
|
|
59
|
-
declare function readEnvReflection(context: EnvPluginContext): Promise<type_d_exports.ReflectionClass<any>>;
|
|
60
|
-
/**
|
|
61
|
-
* Reads the secret environment reflection data from the file system.
|
|
62
|
-
*
|
|
63
|
-
* @param context - The plugin context.
|
|
64
|
-
* @returns The environment reflection data.
|
|
65
|
-
*/
|
|
66
|
-
declare function readSecretsReflection(context: EnvPluginContext): Promise<type_d_exports.ReflectionClass<any>>;
|
|
67
|
-
/**
|
|
68
|
-
* Writes the environment reflection data to the file system.
|
|
69
|
-
*
|
|
70
|
-
* @param context - The plugin context.
|
|
71
|
-
* @param reflection - The reflection data to write.
|
|
72
|
-
* @param name - The name of the reflection (either "env" or "secrets").
|
|
73
|
-
*/
|
|
74
|
-
declare function writeEnvReflection(context: EnvPluginContext, reflection: type_d_exports.ReflectionClass<any>, name?: EnvType): Promise<void>;
|
|
75
|
-
/**
|
|
76
|
-
* Writes the environment reflection data to the file system.
|
|
77
|
-
*
|
|
78
|
-
* @param context - The plugin context.
|
|
79
|
-
* @param reflection - The reflection data to write.
|
|
80
|
-
* @param name - The name of the reflection (either "env" or "secrets").
|
|
81
|
-
*/
|
|
82
|
-
declare function writeEnvReflectionSync(context: EnvPluginContext, reflection: type_d_exports.ReflectionClass<any>, name?: EnvType): void;
|
|
83
|
-
//#endregion
|
|
84
|
-
export { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{type_exports as e}from"../deepkit/src/vendor/type.mjs";import{convertFromCapnp as t,convertToCapnp as n}from"../deepkit/src/capnp.mjs";import{getReflectionsPath as r}from"../deepkit/src/resolve-reflections.mjs";import{SerializedTypes as i}from"../deepkit/schemas/reflection2.mjs";import{createEnvReflection as a}from"./reflect.mjs";import*as o from"@stryke/capnp";import{joinPaths as s}from"@stryke/path/join-paths";import{readFileBuffer as c,writeFileBuffer as l,writeFileBufferSync as u}from"@stryke/fs/buffer";import{resolvePackage as d}from"@stryke/fs/resolve";import{isEmptyObject as f}from"@stryke/type-checks/is-empty-object";import{existsSync as p}from"node:fs";async function m(e){return d(`@powerlines/plugin-env/types/runtime`,{paths:[e.workspaceConfig.workspaceRoot,s(e.workspaceConfig.workspaceRoot,e.config.projectRoot)]})}async function h(e){return{file:await m(e),name:`EnvInterface`}}async function g(e){return{file:await m(e),name:`SecretsInterface`}}function _(e,t=`env`){return s(r(e),`env`,`${t}-types.bin`)}async function v(n,r=`env`){let s=_(n,r);if(!p(s)){if(!n.env.types.env||f(n.env.types.env)){let e=a(n),t=new o.Message;e.messageRoot=t.initRoot(i),e.dataBuffer=t.toArrayBuffer(),n.env.types.env=e,await y(n,n.env.types.env,r)}return n.env.types.env}let l=await c(s),u=new o.Message(l,!1).getRoot(i),d=(0,e.resolveClassType)((0,e.deserializeType)(t(u.types)));return n.env.types[r]=d,n.env.types[r].messageRoot=u,n.env.types[r].dataBuffer=l,d}async function y(e,t,r=`env`){let a=t.serializeType(),s=new o.Message;n(a,s.initRoot(i)._initTypes(a.length)),await l(_(e,r),s.toArrayBuffer())}function b(e,t){return s(r(e),`env`,`${t}.bin`)}async function x(n){let r=b(n,`env`);if(!p(r)){if(n.env.types.env||(n.env.types.env=await v(n,`env`)),!n.env.used.env||f(n.env.used.env)){let t=a(n,{type:{kind:e.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters that are used (at least once) by the ${n.config.name?`${n.config.name} application`:`application`}.`,types:[]},superReflection:n.env.types.env});t.name=`Env`;let r=new o.Message;t.messageRoot=r.initRoot(i),t.dataBuffer=r.toArrayBuffer(),n.env.used.env=t,await C(n,n.env.used.env,`env`)}return n.env.used.env}let s=await c(r),l=new o.Message(s,!1).getRoot(i),u=(0,e.resolveClassType)((0,e.deserializeType)(t(l.types)));return n.env.used.env=u,n.env.used.env.messageRoot=l,n.env.used.env.dataBuffer=s,u}async function S(n){let r=b(n,`secrets`);if(!p(r)){if(n.env.types.secrets||(n.env.types.secrets=await v(n,`secrets`)),!n.env.used.secrets||f(n.env.used.secrets)){let t=a(n,{type:{kind:e.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters that are used (at least once) by the ${n.config.name?`${n.config.name} application`:`application`}.`,types:[]},superReflection:n.env.types.secrets});t.name=`Secrets`;let r=new o.Message;t.messageRoot=r.initRoot(i),t.dataBuffer=r.toArrayBuffer(),n.env.used.secrets=t,await C(n,n.env.used.secrets,`secrets`)}return n.env.used.secrets}let s=await c(r),l=new o.Message(s,!1).getRoot(i),u=(0,e.resolveClassType)((0,e.deserializeType)(t(l.types)));return n.env.used.secrets=u,n.env.used.secrets.messageRoot=l,n.env.used.secrets.dataBuffer=s,u}async function C(e,t,r=`env`){let a=t.serializeType(),s=new o.Message;n(a,s.initRoot(i)._initTypes(a.length)),await l(b(e,r),s.toArrayBuffer())}function w(e,t,r=`env`){let a=t.serializeType(),s=new o.Message;n(a,s.initRoot(i)._initTypes(a.length)),u(b(e,r),s.toArrayBuffer())}export{h as getEnvDefaultTypeDefinition,b as getEnvReflectionsPath,_ as getEnvTypeReflectionsPath,g as getSecretsDefaultTypeDefinition,x as readEnvReflection,v as readEnvTypeReflection,S as readSecretsReflection,m as resolveRuntimeTypeFile,C as writeEnvReflection,w as writeEnvReflectionSync,y as writeEnvTypeReflection};
|
package/dist/helpers/reflect.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../deepkit/src/vendor/type.cjs`),n=require(`../deepkit/src/reflect-type.cjs`),r=require(`./persistence.cjs`);let i=require(`@stryke/string-format/title-case`),a=require(`@stryke/path/join-paths`),o=require(`@stryke/path/is-parent-path`);function s(e,n){return d(e,{type:(0,t.type_exports.merge)(n.map(e=>e.type))})}function c(e,n){return f(e,{type:(0,t.type_exports.merge)(n.map(e=>e.type))})}var l=class{PLATFORM=`neutral`;MODE=`production`;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;CI=!1},u=class{};function d(e,n={}){let r=n.superReflection??new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.class,description:`The base environment configuration definition for the ${(0,i.titleCase)(e.config.name)} project.`,classType:l,types:[],implements:[{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`EnvInterface`,description:`The environment configuration interface definition for the ${(0,i.titleCase)(e.config.name)} project.`,types:[]}]});r.name=`Env`;let a=new t.type_exports.ReflectionClass(n.type??{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Env`,description:`A schema describing the list of available environment variables that can be used by the ${e.config.name?`${(0,i.titleCase)(e.config.name)} application`:`application`}.`,types:[]},r);return a.name=`Env`,a}function f(e,n={}){let r=n.superReflection??new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.class,description:`The base secrets configuration definition for the ${(0,i.titleCase)(e.config.name)} project.`,classType:u,types:[],implements:[{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`SecretsInterface`,description:`The secrets configuration interface definition for the ${(0,i.titleCase)(e.config.name)} project.`,types:[]}]});r.name=`Secrets`;let a=new t.type_exports.ReflectionClass(n.type??{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`A schema describing the list of available environment secrets that can be used by the ${e.config.name?`${(0,i.titleCase)(e.config.name)} application`:`application`}.`,types:[]},r);return a.name=`Secrets`,a}async function p(e,i,c){let l;i&&(l=(0,t.type_exports.resolveClassType)(await n.reflectType(e,{file:(0,o.isParentPath)(i,e.workspaceConfig.workspaceRoot)?i:(0,a.joinPaths)(e.workspaceConfig.workspaceRoot,i),name:c},{skipNodeModulesBundle:!0})));let u=await n.reflectType(e,await r.getEnvDefaultTypeDefinition(e));return s(e,[await r.readEnvTypeReflection(e,`env`),l,(0,t.type_exports.resolveClassType)(u)].filter(Boolean))}async function m(e,i,s){let l;i&&(l=(0,t.type_exports.resolveClassType)(await n.reflectType(e,{file:(0,o.isParentPath)(i,e.workspaceConfig.workspaceRoot)?i:(0,a.joinPaths)(e.workspaceConfig.workspaceRoot,i),name:s},{skipNodeModulesBundle:!0})));let u=await n.reflectType(e,await r.getSecretsDefaultTypeDefinition(e));return c(e,[await r.readSecretsReflection(e),l,(0,t.type_exports.resolveClassType)(u)].filter(Boolean))}exports.BaseEnv=l,exports.BaseSecrets=u,exports.createEnvReflection=d,exports.createSecretsReflection=f,exports.mergeEnvReflections=s,exports.mergeSecretsReflections=c,exports.reflectEnv=p,exports.reflectSecrets=m;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { type_d_exports } from "../deepkit/src/vendor/type.cjs";
|
|
2
|
-
import { EnvInterface, SecretsInterface } from "../types/runtime.cjs";
|
|
3
|
-
import { EnvPluginContext } from "../types/plugin.cjs";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/reflect.d.ts
|
|
6
|
-
declare function mergeEnvReflections(context: EnvPluginContext, reflections: type_d_exports.ReflectionClass<any>[]): type_d_exports.ReflectionClass<any>;
|
|
7
|
-
declare function mergeSecretsReflections(context: EnvPluginContext, reflections: type_d_exports.ReflectionClass<any>[]): type_d_exports.ReflectionClass<any>;
|
|
8
|
-
interface CreateEnvReflectionOptions {
|
|
9
|
-
type?: type_d_exports.TypeObjectLiteral | type_d_exports.TypeClass;
|
|
10
|
-
superReflection?: type_d_exports.ReflectionClass<any>;
|
|
11
|
-
}
|
|
12
|
-
declare class BaseEnv implements EnvInterface {
|
|
13
|
-
APP_NAME: string;
|
|
14
|
-
APP_VERSION: string;
|
|
15
|
-
BUILD_ID: string;
|
|
16
|
-
BUILD_TIMESTAMP: string;
|
|
17
|
-
BUILD_CHECKSUM: string;
|
|
18
|
-
RELEASE_ID: string;
|
|
19
|
-
RELEASE_TAG: string;
|
|
20
|
-
ORGANIZATION: string;
|
|
21
|
-
PLATFORM: "node" | "browser" | "neutral";
|
|
22
|
-
MODE: "development" | "test" | "production";
|
|
23
|
-
ENVIRONMENT: string;
|
|
24
|
-
DEBUG: boolean;
|
|
25
|
-
TEST: boolean;
|
|
26
|
-
MINIMAL: boolean;
|
|
27
|
-
NO_COLOR: boolean;
|
|
28
|
-
FORCE_COLOR: number | boolean;
|
|
29
|
-
FORCE_HYPERLINK: number | boolean;
|
|
30
|
-
STACKTRACE: boolean;
|
|
31
|
-
INCLUDE_ERROR_DATA: boolean;
|
|
32
|
-
ERROR_URL: string;
|
|
33
|
-
DEFAULT_TIMEZONE: string;
|
|
34
|
-
DEFAULT_LOCALE: string;
|
|
35
|
-
CI: boolean;
|
|
36
|
-
}
|
|
37
|
-
declare class BaseSecrets implements SecretsInterface {
|
|
38
|
-
ENCRYPTION_KEY: string;
|
|
39
|
-
}
|
|
40
|
-
declare function createEnvReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): type_d_exports.ReflectionClass<any>;
|
|
41
|
-
declare function createSecretsReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): type_d_exports.ReflectionClass<any>;
|
|
42
|
-
declare function reflectEnv(context: EnvPluginContext, file?: string, name?: string): Promise<type_d_exports.ReflectionClass<any>>;
|
|
43
|
-
declare function reflectSecrets(context: EnvPluginContext, file?: string, name?: string): Promise<type_d_exports.ReflectionClass<any>>;
|
|
44
|
-
declare type __ΩCreateEnvReflectionOptions = any[];
|
|
45
|
-
//#endregion
|
|
46
|
-
export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { type_d_exports } from "../deepkit/src/vendor/type.mjs";
|
|
2
|
-
import { EnvInterface, SecretsInterface } from "../types/runtime.mjs";
|
|
3
|
-
import { EnvPluginContext } from "../types/plugin.mjs";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/reflect.d.ts
|
|
6
|
-
declare function mergeEnvReflections(context: EnvPluginContext, reflections: type_d_exports.ReflectionClass<any>[]): type_d_exports.ReflectionClass<any>;
|
|
7
|
-
declare function mergeSecretsReflections(context: EnvPluginContext, reflections: type_d_exports.ReflectionClass<any>[]): type_d_exports.ReflectionClass<any>;
|
|
8
|
-
interface CreateEnvReflectionOptions {
|
|
9
|
-
type?: type_d_exports.TypeObjectLiteral | type_d_exports.TypeClass;
|
|
10
|
-
superReflection?: type_d_exports.ReflectionClass<any>;
|
|
11
|
-
}
|
|
12
|
-
declare class BaseEnv implements EnvInterface {
|
|
13
|
-
APP_NAME: string;
|
|
14
|
-
APP_VERSION: string;
|
|
15
|
-
BUILD_ID: string;
|
|
16
|
-
BUILD_TIMESTAMP: string;
|
|
17
|
-
BUILD_CHECKSUM: string;
|
|
18
|
-
RELEASE_ID: string;
|
|
19
|
-
RELEASE_TAG: string;
|
|
20
|
-
ORGANIZATION: string;
|
|
21
|
-
PLATFORM: "node" | "browser" | "neutral";
|
|
22
|
-
MODE: "development" | "test" | "production";
|
|
23
|
-
ENVIRONMENT: string;
|
|
24
|
-
DEBUG: boolean;
|
|
25
|
-
TEST: boolean;
|
|
26
|
-
MINIMAL: boolean;
|
|
27
|
-
NO_COLOR: boolean;
|
|
28
|
-
FORCE_COLOR: number | boolean;
|
|
29
|
-
FORCE_HYPERLINK: number | boolean;
|
|
30
|
-
STACKTRACE: boolean;
|
|
31
|
-
INCLUDE_ERROR_DATA: boolean;
|
|
32
|
-
ERROR_URL: string;
|
|
33
|
-
DEFAULT_TIMEZONE: string;
|
|
34
|
-
DEFAULT_LOCALE: string;
|
|
35
|
-
CI: boolean;
|
|
36
|
-
}
|
|
37
|
-
declare class BaseSecrets implements SecretsInterface {
|
|
38
|
-
ENCRYPTION_KEY: string;
|
|
39
|
-
}
|
|
40
|
-
declare function createEnvReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): type_d_exports.ReflectionClass<any>;
|
|
41
|
-
declare function createSecretsReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): type_d_exports.ReflectionClass<any>;
|
|
42
|
-
declare function reflectEnv(context: EnvPluginContext, file?: string, name?: string): Promise<type_d_exports.ReflectionClass<any>>;
|
|
43
|
-
declare function reflectSecrets(context: EnvPluginContext, file?: string, name?: string): Promise<type_d_exports.ReflectionClass<any>>;
|
|
44
|
-
declare type __ΩCreateEnvReflectionOptions = any[];
|
|
45
|
-
//#endregion
|
|
46
|
-
export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets };
|
package/dist/helpers/reflect.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{type_exports as e}from"../deepkit/src/vendor/type.mjs";import{reflectType as t}from"../deepkit/src/reflect-type.mjs";import{getEnvDefaultTypeDefinition as n,getSecretsDefaultTypeDefinition as r,readEnvTypeReflection as i,readSecretsReflection as a}from"./persistence.mjs";import{titleCase as o}from"@stryke/string-format/title-case";import{joinPaths as s}from"@stryke/path/join-paths";import{isParentPath as c}from"@stryke/path/is-parent-path";function l(t,n){return p(t,{type:(0,e.merge)(n.map(e=>e.type))})}function u(t,n){return m(t,{type:(0,e.merge)(n.map(e=>e.type))})}var d=class{PLATFORM=`neutral`;MODE=`production`;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;CI=!1},f=class{};function p(t,n={}){let r=n.superReflection??new e.ReflectionClass({kind:e.ReflectionKind.class,description:`The base environment configuration definition for the ${o(t.config.name)} project.`,classType:d,types:[],implements:[{kind:e.ReflectionKind.objectLiteral,typeName:`EnvInterface`,description:`The environment configuration interface definition for the ${o(t.config.name)} project.`,types:[]}]});r.name=`Env`;let i=new e.ReflectionClass(n.type??{kind:e.ReflectionKind.objectLiteral,typeName:`Env`,description:`A schema describing the list of available environment variables that can be used by the ${t.config.name?`${o(t.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Env`,i}function m(t,n={}){let r=n.superReflection??new e.ReflectionClass({kind:e.ReflectionKind.class,description:`The base secrets configuration definition for the ${o(t.config.name)} project.`,classType:f,types:[],implements:[{kind:e.ReflectionKind.objectLiteral,typeName:`SecretsInterface`,description:`The secrets configuration interface definition for the ${o(t.config.name)} project.`,types:[]}]});r.name=`Secrets`;let i=new e.ReflectionClass(n.type??{kind:e.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`A schema describing the list of available environment secrets that can be used by the ${t.config.name?`${o(t.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Secrets`,i}async function h(r,a,o){let u;a&&(u=(0,e.resolveClassType)(await t(r,{file:c(a,r.workspaceConfig.workspaceRoot)?a:s(r.workspaceConfig.workspaceRoot,a),name:o},{skipNodeModulesBundle:!0})));let d=await t(r,await n(r));return l(r,[await i(r,`env`),u,(0,e.resolveClassType)(d)].filter(Boolean))}async function g(n,i,o){let l;i&&(l=(0,e.resolveClassType)(await t(n,{file:c(i,n.workspaceConfig.workspaceRoot)?i:s(n.workspaceConfig.workspaceRoot,i),name:o},{skipNodeModulesBundle:!0})));let d=await t(n,await r(n));return u(n,[await a(n),l,(0,e.resolveClassType)(d)].filter(Boolean))}export{d as BaseEnv,f as BaseSecrets,p as createEnvReflection,m as createSecretsReflection,l as mergeEnvReflections,u as mergeSecretsReflections,h as reflectEnv,g as reflectSecrets};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/string-format/camel-case`),n=require(`@stryke/type-checks/is-string`),r=require(`@stryke/env/types`);function i(e){if((0,n.isString)(e)){let t=r.ENV_PREFIXES.reduce((e,t)=>(e.startsWith(t)&&(e=e.slice(t.length)),e),e.toUpperCase());for(;t.startsWith(`_`);)t=t.slice(1);return t}return Object.keys(e).reduce((t,n)=>{let r=i(n);return r&&(t[r]=e[n]),t},{})}function a(e){return(0,t.camelCase)(i(e))}exports.formatEnvField=a,exports.removeEnvPrefix=i;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DotenvParseOutput } from "@stryke/env/types";
|
|
2
|
-
|
|
3
|
-
//#region src/helpers/source-file-env.d.ts
|
|
4
|
-
type TReturned<TEnv> = TEnv extends string ? string : DotenvParseOutput;
|
|
5
|
-
declare function removeEnvPrefix<TEnv extends DotenvParseOutput | string>(env: TEnv): TReturned<TEnv>;
|
|
6
|
-
declare function formatEnvField(key: string): string;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { formatEnvField, removeEnvPrefix };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DotenvParseOutput } from "@stryke/env/types";
|
|
2
|
-
|
|
3
|
-
//#region src/helpers/source-file-env.d.ts
|
|
4
|
-
type TReturned<TEnv> = TEnv extends string ? string : DotenvParseOutput;
|
|
5
|
-
declare function removeEnvPrefix<TEnv extends DotenvParseOutput | string>(env: TEnv): TReturned<TEnv>;
|
|
6
|
-
declare function formatEnvField(key: string): string;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { formatEnvField, removeEnvPrefix };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{camelCase as e}from"@stryke/string-format/camel-case";import{isString as t}from"@stryke/type-checks/is-string";import{ENV_PREFIXES as n}from"@stryke/env/types";function r(e){if(t(e)){let t=n.reduce((e,t)=>(e.startsWith(t)&&(e=e.slice(t.length)),e),e.toUpperCase());for(;t.startsWith(`_`);)t=t.slice(1);return t}return Object.keys(e).reduce((t,n)=>{let i=r(n);return i&&(t[i]=e[n]),t},{})}function i(t){return e(r(t))}export{i as formatEnvField,r as removeEnvPrefix};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`./persistence.cjs`);let n=require(`@stryke/string-format/title-case`);async function r(e,r){let i=await t.readEnvTypeReflection(e,r);return i.getProperties().forEach(e=>{e.getAlias().filter(Boolean).forEach(t=>{i.addProperty({name:t,optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,description:e.getDescription(),visibility:e.getVisibility(),type:e.getType(),default:e.getDefaultValue(),tags:{hidden:e.isHidden(),ignore:e.isIgnored(),internal:e.isInternal(),alias:e.getAlias().filter(e=>e!==t).concat(e.name),title:e.getTitle()||(0,n.titleCase)(e.name),readonly:e.isReadonly(),permission:e.getPermission(),domain:e.getDomain()}})})}),i}exports.createTemplateReflection=r;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type_d_exports } from "../deepkit/src/vendor/type.cjs";
|
|
2
|
-
import { EnvPluginContext, EnvType } from "../types/plugin.cjs";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/template-helpers.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Creates the reflection data used when generating runtime template files.
|
|
8
|
-
*
|
|
9
|
-
* @param context - The context for the configuration plugin.
|
|
10
|
-
* @param name - The name of the configuration template.
|
|
11
|
-
* @returns The reflection for the specified configuration template.
|
|
12
|
-
*/
|
|
13
|
-
declare function createTemplateReflection(context: EnvPluginContext, name?: EnvType): Promise<type_d_exports.ReflectionClass<any>>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { createTemplateReflection };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type_d_exports } from "../deepkit/src/vendor/type.mjs";
|
|
2
|
-
import { EnvPluginContext, EnvType } from "../types/plugin.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/template-helpers.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Creates the reflection data used when generating runtime template files.
|
|
8
|
-
*
|
|
9
|
-
* @param context - The context for the configuration plugin.
|
|
10
|
-
* @param name - The name of the configuration template.
|
|
11
|
-
* @returns The reflection for the specified configuration template.
|
|
12
|
-
*/
|
|
13
|
-
declare function createTemplateReflection(context: EnvPluginContext, name?: EnvType): Promise<type_d_exports.ReflectionClass<any>>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { createTemplateReflection };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{readEnvTypeReflection as e}from"./persistence.mjs";import{titleCase as t}from"@stryke/string-format/title-case";async function n(n,r){let i=await e(n,r);return i.getProperties().forEach(e=>{e.getAlias().filter(Boolean).forEach(n=>{i.addProperty({name:n,optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,description:e.getDescription(),visibility:e.getVisibility(),type:e.getType(),default:e.getDefaultValue(),tags:{hidden:e.isHidden(),ignore:e.isIgnored(),internal:e.isInternal(),alias:e.getAlias().filter(e=>e!==n).concat(e.name),title:e.getTitle()||t(e.name),readonly:e.isReadonly(),permission:e.getPermission(),domain:e.getDomain()}})})}),i}export{n as createTemplateReflection};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/path/join-paths`),n=require(`defu`);n=e.__toESM(n);let r=require(`@stryke/path/replace`),i=require(`@stryke/convert/to-array`),a=require(`@stryke/fs/is-file`),o=require(`@stryke/fs/list-files`),s=require(`@stryke/path/append`),c=require(`c12`),l=require(`automd`),u=require(`@stryke/path/is-type`),d=require(`markdown-toc`);d=e.__toESM(d);const f=(e={})=>({name:`automd`,async config(){let r=await(0,l.loadConfig)((0,t.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot),e);return(!r.prefix||!Array.isArray(r.prefix))&&(r.prefix=(0,i.toArray)(r.prefix??[])),r.prefix.includes(`automd`)||r.prefix.push(`automd`),r.prefix.includes(`powerlines`)||r.prefix.push(`powerlines`),{automd:(0,n.default)(r??{},{configFile:e.configFile,allowIssues:!0,dir:this.config.projectRoot,watch:!1,input:`README.md`,toc:{maxDepth:6,bullets:`-`}})}},async configResolved(){if(this.config.framework&&!(0,i.toArray)(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=(0,i.toArray)(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:e}=await(0,c.loadConfig)({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=(0,l.resolveConfig)((0,n.default)(this.config.automd,{...e,prefix:(0,i.toArray)(e.prefix??[])}))}this.config.automd.input=(await Promise.all((0,i.toArray)(this.config.automd.input).map(async e=>e.includes(`*`)?(0,o.listFiles)((0,u.isAbsolutePath)(e)?e:(0,s.appendPath)(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):(0,u.isAbsolutePath)(e)?e:(0,s.appendPath)(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!(0,u.isAbsolutePath)(this.config.automd.output)&&(this.config.automd.output=(0,s.appendPath)(this.config.automd.output,this.config.projectRoot)),this.config.automd.generators??={},this.config.automd.toc!==!1&&(this.config.automd.generators.toc??={name:`toc`,generate:e=>{let t=this.config.automd.toc??{};return{contents:(0,d.default)(e.block.md,{...t,maxdepth:t.maxDepth,first1:t.firstH1}).content}}})},async docs(){await Promise.all((0,i.toArray)(this.config.automd.input).map(async e=>{let t=await this.fs.read(e);if(t){let n=await(0,l.transform)(t,this.config.automd);if(n.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${e}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);n.hasChanged&&await this.fs.write((0,s.appendPath)(this.config.automd.output?(0,a.isDirectory)(this.config.automd.output)?(0,r.replacePath)(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),n.contents)}}))}});var p=f;exports.default=p;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{joinPaths as e}from"@stryke/path/join-paths";import t from"defu";import{replacePath as n}from"@stryke/path/replace";import{toArray as r}from"@stryke/convert/to-array";import{isDirectory as i}from"@stryke/fs/is-file";import{listFiles as a}from"@stryke/fs/list-files";import{appendPath as o}from"@stryke/path/append";import{loadConfig as s}from"c12";import{loadConfig as c,resolveConfig as l,transform as u}from"automd";import{isAbsolutePath as d}from"@stryke/path/is-type";import f from"markdown-toc";var p=(p={})=>({name:`automd`,async config(){let n=await c(e(this.workspaceConfig.workspaceRoot,this.config.projectRoot),p);return(!n.prefix||!Array.isArray(n.prefix))&&(n.prefix=r(n.prefix??[])),n.prefix.includes(`automd`)||n.prefix.push(`automd`),n.prefix.includes(`powerlines`)||n.prefix.push(`powerlines`),{automd:t(n??{},{configFile:p.configFile,allowIssues:!0,dir:this.config.projectRoot,watch:!1,input:`README.md`,toc:{maxDepth:6,bullets:`-`}})}},async configResolved(){if(this.config.framework&&!r(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=r(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:e}=await s({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=l(t(this.config.automd,{...e,prefix:r(e.prefix??[])}))}this.config.automd.input=(await Promise.all(r(this.config.automd.input).map(async e=>e.includes(`*`)?a(d(e)?e:o(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):d(e)?e:o(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!d(this.config.automd.output)&&(this.config.automd.output=o(this.config.automd.output,this.config.projectRoot)),this.config.automd.generators??={},this.config.automd.toc!==!1&&(this.config.automd.generators.toc??={name:`toc`,generate:e=>{let t=this.config.automd.toc??{};return{contents:f(e.block.md,{...t,maxdepth:t.maxDepth,first1:t.firstH1}).content}}})},async docs(){await Promise.all(r(this.config.automd.input).map(async e=>{let t=await this.fs.read(e);if(t){let r=await u(t,this.config.automd);if(r.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${e}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);r.hasChanged&&await this.fs.write(o(this.config.automd.output?i(this.config.automd.output)?n(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),r.contents)}}))}});export{p as default};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { TOCOptions } from "./toc.cjs";
|
|
2
|
-
import { Config } from "automd";
|
|
3
|
-
|
|
4
|
-
//#region ../plugin-automd/src/types/plugin.d.ts
|
|
5
|
-
|
|
6
|
-
type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
|
|
7
|
-
/**
|
|
8
|
-
* Path to the AutoMD configuration file.
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* If not provided, the plugin will use the default AutoMD configuration resolution mechanism.
|
|
12
|
-
*/
|
|
13
|
-
configFile?: string;
|
|
14
|
-
/**
|
|
15
|
-
* An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.
|
|
16
|
-
*
|
|
17
|
-
* @defaultValue true
|
|
18
|
-
*/
|
|
19
|
-
allowIssues?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Alternate prefix strings to use for finding generators
|
|
22
|
-
*
|
|
23
|
-
* @remarks
|
|
24
|
-
* By default, AutoMD looks for generators with the "automd" prefix, so that any `<!-- automd:generator [...args] --> ... <!-- /automd -->` comments will be picked up. If you want to use different prefixes (for example, to avoid conflicts with other tools), you would provide a value like "myPrefix" and AutoMD would also look for `<!-- myPrefix:generator [...args] --> ... <!-- /myPrefix -->` comments.
|
|
25
|
-
*
|
|
26
|
-
* @defaultValue ["automd", "powerlines", "\{framework\}"]
|
|
27
|
-
*/
|
|
28
|
-
prefix?: string | string[];
|
|
29
|
-
/**
|
|
30
|
-
* Table of Contents generator options
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* If set to `false`, the built-in Table of Contents generator will be disabled.
|
|
34
|
-
*/
|
|
35
|
-
toc?: false | TOCOptions;
|
|
36
|
-
};
|
|
37
|
-
//#endregion
|
|
38
|
-
export { AutoMDPluginOptions };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import "../../../powerlines/src/types/resolved.mjs";
|
|
2
|
-
import "../../../powerlines/src/types/config.mjs";
|
|
3
|
-
import "../../../powerlines/src/types/context.mjs";
|
|
4
|
-
import { TOCOptions } from "./toc.mjs";
|
|
5
|
-
import { Config } from "automd";
|
|
6
|
-
|
|
7
|
-
//#region ../plugin-automd/src/types/plugin.d.ts
|
|
8
|
-
type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
|
|
9
|
-
/**
|
|
10
|
-
* Path to the AutoMD configuration file.
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* If not provided, the plugin will use the default AutoMD configuration resolution mechanism.
|
|
14
|
-
*/
|
|
15
|
-
configFile?: string;
|
|
16
|
-
/**
|
|
17
|
-
* An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.
|
|
18
|
-
*
|
|
19
|
-
* @defaultValue true
|
|
20
|
-
*/
|
|
21
|
-
allowIssues?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Alternate prefix strings to use for finding generators
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
* By default, AutoMD looks for generators with the "automd" prefix, so that any `<!-- automd:generator [...args] --> ... <!-- /automd -->` comments will be picked up. If you want to use different prefixes (for example, to avoid conflicts with other tools), you would provide a value like "myPrefix" and AutoMD would also look for `<!-- myPrefix:generator [...args] --> ... <!-- /myPrefix -->` comments.
|
|
27
|
-
*
|
|
28
|
-
* @defaultValue ["automd", "powerlines", "\{framework\}"]
|
|
29
|
-
*/
|
|
30
|
-
prefix?: string | string[];
|
|
31
|
-
/**
|
|
32
|
-
* Table of Contents generator options
|
|
33
|
-
*
|
|
34
|
-
* @remarks
|
|
35
|
-
* If set to `false`, the built-in Table of Contents generator will be disabled.
|
|
36
|
-
*/
|
|
37
|
-
toc?: false | TOCOptions;
|
|
38
|
-
};
|
|
39
|
-
//#endregion
|
|
40
|
-
export { AutoMDPluginOptions };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//#region ../plugin-automd/src/types/toc.d.ts
|
|
2
|
-
interface TOCOptions {
|
|
3
|
-
/**
|
|
4
|
-
* A slugify function to generate slugs for the headings.
|
|
5
|
-
*/
|
|
6
|
-
slugify?: (str: string) => string;
|
|
7
|
-
/**
|
|
8
|
-
* The maximum depth of headings to include in the TOC.
|
|
9
|
-
*
|
|
10
|
-
* @defaultValue 6
|
|
11
|
-
*/
|
|
12
|
-
maxDepth?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Whether to include the first H1 heading in the TOC.
|
|
15
|
-
*/
|
|
16
|
-
firstH1?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* The bullet character to use for list items in the TOC.
|
|
19
|
-
*
|
|
20
|
-
* @defaultValue "-"
|
|
21
|
-
*/
|
|
22
|
-
bullets?: string;
|
|
23
|
-
/**
|
|
24
|
-
* A prefix to add to each heading in the TOC.
|
|
25
|
-
*/
|
|
26
|
-
prefix?: string;
|
|
27
|
-
/**
|
|
28
|
-
* A filter function to determine which headings to include in the TOC.
|
|
29
|
-
*/
|
|
30
|
-
filter?: (str: string, level: number) => boolean;
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { TOCOptions };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//#region ../plugin-automd/src/types/toc.d.ts
|
|
2
|
-
interface TOCOptions {
|
|
3
|
-
/**
|
|
4
|
-
* A slugify function to generate slugs for the headings.
|
|
5
|
-
*/
|
|
6
|
-
slugify?: (str: string) => string;
|
|
7
|
-
/**
|
|
8
|
-
* The maximum depth of headings to include in the TOC.
|
|
9
|
-
*
|
|
10
|
-
* @defaultValue 6
|
|
11
|
-
*/
|
|
12
|
-
maxDepth?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Whether to include the first H1 heading in the TOC.
|
|
15
|
-
*/
|
|
16
|
-
firstH1?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* The bullet character to use for list items in the TOC.
|
|
19
|
-
*
|
|
20
|
-
* @defaultValue "-"
|
|
21
|
-
*/
|
|
22
|
-
bullets?: string;
|
|
23
|
-
/**
|
|
24
|
-
* A prefix to add to each heading in the TOC.
|
|
25
|
-
*/
|
|
26
|
-
prefix?: string;
|
|
27
|
-
/**
|
|
28
|
-
* A filter function to determine which headings to include in the TOC.
|
|
29
|
-
*/
|
|
30
|
-
filter?: (str: string, level: number) => boolean;
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { TOCOptions };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@babel/generator`);t=e.__toESM(t),require(`@babel/parser`);let n=t.default;`default`in n&&(n=n.default);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"@babel/generator";import"@babel/parser";let t=e;`default`in t&&(t=t.default);export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../powerlines/src/lib/logger.cjs`);let n=require(`@storm-software/config-tools/types`),r=require(`@babel/helper-plugin-utils`),i=require(`chalk`);i=e.__toESM(i);function a(e,a){let o=o=>(0,r.declare)((r,s,c)=>{r.cache.using(()=>o.meta.checksum),r.assertVersion(`^7.0.0-0`);let l=t.extendLog(o.log,e);l(n.LogLevelLabel.TRACE,`Initializing the ${i.default.bold.cyanBright(e)} Babel plugin`);let u=a({log:l,name:e,api:r,options:s,context:o,dirname:c});return u.name=e,l(n.LogLevelLabel.TRACE,`Completed initialization of the ${i.default.bold.cyanBright(e)} Babel plugin`),u});return o.$$name=e,o}exports.createBabelPlugin=a;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{extendLog as e}from"../../../powerlines/src/lib/logger.mjs";import{LogLevelLabel as t}from"@storm-software/config-tools/types";import{declare as n}from"@babel/helper-plugin-utils";import r from"chalk";function i(i,a){let o=o=>n((n,s,c)=>{n.cache.using(()=>o.meta.checksum),n.assertVersion(`^7.0.0-0`);let l=e(o.log,i);l(t.TRACE,`Initializing the ${r.bold.cyanBright(i)} Babel plugin`);let u=a({log:l,name:i,api:n,options:s,context:o,dirname:c});return u.name=i,l(t.TRACE,`Completed initialization of the ${r.bold.cyanBright(i)} Babel plugin`),u});return o.$$name=i,o}export{i as createBabelPlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/type-checks/is-function`);require(`@stryke/type-checks/is-object`);function r(e){return(0,t.isSetString)(e)?e:Array.isArray(e)&&e.length>0?r(e[0]):e.$$name||e.name?e.$$name||e.name:void 0}function i(e,t){return!!(r(t)&&e.some(e=>Array.isArray(e)&&r(e[0])===r(t)))}exports.getPluginName=r,exports.isDuplicatePlugin=i;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{isSetString as e}from"@stryke/type-checks/is-set-string";import{isFunction as t}from"@stryke/type-checks/is-function";import"@stryke/type-checks/is-object";function n(t){return e(t)?t:Array.isArray(t)&&t.length>0?n(t[0]):t.$$name||t.name?t.$$name||t.name:void 0}function r(e,t){return!!(n(t)&&e.some(e=>Array.isArray(e)&&n(e[0])===n(t)))}export{n as getPluginName,r as isDuplicatePlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./create-plugin.cjs`);require(`./ast-utils.cjs`);const t=require(`./module-helpers.cjs`),n=require(`./filters.cjs`),r=require(`./options.cjs`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createBabelPlugin as e}from"./create-plugin.mjs";import"./ast-utils.mjs";import{addImport as t,addImportsToProgram as n}from"./module-helpers.mjs";import{getPluginName as r,isDuplicatePlugin as i}from"./filters.mjs";import{resolveBabelPlugin as a,resolvePluginFunction as o}from"./options.mjs";export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`);require(`./ast-utils.cjs`);let t=require(`@stryke/type-checks/is-string`),n=require(`@babel/types`);n=e.__toESM(n);function r(e,t){o(e.scope.getProgramParent().path,t)}function i(e){return e.get(`specifiers`).filter(Boolean).every(e=>e?.isImportSpecifier())&&e.node.importKind!==`type`&&e.node.importKind!==`typeof`}function a(e){let t=new Map;return e.traverse({ImportDeclaration(e){i(e)&&t.set(e.node.source.value,e)}}),t}function o(e,t){a(e).get(t.module)||e.unshiftContainer(`body`,n.importDeclaration([n.importSpecifier(n.identifier(t.name||t.imported),n.identifier(t.imported))],n.stringLiteral(t.module)))}exports.addImport=r,exports.addImportsToProgram=o;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./ast-utils.mjs";import{isString as e}from"@stryke/type-checks/is-string";import*as t from"@babel/types";function n(e,t){a(e.scope.getProgramParent().path,t)}function r(e){return e.get(`specifiers`).filter(Boolean).every(e=>e?.isImportSpecifier())&&e.node.importKind!==`type`&&e.node.importKind!==`typeof`}function i(e){let t=new Map;return e.traverse({ImportDeclaration(e){r(e)&&t.set(e.node.source.value,e)}}),t}function a(e,n){i(e).get(n.module)||e.unshiftContainer(`body`,t.importDeclaration([t.importSpecifier(t.identifier(n.name||n.imported),t.identifier(n.imported))],t.stringLiteral(n.module)))}export{n as addImport,a as addImportsToProgram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`./filters.cjs`);let n=require(`@storm-software/config-tools/types`),r=require(`chalk`);r=e.__toESM(r);let i=require(`@stryke/type-checks/is-function`);function a(e,t){try{return Array.isArray(t)&&t.length>0&&t[0]?(0,i.isFunction)(t[0])?t[0](e):t[0]:(0,i.isFunction)(t)?t(e):t}catch{return t[0]}}function o(e,o,s,c){if(Array.isArray(c)&&c.length>0&&c[0]){if(c.length>2&&c[2]&&(0,i.isFunction)(c[2])&&!c[2](o,s)){e.log(n.LogLevelLabel.TRACE,`Skipping filtered Babel plugin ${r.default.bold.cyanBright(t.getPluginName(c)||`unnamed`)} for ${s}`);return}return c.length>2?[a(e,c),c[1],c[2]]:[a(e,c),c[1],null]}return[a(e,c),{},null]}exports.resolveBabelPlugin=o,exports.resolvePluginFunction=a;
|