@powerlines/plugin-env 0.13.106 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel/plugin.d.mts +1 -1
- package/dist/helpers/automd-generator.cjs +1 -0
- package/dist/helpers/automd-generator.d.cts +14 -0
- package/dist/helpers/automd-generator.d.mts +14 -0
- package/dist/helpers/automd-generator.mjs +1 -0
- package/dist/helpers/load.d.mts +1 -1
- package/dist/helpers/persistence.d.cts +1 -1
- package/dist/helpers/persistence.d.mts +1 -1
- package/dist/index.cjs +6 -12
- package/dist/index.d.cts +1 -2
- package/dist/index.d.mts +3 -4
- package/dist/index.mjs +6 -12
- package/dist/plugin-automd/src/index.cjs +1 -0
- package/dist/plugin-automd/src/index.mjs +1 -0
- package/dist/plugin-automd/src/types/plugin.d.cts +38 -0
- package/dist/plugin-automd/src/types/plugin.d.mts +40 -0
- package/dist/plugin-automd/src/types/toc.d.cts +33 -0
- package/dist/plugin-automd/src/types/toc.d.mts +33 -0
- package/dist/plugin-babel/src/types/plugin.d.cts +1 -1
- package/dist/plugin-babel/src/types/plugin.d.mts +1 -1
- package/dist/powerlines/schemas/fs.d.mts +1 -0
- package/dist/powerlines/src/api.d.mts +7 -0
- package/dist/powerlines/src/index.d.mts +12 -0
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +2 -2
- package/dist/powerlines/src/lib/entry.cjs +1 -1
- package/dist/powerlines/src/lib/entry.mjs +1 -1
- package/dist/powerlines/src/types/api.d.mts +1 -1
- package/dist/powerlines/src/types/babel.d.cts +1 -1
- package/dist/powerlines/src/types/babel.d.mts +1 -1
- package/dist/powerlines/src/types/commands.d.cts +1 -1
- package/dist/powerlines/src/types/commands.d.mts +1 -1
- package/dist/powerlines/src/types/config.d.cts +3 -3
- package/dist/powerlines/src/types/config.d.mts +3 -3
- package/dist/powerlines/src/types/context.d.mts +1 -1
- package/dist/powerlines/src/types/index.d.mts +4 -4
- package/dist/powerlines/src/types/plugin.d.cts +2 -2
- package/dist/powerlines/src/types/plugin.d.mts +2 -2
- package/dist/powerlines/src/types/unplugin.d.mts +1 -1
- package/dist/types/plugin.d.cts +9 -1
- package/dist/types/plugin.d.mts +8 -0
- package/package.json +9 -7
- package/dist/alloy/src/types/plugin.d.cts +0 -15
- package/dist/alloy/src/types/plugin.d.mts +0 -15
- package/dist/plugin-plugin/src/types/plugin.d.cts +0 -21
- package/dist/plugin-plugin/src/types/plugin.d.mts +0 -24
package/dist/babel/plugin.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DeclareBabelTransformPluginReturn } from "../powerlines/src/types/babel.mjs";
|
|
2
|
+
import "../powerlines/src/index.mjs";
|
|
2
3
|
import { EnvPluginContext, EnvPluginResolvedConfig } from "../types/plugin.mjs";
|
|
3
|
-
import "../powerlines/src/types/index.mjs";
|
|
4
4
|
import "../index.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/babel/plugin.d.ts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/path/join-paths`),n=require(`automd`);const r=e=>(0,n.defineGenerator)({name:`env`,async generate(){let n=(0,t.joinPaths)(e.config.projectRoot,`docs`,`generated`,`env.md`);return e.fs.existsSync(n)?{contents:await e.fs.read(n)||``}:{contents:``}}});exports.env=r;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UnresolvedContext } from "../powerlines/src/types/context.cjs";
|
|
2
|
+
import * as automd0 from "automd";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/automd-generator.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* AutoMD generator to generate environment variable documentation
|
|
8
|
+
*
|
|
9
|
+
* @param context - The generator context.
|
|
10
|
+
* @returns The generated documentation content.
|
|
11
|
+
*/
|
|
12
|
+
declare const env: (context: UnresolvedContext) => automd0.Generator;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { env };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UnresolvedContext } from "../powerlines/src/types/context.mjs";
|
|
2
|
+
import * as automd0 from "automd";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/automd-generator.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* AutoMD generator to generate environment variable documentation
|
|
8
|
+
*
|
|
9
|
+
* @param context - The generator context.
|
|
10
|
+
* @returns The generated documentation content.
|
|
11
|
+
*/
|
|
12
|
+
declare const env: (context: UnresolvedContext) => automd0.Generator;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { env };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{joinPaths as e}from"@stryke/path/join-paths";import{defineGenerator as t}from"automd";const n=n=>t({name:`env`,async generate(){let t=e(n.config.projectRoot,`docs`,`generated`,`env.md`);return n.fs.existsSync(t)?{contents:await n.fs.read(t)||``}:{contents:``}}});export{n as env};
|
package/dist/helpers/load.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EnvironmentResolvedConfig } from "../powerlines/src/types/resolved.mjs";
|
|
2
|
+
import "../powerlines/src/index.mjs";
|
|
2
3
|
import { EnvPluginContext, EnvPluginOptions } from "../types/plugin.mjs";
|
|
3
|
-
import "../powerlines/src/types/index.mjs";
|
|
4
4
|
import { DotenvParseOutput } from "@stryke/env/types";
|
|
5
5
|
|
|
6
6
|
//#region src/helpers/load.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type_d_exports } from "../deepkit/src/vendor/type.cjs";
|
|
2
1
|
import { Context, UnresolvedContext } from "../powerlines/src/types/context.cjs";
|
|
2
|
+
import { type_d_exports } from "../deepkit/src/vendor/type.cjs";
|
|
3
3
|
import { EnvPluginContext, EnvPluginResolvedConfig, EnvType } from "../types/plugin.cjs";
|
|
4
4
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type_d_exports } from "../deepkit/src/vendor/type.mjs";
|
|
2
1
|
import { Context, UnresolvedContext } from "../powerlines/src/types/context.mjs";
|
|
2
|
+
import { type_d_exports } from "../deepkit/src/vendor/type.mjs";
|
|
3
3
|
import { EnvPluginContext, EnvPluginResolvedConfig, EnvType } from "../types/plugin.mjs";
|
|
4
4
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
5
5
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./deepkit/src/vendor/type.cjs`),n=require(`./helpers/reflect.cjs`),r=require(`./helpers/persistence.cjs`),i=require(`./helpers/template-helpers.cjs`),a=require(`./helpers/source-file-env.cjs`),o=require(`./helpers/load.cjs`),s=require(`./helpers/create-reflection-resource.cjs`);require(`./helpers/index.cjs`);const c=require(`./components/docs.cjs`),
|
|
1
|
+
Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./deepkit/src/vendor/type.cjs`),n=require(`./helpers/reflect.cjs`),r=require(`./helpers/persistence.cjs`),i=require(`./helpers/template-helpers.cjs`),a=require(`./helpers/source-file-env.cjs`),o=require(`./helpers/load.cjs`),s=require(`./helpers/create-reflection-resource.cjs`);require(`./helpers/index.cjs`);const c=require(`./helpers/automd-generator.cjs`),l=require(`./components/docs.cjs`),u=require(`./components/env.cjs`);require(`./components/index.cjs`);const d=require(`./babel/plugin.cjs`);require(`./babel/index.cjs`);const f=require(`./alloy/src/create-plugin.cjs`),p=require(`./plugin-automd/src/index.cjs`),m=require(`./plugin-babel/src/index.cjs`);let h=require(`@stryke/string-format/title-case`),g=require(`defu`);g=e.__toESM(g);let _=require(`@stryke/convert/parse-type-definition`),v=require(`@storm-software/config-tools/types`),y=require(`@stryke/convert/to-array`),b=require(`@stryke/path/is-parent-path`),x=require(`@stryke/env/types`),S=require(`@alloy-js/core/jsx-runtime`),C=require(`@stryke/path/join`),w=require(`@stryke/fs/exists`),T=require(`@stryke/fs/helpers`),E=require(`@stryke/string-format/constant-case`);const D=f.createAlloyPlugin((e={})=>({name:`env`,async config(){this.log(v.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,g.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[d.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,_.parseTypeDefinition)(t.env.types);else{this.log(v.LogLevelLabel.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await r.getEnvDefaultTypeDefinition(this);t.env.types=(0,_.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,_.parseTypeDefinition)(t.env.secrets);else{let e=await r.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,_.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,y.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,E.constantCase)(t);return e.includes(n)||e.push(n),e},[...x.ENV_PREFIXES,`POWERLINES_`]),t.env.prefix=t.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),t},async configResolved(){if(this.log(v.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,g.default)({parsed:await o.loadEnv(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&(0,w.existsSync)(r.getEnvTypeReflectionsPath(this,`env`)))this.log(v.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await r.readEnvTypeReflection(this,`env`),(0,w.existsSync)(r.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await r.readEnvReflection(this)),(0,w.existsSync)(r.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await r.readEnvTypeReflection(this,`secrets`)),(0,w.existsSync)(r.getEnvReflectionsPath(this,`secrets`))&&(this.env.used.secrets=await r.readSecretsReflection(this));else{if(this.env.types.env=await n.reflectEnv(this,this.config.env.types?.file?(0,b.isParentPath)(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:(0,C.joinPaths)(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await r.writeEnvTypeReflection(this,this.env.types.env,`env`),this.env.types.secrets=await n.reflectSecrets(this,this.config.env.secrets?.file?(0,b.isParentPath)(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:(0,C.joinPaths)(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await r.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.log(v.LogLevelLabel.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let e=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await o.loadEnv(this,this.config.env)).forEach(([t,n])=>{let r=this.config.env.prefix.reduce((e,n)=>t.replace(/_$/g,``).startsWith(n)?t.replace(/_$/g,``).slice(n.length):e,t),i=e.find(e=>e?.getAlias().reverse().includes(r));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(n)}),this.env.used.env=new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await r.writeEnvReflection(this,this.env.used.env,`env`),this.env.types.secrets&&(await r.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await r.writeEnvReflection(this,this.env.used.secrets,`secrets`))}},render(){let e=this;return this.log(v.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),(0,S.createComponent)(u.EnvBuiltin,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(v.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,C.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,w.existsSync)(e)||await(0,T.createDirectory)(e);let n=await r.readEnvTypeReflection(this,`env`),i=(0,C.joinPaths)(e,`env.md`);this.log(v.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${i}"`),await this.fs.write(i,`<!-- Generated by ${(0,h.titleCase)(this.config.framework)||`Powerlines`} -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project. The variables in the list below are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
|
|
10
|
-
|
|
11
|
-
| Name | Description | Type | Default Value | Required |
|
|
12
|
-
| ---- | ----------- | ---- | ------------- | :------: |
|
|
13
|
-
${n.getProperties().filter(e=>e.getNameAsString()!==`__STORM_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(e=>`| ${e.getNameAsString().trim()} | ${(e.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
|
|
5
|
+
| Name | Description | Type | Default Value | Required |
|
|
6
|
+
| ---- | ----------- | ---- | ------------- | :------: |
|
|
7
|
+
${n.getProperties().filter(e=>e.getNameAsString()!==`__POWERLINES_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(e=>`| ${e.getNameAsString().trim()} | ${(e.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
|
|
14
8
|
`,``)??``).trim()} | ${(0,t.type_exports.stringifyType)(e.getType()).trim().replaceAll(` | `,`, or `)} | ${e.hasDefault()?String(e.getDefaultValue())?.includes(`"`)?e.getDefaultValue():`\`${e.getDefaultValue()}\``:``} | ${e.isValueRequired()?``:`✔`} |`).join(`
|
|
15
9
|
`)}
|
|
16
|
-
|
|
10
|
+
`)},async buildEnd(){let e=r.getEnvReflectionsPath(this,`env`);this.log(v.LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await r.writeEnvReflection(this,this.env.used.env,`env`)}})),O=(e={})=>[m.default(e.babel),D(e),{name:`env:automd-generator`,config(){return{automd:(0,g.default)(e.automd??{},{generators:{env:c.env(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},p.default(e.automd)];var k=O;exports.BaseEnv=n.BaseEnv,exports.BaseSecrets=n.BaseSecrets,exports.EnvBuiltin=u.EnvBuiltin,exports.EnvDocs=l.EnvDocs,exports.EnvTypeDefinition=u.EnvTypeDefinition,exports.createEnvReflection=n.createEnvReflection,exports.createReflectionResource=s.createReflectionResource,exports.createSecretsReflection=n.createSecretsReflection,exports.createTemplateReflection=i.createTemplateReflection,exports.default=k,exports.envBabelPlugin=d.envBabelPlugin,exports.formatEnvField=a.formatEnvField,exports.getEnvDefaultTypeDefinition=r.getEnvDefaultTypeDefinition,exports.getEnvReflectionsPath=r.getEnvReflectionsPath,exports.getEnvTypeReflectionsPath=r.getEnvTypeReflectionsPath,exports.getSecretsDefaultTypeDefinition=r.getSecretsDefaultTypeDefinition,exports.loadEnv=o.loadEnv,exports.loadEnvFromContext=o.loadEnvFromContext,exports.mergeEnvReflections=n.mergeEnvReflections,exports.mergeSecretsReflections=n.mergeSecretsReflections,exports.plugin=O,exports.readEnvReflection=r.readEnvReflection,exports.readEnvTypeReflection=r.readEnvTypeReflection,exports.readSecretsReflection=r.readSecretsReflection,exports.reflectEnv=n.reflectEnv,exports.reflectSecrets=n.reflectSecrets,exports.removeEnvPrefix=a.removeEnvPrefix,exports.resolveRuntimeTypeFile=r.resolveRuntimeTypeFile,exports.writeEnvReflection=r.writeEnvReflection,exports.writeEnvReflectionSync=r.writeEnvReflectionSync,exports.writeEnvTypeReflection=r.writeEnvTypeReflection;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Plugin } from "./powerlines/src/types/plugin.cjs";
|
|
2
2
|
import { EnvInterface, SecretsInterface, __ΩEnvInterface, __ΩSecretsInterface } from "./types/runtime.cjs";
|
|
3
3
|
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType } from "./types/plugin.cjs";
|
|
4
|
-
import { AlloyPluginBuilder, AlloyPluginOptions } from "./alloy/src/types/plugin.cjs";
|
|
5
4
|
import { EnvDocs } from "./components/docs.cjs";
|
|
6
5
|
import { EnvBuiltin, EnvBuiltinProps, EnvTypeDefinition, __ΩEnvBuiltinProps } from "./components/env.cjs";
|
|
7
6
|
import { createReflectionResource } from "./helpers/create-reflection-resource.cjs";
|
|
@@ -16,6 +15,6 @@ import { envBabelPlugin } from "./babel/plugin.cjs";
|
|
|
16
15
|
/**
|
|
17
16
|
* A Powerlines plugin to inject environment variables into the source code.
|
|
18
17
|
*/
|
|
19
|
-
declare const plugin: <
|
|
18
|
+
declare const plugin: <TContext extends EnvPluginContext = EnvPluginContext>(options?: EnvPluginOptions) => Plugin<TContext>[];
|
|
20
19
|
//#endregion
|
|
21
20
|
export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, EnvBuiltin, EnvBuiltinProps, EnvDocs, EnvInterface, EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, EnvTypeDefinition, SecretsInterface, __ΩCreateEnvReflectionOptions, __ΩEnvBuiltinProps, __ΩEnvInterface, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType, __ΩSecretsInterface, createEnvReflection, createReflectionResource, createSecretsReflection, createTemplateReflection, plugin as default, plugin, envBabelPlugin, formatEnvField, getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, loadEnv, loadEnvFromContext, mergeEnvReflections, mergeSecretsReflections, readEnvReflection, readEnvTypeReflection, readSecretsReflection, reflectEnv, reflectSecrets, removeEnvPrefix, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Plugin } from "./powerlines/src/types/plugin.mjs";
|
|
2
|
+
import "./powerlines/src/index.mjs";
|
|
2
3
|
import { EnvInterface, SecretsInterface, __ΩEnvInterface, __ΩSecretsInterface } from "./types/runtime.mjs";
|
|
3
4
|
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType } from "./types/plugin.mjs";
|
|
4
|
-
import "./types/index.mjs";
|
|
5
|
-
import { AlloyPluginBuilder, AlloyPluginOptions } from "./alloy/src/types/plugin.mjs";
|
|
6
|
-
import "./powerlines/src/types/index.mjs";
|
|
7
5
|
import { EnvDocs } from "./components/docs.mjs";
|
|
8
6
|
import { EnvBuiltin, EnvBuiltinProps, EnvTypeDefinition, __ΩEnvBuiltinProps } from "./components/env.mjs";
|
|
9
7
|
import "./components/index.mjs";
|
|
@@ -14,6 +12,7 @@ import { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflecti
|
|
|
14
12
|
import { formatEnvField, removeEnvPrefix } from "./helpers/source-file-env.mjs";
|
|
15
13
|
import { createTemplateReflection } from "./helpers/template-helpers.mjs";
|
|
16
14
|
import "./helpers/index.mjs";
|
|
15
|
+
import "./types/index.mjs";
|
|
17
16
|
import { envBabelPlugin } from "./babel/plugin.mjs";
|
|
18
17
|
import "./babel/index.mjs";
|
|
19
18
|
|
|
@@ -21,6 +20,6 @@ import "./babel/index.mjs";
|
|
|
21
20
|
/**
|
|
22
21
|
* A Powerlines plugin to inject environment variables into the source code.
|
|
23
22
|
*/
|
|
24
|
-
declare const plugin: <
|
|
23
|
+
declare const plugin: <TContext extends EnvPluginContext = EnvPluginContext>(options?: EnvPluginOptions) => Plugin<TContext>[];
|
|
25
24
|
//#endregion
|
|
26
25
|
export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, EnvBuiltin, EnvBuiltinProps, EnvDocs, EnvInterface, EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, EnvTypeDefinition, SecretsInterface, __ΩCreateEnvReflectionOptions, __ΩEnvBuiltinProps, __ΩEnvInterface, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType, __ΩSecretsInterface, createEnvReflection, createReflectionResource, createSecretsReflection, createTemplateReflection, plugin as default, plugin, envBabelPlugin, formatEnvField, getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, loadEnv, loadEnvFromContext, mergeEnvReflections, mergeSecretsReflections, readEnvReflection, readEnvTypeReflection, readSecretsReflection, reflectEnv, reflectSecrets, removeEnvPrefix, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import{type_exports as e}from"./deepkit/src/vendor/type.mjs";import{BaseEnv as t,BaseSecrets as n,createEnvReflection as r,createSecretsReflection as i,mergeEnvReflections as a,mergeSecretsReflections as o,reflectEnv as s,reflectSecrets as c}from"./helpers/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"./helpers/persistence.mjs";import{createTemplateReflection as b}from"./helpers/template-helpers.mjs";import{formatEnvField as x,removeEnvPrefix as S}from"./helpers/source-file-env.mjs";import{loadEnv as C,loadEnvFromContext as w}from"./helpers/load.mjs";import{createReflectionResource as T}from"./helpers/create-reflection-resource.mjs";import"./helpers/index.mjs";import{
|
|
1
|
+
import{type_exports as e}from"./deepkit/src/vendor/type.mjs";import{BaseEnv as t,BaseSecrets as n,createEnvReflection as r,createSecretsReflection as i,mergeEnvReflections as a,mergeSecretsReflections as o,reflectEnv as s,reflectSecrets as c}from"./helpers/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"./helpers/persistence.mjs";import{createTemplateReflection as b}from"./helpers/template-helpers.mjs";import{formatEnvField as x,removeEnvPrefix as S}from"./helpers/source-file-env.mjs";import{loadEnv as C,loadEnvFromContext as w}from"./helpers/load.mjs";import{createReflectionResource as T}from"./helpers/create-reflection-resource.mjs";import"./helpers/index.mjs";import{env as E}from"./helpers/automd-generator.mjs";import{EnvDocs as D}from"./components/docs.mjs";import{EnvBuiltin as O,EnvTypeDefinition as k}from"./components/env.mjs";import"./components/index.mjs";import{envBabelPlugin as A}from"./babel/plugin.mjs";import"./babel/index.mjs";import{createAlloyPlugin as j}from"./alloy/src/create-plugin.mjs";import M from"./plugin-automd/src/index.mjs";import N from"./plugin-babel/src/index.mjs";import{titleCase as P}from"@stryke/string-format/title-case";import F from"defu";import{parseTypeDefinition as I}from"@stryke/convert/parse-type-definition";import{LogLevelLabel as L}from"@storm-software/config-tools/types";import{toArray as R}from"@stryke/convert/to-array";import{isParentPath as z}from"@stryke/path/is-parent-path";import{ENV_PREFIXES as B}from"@stryke/env/types";import{createComponent as V}from"@alloy-js/core/jsx-runtime";import{joinPaths as H}from"@stryke/path/join";import{existsSync as U}from"@stryke/fs/exists";import{createDirectory as W}from"@stryke/fs/helpers";import{constantCase as G}from"@stryke/string-format/constant-case";const K=j((t={})=>({name:`env`,async config(){this.log(L.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:F(t,{types:{},prefix:[]}),transform:{babel:{plugins:[A]}}};if(e.env.types)e.env.types=I(e.env.types);else{this.log(L.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await l(this);e.env.types=I(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=I(e.env.secrets);else{let t=await f(this);e.env.secrets=I(`${t.file}#${t.name}`)}return e.env.prefix=R(e.env.prefix??[]).reduce((e,t)=>{let n=G(t);return e.includes(n)||e.push(n),e},[...B,`POWERLINES_`]),e.env.prefix=e.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),e},async configResolved(){if(this.log(L.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=F({parsed:await C(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&U(d(this,`env`)))this.log(L.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await m(this,`env`),U(u(this,`env`))&&(this.env.used.env=await p(this)),U(d(this,`secrets`))&&(this.env.types.secrets=await m(this,`secrets`)),U(u(this,`secrets`))&&(this.env.used.secrets=await h(this));else{if(this.env.types.env=await s(this,this.config.env.types?.file?z(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:H(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await y(this,this.env.types.env,`env`),this.env.types.secrets=await c(this,this.config.env.secrets?.file?z(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:H(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await y(this,this.env.types.secrets,`secrets`),this.log(L.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let t=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await C(this,this.config.env)).forEach(([e,n])=>{let r=this.config.env.prefix.reduce((t,n)=>e.replace(/_$/g,``).startsWith(n)?e.replace(/_$/g,``).slice(n.length):t,e),i=t.find(e=>e?.getAlias().reverse().includes(r));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(n)}),this.env.used.env=new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await _(this,this.env.used.env,`env`),this.env.types.secrets&&(await y(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await _(this,this.env.used.secrets,`secrets`))}},render(){let e=this;return this.log(L.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),V(O,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(L.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let t=H(this.config.projectRoot,`docs`,`generated`);U(t)||await W(t);let n=await m(this,`env`),r=H(t,`env.md`);this.log(L.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${P(this.config.framework)||`Powerlines`} -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project. The variables in the list below are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
|
|
10
|
-
|
|
11
|
-
| Name | Description | Type | Default Value | Required |
|
|
12
|
-
| ---- | ----------- | ---- | ------------- | :------: |
|
|
13
|
-
${n.getProperties().filter(e=>e.getNameAsString()!==`__STORM_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(t=>`| ${t.getNameAsString().trim()} | ${(t.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
|
|
5
|
+
| Name | Description | Type | Default Value | Required |
|
|
6
|
+
| ---- | ----------- | ---- | ------------- | :------: |
|
|
7
|
+
${n.getProperties().filter(e=>e.getNameAsString()!==`__POWERLINES_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(t=>`| ${t.getNameAsString().trim()} | ${(t.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
|
|
14
8
|
`,``)??``).trim()} | ${(0,e.stringifyType)(t.getType()).trim().replaceAll(` | `,`, or `)} | ${t.hasDefault()?String(t.getDefaultValue())?.includes(`"`)?t.getDefaultValue():`\`${t.getDefaultValue()}\``:``} | ${t.isValueRequired()?``:`✔`} |`).join(`
|
|
15
9
|
`)}
|
|
16
|
-
|
|
10
|
+
`)},async buildEnd(){let e=u(this,`env`);this.log(L.TRACE,`Writing env reflection types to ${e}.`),await _(this,this.env.used.env,`env`)}})),q=(e={})=>[N(e.babel),K(e),{name:`env:automd-generator`,config(){return{automd:F(e.automd??{},{generators:{env:E(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},M(e.automd)];var J=q;export{t as BaseEnv,n as BaseSecrets,O as EnvBuiltin,D as EnvDocs,k as EnvTypeDefinition,r as createEnvReflection,T as createReflectionResource,i as createSecretsReflection,b as createTemplateReflection,J as default,A as envBabelPlugin,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,q as plugin,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};
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1,38 @@
|
|
|
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 };
|
|
@@ -0,0 +1,40 @@
|
|
|
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 };
|
|
@@ -0,0 +1,33 @@
|
|
|
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 };
|
|
@@ -0,0 +1,33 @@
|
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { BabelResolvedConfig, ResolvedConfig } from "../../../powerlines/src/types/resolved.cjs";
|
|
2
|
-
import { PluginContext } from "../../../powerlines/src/types/context.cjs";
|
|
3
2
|
import { BabelUserConfig, UserConfig } from "../../../powerlines/src/types/config.cjs";
|
|
3
|
+
import { PluginContext } from "../../../powerlines/src/types/context.cjs";
|
|
4
4
|
|
|
5
5
|
//#region ../plugin-babel/src/types/plugin.d.ts
|
|
6
6
|
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BabelResolvedConfig, ResolvedConfig } from "../../../powerlines/src/types/resolved.mjs";
|
|
2
|
-
import { PluginContext } from "../../../powerlines/src/types/context.mjs";
|
|
3
2
|
import { BabelUserConfig, UserConfig } from "../../../powerlines/src/types/config.mjs";
|
|
3
|
+
import { PluginContext } from "../../../powerlines/src/types/context.mjs";
|
|
4
4
|
|
|
5
5
|
//#region ../plugin-babel/src/types/plugin.d.ts
|
|
6
6
|
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@stryke/capnp";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn } from "./types/babel.mjs";
|
|
2
|
+
import { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant } from "./types/build.mjs";
|
|
3
|
+
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileMetadata, VirtualFileSystemInterface, WriteOptions } from "./types/fs.mjs";
|
|
4
|
+
import { CommandType, SUPPORTED_COMMANDS } from "./types/commands.mjs";
|
|
5
|
+
import { BabelResolvedConfig, EnvironmentResolvedConfig, OutputResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition } from "./types/resolved.mjs";
|
|
6
|
+
import { BasePluginHookFunctions, BuildPlugin, ConfigResult, Plugin, PluginBuildPlugins, PluginHook, PluginHookObject, PluginHooks, TypesResult } from "./types/plugin.mjs";
|
|
7
|
+
import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig } from "./types/tsconfig.mjs";
|
|
8
|
+
import { BabelUserConfig, BaseConfig, CommonUserConfig, DeployConfig, EnvironmentConfig, InlineConfig, LogFn, OutputConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, ProjectType, UserConfig, WorkspaceConfig } from "./types/config.mjs";
|
|
9
|
+
import { BuildPluginContext, Context, EmitEntryOptions, FetchOptions, InitContextOptions, LogLevel, MetaInfo, ParseOptions, PluginContext, Resolver, TransformResult, UnresolvedContext } from "./types/context.mjs";
|
|
10
|
+
import "./types/index.mjs";
|
|
11
|
+
import "./api.mjs";
|
|
12
|
+
import "../schemas/fs.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../types/resolved.mjs";
|
|
2
2
|
import "../../types/hooks.mjs";
|
|
3
3
|
import "../../types/context.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
5
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/path/join-paths`),t=require(`@stryke/convert/parse-type-definition`),n=require(`@stryke/type-checks/is-set-string`),r=require(`@stryke/path/replace`),i=require(`@stryke/type-checks/is-string`),a=require(`@stryke/convert/to-array`)
|
|
1
|
+
require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/path/join-paths`),t=require(`@stryke/convert/parse-type-definition`),n=require(`@stryke/type-checks/is-set-string`),r=require(`@stryke/path/replace`),i=require(`@stryke/type-checks/is-string`),a=require(`@stryke/convert/to-array`),o=require(`@stryke/fs/is-file`),s=require(`@stryke/fs/list-files`);require(`@stryke/hash/murmurhash`);let c=require(`@stryke/helpers/get-unique`),l=require(`@stryke/path/append`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../plugin-utils/paths.mjs";import{joinPaths as e}from"@stryke/path/join-paths";import{parseTypeDefinition as t}from"@stryke/convert/parse-type-definition";import{isSetString as n}from"@stryke/type-checks/is-set-string";import{replacePath as r}from"@stryke/path/replace";import{isString as i}from"@stryke/type-checks/is-string";import{toArray as a}from"@stryke/convert/to-array";import"@stryke/fs/is-file";import"@stryke/fs/list-files";import"@stryke/hash/murmurhash";import{getUniqueBy as
|
|
1
|
+
import"../plugin-utils/paths.mjs";import{joinPaths as e}from"@stryke/path/join-paths";import{parseTypeDefinition as t}from"@stryke/convert/parse-type-definition";import{isSetString as n}from"@stryke/type-checks/is-set-string";import{replacePath as r}from"@stryke/path/replace";import{isString as i}from"@stryke/type-checks/is-string";import{toArray as a}from"@stryke/convert/to-array";import"@stryke/fs/is-file";import{listFiles as o}from"@stryke/fs/list-files";import"@stryke/hash/murmurhash";import{getUniqueBy as s}from"@stryke/helpers/get-unique";import{appendPath as c}from"@stryke/path/append";export{};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
2
1
|
import { ArrayValues } from "@stryke/types/array";
|
|
2
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
3
3
|
|
|
4
4
|
//#region ../powerlines/src/types/commands.d.ts
|
|
5
5
|
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./context.mjs";
|
|
2
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
3
2
|
import { ArrayValues } from "@stryke/types/array";
|
|
3
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
4
4
|
|
|
5
5
|
//#region ../powerlines/src/types/commands.d.ts
|
|
6
6
|
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BabelTransformPluginOptions } from "./babel.cjs";
|
|
2
2
|
import { BuildConfig, BuildResolvedConfig } from "./build.cjs";
|
|
3
|
+
import { StoragePort, StoragePreset } from "./fs.cjs";
|
|
3
4
|
import { Plugin } from "./plugin.cjs";
|
|
4
5
|
import { TSConfig } from "./tsconfig.cjs";
|
|
5
6
|
import { PluginContext } from "./context.cjs";
|
|
6
|
-
import {
|
|
7
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
7
8
|
import { transformAsync } from "@babel/core";
|
|
8
9
|
import { Format } from "@storm-software/build-tools/types";
|
|
9
10
|
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
10
11
|
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
11
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
12
12
|
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
13
13
|
import { AssetGlob } from "@stryke/types/file";
|
|
14
14
|
import { PreviewOptions } from "vite";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BabelTransformPluginOptions } from "./babel.mjs";
|
|
2
2
|
import { BuildConfig, BuildResolvedConfig } from "./build.mjs";
|
|
3
|
+
import { StoragePort, StoragePreset } from "./fs.mjs";
|
|
3
4
|
import { Plugin } from "./plugin.mjs";
|
|
4
5
|
import { TSConfig } from "./tsconfig.mjs";
|
|
5
6
|
import { PluginContext } from "./context.mjs";
|
|
6
|
-
import { BabelTransformPluginOptions } from "./babel.mjs";
|
|
7
7
|
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
8
8
|
import "c12";
|
|
9
9
|
import { transformAsync } from "@babel/core";
|
|
10
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
10
11
|
import { Format } from "@storm-software/build-tools/types";
|
|
11
12
|
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
12
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
13
13
|
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
14
14
|
import { AssetGlob } from "@stryke/types/file";
|
|
15
15
|
import { PreviewOptions } from "vite";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
|
|
2
2
|
import { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.mjs";
|
|
3
3
|
import "./plugin.mjs";
|
|
4
|
-
import "./hooks.mjs";
|
|
5
4
|
import { ParsedTypeScriptConfig } from "./tsconfig.mjs";
|
|
6
5
|
import { InlineConfig, LogFn, UserConfig, WorkspaceConfig } from "./config.mjs";
|
|
6
|
+
import "./hooks.mjs";
|
|
7
7
|
import { NonUndefined } from "@stryke/types/base";
|
|
8
8
|
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
9
9
|
import { FetchRequestOptions } from "@stryke/http/fetch";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn } from "./babel.mjs";
|
|
2
2
|
import { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant } from "./build.mjs";
|
|
3
|
+
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileMetadata, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
|
|
3
4
|
import { CommandType, SUPPORTED_COMMANDS } from "./commands.mjs";
|
|
4
5
|
import { BabelResolvedConfig, EnvironmentResolvedConfig, OutputResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.mjs";
|
|
5
6
|
import { BasePluginHookFunctions, BuildPlugin, ConfigResult, Plugin, PluginBuildPlugins, PluginHook, PluginHookObject, PluginHooks, TypesResult } from "./plugin.mjs";
|
|
6
|
-
import "./hooks.mjs";
|
|
7
7
|
import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig } from "./tsconfig.mjs";
|
|
8
|
-
import { BuildPluginContext, Context, EmitEntryOptions, FetchOptions, InitContextOptions, LogLevel, MetaInfo, ParseOptions, PluginContext, Resolver, TransformResult, UnresolvedContext } from "./context.mjs";
|
|
9
|
-
import { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn } from "./babel.mjs";
|
|
10
8
|
import { BabelUserConfig, BaseConfig, CommonUserConfig, DeployConfig, EnvironmentConfig, InlineConfig, LogFn, OutputConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, ProjectType, UserConfig, WorkspaceConfig } from "./config.mjs";
|
|
9
|
+
import "./hooks.mjs";
|
|
10
|
+
import { BuildPluginContext, Context, EmitEntryOptions, FetchOptions, InitContextOptions, LogLevel, MetaInfo, ParseOptions, PluginContext, Resolver, TransformResult, UnresolvedContext } from "./context.mjs";
|
|
11
11
|
import "./api.mjs";
|
|
12
12
|
import "./unplugin.mjs";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { UnpluginBuildVariant } from "./build.cjs";
|
|
2
2
|
import { CommandType } from "./commands.cjs";
|
|
3
3
|
import { EnvironmentResolvedConfig, ResolvedConfig } from "./resolved.cjs";
|
|
4
|
-
import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.cjs";
|
|
5
4
|
import { EnvironmentConfig, PluginConfig } from "./config.cjs";
|
|
5
|
+
import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.cjs";
|
|
6
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
6
7
|
import { FunctionLike, MaybePromise } from "@stryke/types/base";
|
|
7
8
|
import { ExternalIdResult, HookFilter, TransformResult, UnpluginOptions } from "unplugin";
|
|
8
|
-
import { ArrayValues } from "@stryke/types/array";
|
|
9
9
|
|
|
10
10
|
//#region ../powerlines/src/types/plugin.d.ts
|
|
11
11
|
interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { UnpluginBuildVariant } from "./build.mjs";
|
|
2
2
|
import { CommandType } from "./commands.mjs";
|
|
3
3
|
import { EnvironmentResolvedConfig, ResolvedConfig } from "./resolved.mjs";
|
|
4
|
-
import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.mjs";
|
|
5
4
|
import { EnvironmentConfig, PluginConfig } from "./config.mjs";
|
|
5
|
+
import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.mjs";
|
|
6
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
6
7
|
import { FunctionLike, MaybePromise } from "@stryke/types/base";
|
|
7
8
|
import { ExternalIdResult, HookFilter, TransformResult, UnpluginOptions } from "unplugin";
|
|
8
|
-
import { ArrayValues } from "@stryke/types/array";
|
|
9
9
|
|
|
10
10
|
//#region ../powerlines/src/types/plugin.d.ts
|
|
11
11
|
interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Reflection } from "../deepkit/src/types.cjs";
|
|
2
|
+
import { AutoMDPluginOptions } from "../plugin-automd/src/types/plugin.cjs";
|
|
2
3
|
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../plugin-babel/src/types/plugin.cjs";
|
|
3
4
|
import { EnvInterface, SecretsInterface } from "./runtime.cjs";
|
|
4
|
-
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
5
5
|
import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
6
|
+
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
6
7
|
import { DotenvParseOutput } from "@stryke/env/types";
|
|
7
8
|
|
|
8
9
|
//#region src/types/plugin.d.ts
|
|
@@ -46,6 +47,13 @@ type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
|
|
|
46
47
|
* This option allows you to customize the Babel transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Babel settings.
|
|
47
48
|
*/
|
|
48
49
|
babel?: BabelPluginOptions;
|
|
50
|
+
/**
|
|
51
|
+
* AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
|
|
55
|
+
*/
|
|
56
|
+
automd?: AutoMDPluginOptions;
|
|
49
57
|
};
|
|
50
58
|
type EnvPluginUserConfig = BabelPluginUserConfig & {
|
|
51
59
|
env: EnvPluginOptions;
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Reflection } from "../deepkit/src/types.mjs";
|
|
2
|
+
import { AutoMDPluginOptions } from "../plugin-automd/src/types/plugin.mjs";
|
|
2
3
|
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../plugin-babel/src/types/plugin.mjs";
|
|
3
4
|
import "../plugin-babel/src/types/index.mjs";
|
|
4
5
|
import { EnvInterface, SecretsInterface } from "./runtime.mjs";
|
|
@@ -47,6 +48,13 @@ type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
|
|
|
47
48
|
* This option allows you to customize the Babel transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Babel settings.
|
|
48
49
|
*/
|
|
49
50
|
babel?: BabelPluginOptions;
|
|
51
|
+
/**
|
|
52
|
+
* AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
|
|
56
|
+
*/
|
|
57
|
+
automd?: AutoMDPluginOptions;
|
|
50
58
|
};
|
|
51
59
|
type EnvPluginUserConfig = BabelPluginUserConfig & {
|
|
52
60
|
env: EnvPluginOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-env",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
|
|
6
6
|
"repository": {
|
|
@@ -187,14 +187,16 @@
|
|
|
187
187
|
"files": ["dist/**/*"],
|
|
188
188
|
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
189
189
|
"dependencies": {
|
|
190
|
+
"automd": "^0.4.2",
|
|
190
191
|
"@alloy-js/core": "^0.21.0",
|
|
191
192
|
"@alloy-js/typescript": "^0.21.0",
|
|
192
193
|
"@alloy-js/markdown": "^0.21.0",
|
|
193
194
|
"@babel/core": "^7.28.5",
|
|
194
195
|
"@babel/types": "^7.28.5",
|
|
195
|
-
"@powerlines/alloy": "^0.12.
|
|
196
|
-
"@powerlines/plugin-
|
|
197
|
-
"@powerlines/plugin-
|
|
196
|
+
"@powerlines/alloy": "^0.12.1",
|
|
197
|
+
"@powerlines/plugin-automd": "^0.1.98",
|
|
198
|
+
"@powerlines/plugin-babel": "^0.12.107",
|
|
199
|
+
"@powerlines/plugin-plugin": "^0.12.50",
|
|
198
200
|
"@storm-software/config-tools": "^1.188.73",
|
|
199
201
|
"@stryke/capnp": "^0.12.51",
|
|
200
202
|
"@stryke/env": "^0.20.43",
|
|
@@ -203,16 +205,16 @@
|
|
|
203
205
|
"@stryke/string-format": "^0.12.29",
|
|
204
206
|
"@stryke/type-checks": "^0.5.14",
|
|
205
207
|
"@stryke/types": "^0.10.28",
|
|
206
|
-
"powerlines": "^0.36.
|
|
208
|
+
"powerlines": "^0.36.3"
|
|
207
209
|
},
|
|
208
210
|
"devDependencies": {
|
|
209
211
|
"@alloy-js/babel-preset": "^0.2.1",
|
|
210
212
|
"@babel/preset-typescript": "^7.28.5",
|
|
211
|
-
"@powerlines/nx": "^0.11.
|
|
213
|
+
"@powerlines/nx": "^0.11.29",
|
|
212
214
|
"@types/node": "^24.10.4",
|
|
213
215
|
"typescript": "^5.9.3",
|
|
214
216
|
"vite": "8.0.0-beta.2"
|
|
215
217
|
},
|
|
216
218
|
"publishConfig": { "access": "public" },
|
|
217
|
-
"gitHead": "
|
|
219
|
+
"gitHead": "0d695fa64043ba14e7c7ae8759e9e0cf5b2a6b38"
|
|
218
220
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "../../../powerlines/src/types/plugin.cjs";
|
|
2
|
-
import { PluginContext } from "../../../powerlines/src/types/context.cjs";
|
|
3
|
-
import { PluginPluginAlloyOptions } from "../../../plugin-plugin/src/types/plugin.cjs";
|
|
4
|
-
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
//#region ../alloy/src/types/plugin.d.ts
|
|
7
|
-
interface AlloyPluginOptions {
|
|
8
|
-
alloy?: PluginPluginAlloyOptions;
|
|
9
|
-
}
|
|
10
|
-
type AlloyPluginBuilderResult<TContext extends PluginContext = PluginContext> = Plugin<TContext> & {
|
|
11
|
-
render: (this: TContext) => Children;
|
|
12
|
-
};
|
|
13
|
-
type AlloyPluginBuilder<TContext extends PluginContext = PluginContext, TOptions = any> = <T extends TContext>(options: TOptions) => AlloyPluginBuilderResult<T>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { AlloyPluginBuilder, AlloyPluginOptions };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "../../../powerlines/src/types/plugin.mjs";
|
|
2
|
-
import { PluginContext } from "../../../powerlines/src/types/context.mjs";
|
|
3
|
-
import { PluginPluginAlloyOptions } from "../../../plugin-plugin/src/types/plugin.mjs";
|
|
4
|
-
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
//#region ../alloy/src/types/plugin.d.ts
|
|
7
|
-
interface AlloyPluginOptions {
|
|
8
|
-
alloy?: PluginPluginAlloyOptions;
|
|
9
|
-
}
|
|
10
|
-
type AlloyPluginBuilderResult<TContext extends PluginContext = PluginContext> = Plugin<TContext> & {
|
|
11
|
-
render: (this: TContext) => Children;
|
|
12
|
-
};
|
|
13
|
-
type AlloyPluginBuilder<TContext extends PluginContext = PluginContext, TOptions = any> = <T extends TContext>(options: TOptions) => AlloyPluginBuilderResult<T>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { AlloyPluginBuilder, AlloyPluginOptions };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
2
|
-
import { PrintTreeOptions } from "@alloy-js/core";
|
|
3
|
-
|
|
4
|
-
//#region ../plugin-plugin/src/types/plugin.d.ts
|
|
5
|
-
|
|
6
|
-
type PluginPluginAlloyOptions = Partial<PrintTreeOptions> & {
|
|
7
|
-
/**
|
|
8
|
-
* If true, the Alloy framework is used to generate JSON output files.
|
|
9
|
-
*
|
|
10
|
-
* @defaultValue false
|
|
11
|
-
*/
|
|
12
|
-
generatesJson?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* If true, the Alloy framework is used to generate Markdown output files.
|
|
15
|
-
*
|
|
16
|
-
* @defaultValue false
|
|
17
|
-
*/
|
|
18
|
-
generatesMarkdown?: boolean;
|
|
19
|
-
};
|
|
20
|
-
//#endregion
|
|
21
|
-
export { PluginPluginAlloyOptions };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import "../../../powerlines/src/types/build.mjs";
|
|
2
|
-
import "../../../powerlines/src/types/resolved.mjs";
|
|
3
|
-
import "../../../powerlines/src/types/context.mjs";
|
|
4
|
-
import "../../../powerlines/src/types/config.mjs";
|
|
5
|
-
import { PrintTreeOptions } from "@alloy-js/core";
|
|
6
|
-
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
7
|
-
|
|
8
|
-
//#region ../plugin-plugin/src/types/plugin.d.ts
|
|
9
|
-
type PluginPluginAlloyOptions = Partial<PrintTreeOptions> & {
|
|
10
|
-
/**
|
|
11
|
-
* If true, the Alloy framework is used to generate JSON output files.
|
|
12
|
-
*
|
|
13
|
-
* @defaultValue false
|
|
14
|
-
*/
|
|
15
|
-
generatesJson?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* If true, the Alloy framework is used to generate Markdown output files.
|
|
18
|
-
*
|
|
19
|
-
* @defaultValue false
|
|
20
|
-
*/
|
|
21
|
-
generatesMarkdown?: boolean;
|
|
22
|
-
};
|
|
23
|
-
//#endregion
|
|
24
|
-
export { PluginPluginAlloyOptions };
|