@powerlines/plugin-date 0.12.129 → 0.12.131
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/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/plugin-alloy/src/core/components/output.cjs +1 -1
- package/dist/plugin-alloy/src/core/components/output.mjs +1 -1
- package/dist/plugin-alloy/src/core/contexts/context.cjs +1 -1
- package/dist/plugin-alloy/src/core/contexts/context.mjs +1 -1
- package/dist/plugin-alloy/src/index.cjs +1 -2
- package/dist/plugin-alloy/src/index.mjs +1 -2
- package/dist/plugin-alloy/src/types/components.d.mts +1 -1
- package/dist/plugin-alloy/src/types/plugin.d.cts +3 -3
- package/dist/plugin-alloy/src/types/plugin.d.mts +3 -3
- package/dist/plugin-babel/src/helpers/filters.cjs +1 -1
- package/dist/plugin-babel/src/helpers/filters.mjs +1 -1
- package/dist/plugin-babel/src/index.cjs +1 -1
- package/dist/plugin-babel/src/index.mjs +1 -1
- package/dist/plugin-env/src/helpers/load.cjs +1 -1
- package/dist/plugin-env/src/helpers/load.mjs +1 -1
- package/dist/plugin-env/src/helpers/reflect.cjs +1 -1
- package/dist/plugin-env/src/helpers/reflect.mjs +1 -1
- package/dist/plugin-env/src/index.cjs +2 -2
- package/dist/plugin-env/src/index.mjs +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/config.d.mts +1 -1
- package/dist/powerlines/src/types/context.d.cts +17 -0
- package/dist/powerlines/src/types/context.d.mts +17 -0
- package/dist/powerlines/src/types/fs.d.cts +28 -0
- package/dist/powerlines/src/types/fs.d.mts +28 -0
- package/package.json +5 -5
- package/dist/plugin-alloy/src/vendor/index.cjs +0 -1
- package/dist/plugin-alloy/src/vendor/index.d.cts +0 -7
- package/dist/plugin-alloy/src/vendor/index.d.mts +0 -7
- package/dist/plugin-alloy/src/vendor/index.mjs +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./plugin-env/src/index.cjs`),n=require(`./components/date-fns.cjs`),r=require(`./components/dayjs.cjs`),i=require(`./components/luxon.cjs`),a=require(`./components/moment.cjs`);require(`./components/index.cjs`);let o=require(`@storm-software/config-tools/types`)
|
|
1
|
+
Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./plugin-env/src/index.cjs`),n=require(`./components/date-fns.cjs`),r=require(`./components/dayjs.cjs`),i=require(`./components/luxon.cjs`),a=require(`./components/moment.cjs`);require(`./components/index.cjs`);let o=require(`defu`);o=e.__toESM(o);let s=require(`@storm-software/config-tools/types`);function c(e={}){return[t.default(e.env),{name:`date`,async config(){this.log(s.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `date` build plugin.");let t={date:(0,o.default)(e,{type:`date-fns`})};return(!t.date.type||![`date-fns`,`dayjs`,`luxon`,`moment`].includes(t.date.type))&&(t.date.type&&this.log(s.LogLevelLabel.WARN,`Invalid date library type "${t.date.type}" specified. Defaulting to "date-fns".`),t.date.type=`date-fns`),this.log(s.LogLevelLabel.DEBUG,`Using date library: ${t.date.type}`),t},async configResolved(){this.log(s.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.dependencies[this.config.date.type]=`latest`},async prepare(){this.log(s.LogLevelLabel.TRACE,`Preparing the Date runtime artifacts for the Powerlines project.`);let e;switch(this.config.date.type){case`dayjs`:e=r.dayjsModule;break;case`luxon`:e=i.luxonModule;break;case`moment`:e=a.momentModule;break;case`date-fns`:default:e=n.dateFnsModule;break}await this.emitBuiltin(await Promise.resolve(e(this)),`date`,`date.ts`)}}]}var l=c;exports.dateFnsModule=n.dateFnsModule,exports.dayjsModule=r.dayjsModule,exports.default=l,exports.luxonModule=i.luxonModule,exports.momentModule=a.momentModule,exports.plugin=c;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./plugin-env/src/index.mjs";import{dateFnsModule as t}from"./components/date-fns.mjs";import{dayjsModule as n}from"./components/dayjs.mjs";import{luxonModule as r}from"./components/luxon.mjs";import{momentModule as i}from"./components/moment.mjs";import"./components/index.mjs";import{LogLevelLabel as
|
|
1
|
+
import e from"./plugin-env/src/index.mjs";import{dateFnsModule as t}from"./components/date-fns.mjs";import{dayjsModule as n}from"./components/dayjs.mjs";import{luxonModule as r}from"./components/luxon.mjs";import{momentModule as i}from"./components/moment.mjs";import"./components/index.mjs";import a from"defu";import{LogLevelLabel as o}from"@storm-software/config-tools/types";function s(s={}){return[e(s.env),{name:`date`,async config(){this.log(o.TRACE,"Providing default configuration for the Powerlines `date` build plugin.");let e={date:a(s,{type:`date-fns`})};return(!e.date.type||![`date-fns`,`dayjs`,`luxon`,`moment`].includes(e.date.type))&&(e.date.type&&this.log(o.WARN,`Invalid date library type "${e.date.type}" specified. Defaulting to "date-fns".`),e.date.type=`date-fns`),this.log(o.DEBUG,`Using date library: ${e.date.type}`),e},async configResolved(){this.log(o.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.dependencies[this.config.date.type]=`latest`},async prepare(){this.log(o.TRACE,`Preparing the Date runtime artifacts for the Powerlines project.`);let e;switch(this.config.date.type){case`dayjs`:e=n;break;case`luxon`:e=r;break;case`moment`:e=i;break;case`date-fns`:default:e=t;break}await this.emitBuiltin(await Promise.resolve(e(this)),`date`,`date.ts`)}}]}var c=s;export{t as dateFnsModule,n as dayjsModule,c as default,r as luxonModule,i as momentModule,s as plugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../contexts/context.cjs`);let n=require(`@alloy-js/core`),r=require(`@stryke/path/replace`),i=require(`react/jsx-runtime`);function a(e){let[{children:a,context:o,meta:s,basePath:c},l]=(0,n.splitProps)(e,[`children`,`context`,`meta`,`basePath`]),u=(0,n.ref)(o),d=(0,n.ref)(s??{}),f=(0,n.computed)(()=>c?(0,r.replacePath)(c,u.value.workspaceConfig.workspaceRoot):u.value.workspaceConfig.workspaceRoot);return(0,i.jsx)(n.Output,{...l,basePath:f.value,children:(0,i.jsx)(t.PowerlinesContext.Provider,{value:{ref:u,meta:d},children:(0,i.jsx)(n.Show,{when:!!u.value,children:a})})})}exports.Output=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{PowerlinesContext as e}from"../contexts/context.mjs";import{Output as t,Show as n,computed as r,ref as i,splitProps as a}from"@alloy-js/core";import{replacePath as o}from"@stryke/path/replace";import{jsx as s}from"react/jsx-runtime";function c(c){let[{children:l,context:u,meta:d,basePath:f},p]=a(c,[`children`,`context`,`meta`,`basePath`]),m=i(u),h=i(d??{}),g=r(()=>f?o(f,m.value.workspaceConfig.workspaceRoot):m.value.workspaceConfig.workspaceRoot);return s(t,{...p,basePath:g.value,children:s(e.Provider,{value:{ref:m,meta:h},children:s(n,{when:!!m.value,children:l})})})}export{c as Output};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core`);const n=(0,t.createNamedContext)(`powerlines`);exports.PowerlinesContext=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createNamedContext as e}from"@alloy-js/core";const t=e(`powerlines`);export{t as PowerlinesContext};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./
|
|
2
|
-
`)?`${i}\n`:i}function g(e){let n=[];for(let r of e)if(typeof r==`string`){let e=r.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));n.push(e)}else (0,t.vendor_exports.isPrintHook)(r)?n.push(r.print(r.subtree,g)):n.push(g(r));return n}exports.default=p;
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./core/components/output.cjs`);let n=require(`@alloy-js/core`),r=require(`@alloy-js/rollup-plugin`);r=e.__toESM(r);let i=require(`@stryke/json/storm-json`),a=require(`react/jsx-runtime`);const o=(e={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...e},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@alloy-js/core`}}},plugins:[(0,r.default)()]}}},async configResolved(){(this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`||this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource!==`@alloy-js/core`)&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`),this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource!==`@alloy-js/core`&&(this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=`@alloy-js/core`),await this.fs.write(this.tsconfig.tsconfigFilePath,i.StormJSON.stringify(this.tsconfig.tsconfigJson))),this.dependencies[`@alloy-js/core`]=`^0.22.0`,this.config.alloy?.typescript!==!1&&(this.dependencies[`@alloy-js/typescript`]=`^0.22.0`),this.config.alloy?.json===!0&&(this.dependencies[`@alloy-js/json`]=`^0.22.0`),this.config.alloy?.markdown===!0&&(this.dependencies[`@alloy-js/markdown`]=`^0.22.0`)}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async e=>{let r={};await(0,n.traverseOutput)(await(0,n.renderAsync)((0,a.jsx)(t.Output,{context:this,meta:r,basePath:this.workspaceConfig.workspaceRoot,children:e})),{visitDirectory:e=>{this.fs.existsSync(e.path)||this.fs.mkdirSync(e.path)},visitFile:e=>{if(`contents`in e){let t=r[e.path]??{};if(t.kind===`builtin`){if(!t.id)throw Error(`Built-in file "${e.path}" is missing its ID in the render metadata.`);this.emitBuiltinSync(e.contents,t.id,e.path,{skipFormat:t.skipFormat,storage:t.storage})}else t.kind===`entry`?this.emitEntrySync(e.contents,e.path,{skipFormat:t.skipFormat,storage:t.storage,...t.typeDefinition??{}}):this.fs.writeSync(e.path,e.contents)}else this.fs.copySync(e.sourcePath,e.path)}})}}}}];var s=o;exports.default=s;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)?`${i}\n`:i}function m(t){let n=[];for(let r of t)if(typeof r==`string`){let e=r.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));n.push(e)}else (0,e.isPrintHook)(r)?n.push(r.print(r.subtree,m)):n.push(m(r));return n}export{d as default};
|
|
1
|
+
import{Output as e}from"./core/components/output.mjs";import{renderAsync as t,traverseOutput as n}from"@alloy-js/core";import r from"@alloy-js/rollup-plugin";import{StormJSON as i}from"@stryke/json/storm-json";import{jsx as a}from"react/jsx-runtime";var o=(o={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...o},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@alloy-js/core`}}},plugins:[r()]}}},async configResolved(){(this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`||this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource!==`@alloy-js/core`)&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`),this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource!==`@alloy-js/core`&&(this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=`@alloy-js/core`),await this.fs.write(this.tsconfig.tsconfigFilePath,i.stringify(this.tsconfig.tsconfigJson))),this.dependencies[`@alloy-js/core`]=`^0.22.0`,this.config.alloy?.typescript!==!1&&(this.dependencies[`@alloy-js/typescript`]=`^0.22.0`),this.config.alloy?.json===!0&&(this.dependencies[`@alloy-js/json`]=`^0.22.0`),this.config.alloy?.markdown===!0&&(this.dependencies[`@alloy-js/markdown`]=`^0.22.0`)}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async r=>{let i={};await n(await t(a(e,{context:this,meta:i,basePath:this.workspaceConfig.workspaceRoot,children:r})),{visitDirectory:e=>{this.fs.existsSync(e.path)||this.fs.mkdirSync(e.path)},visitFile:e=>{if(`contents`in e){let t=i[e.path]??{};if(t.kind===`builtin`){if(!t.id)throw Error(`Built-in file "${e.path}" is missing its ID in the render metadata.`);this.emitBuiltinSync(e.contents,t.id,e.path,{skipFormat:t.skipFormat,storage:t.storage})}else t.kind===`entry`?this.emitEntrySync(e.contents,e.path,{skipFormat:t.skipFormat,storage:t.storage,...t.typeDefinition??{}}):this.fs.writeSync(e.path,e.contents)}else this.fs.copySync(e.sourcePath,e.path)}})}}}}];export{o as default};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { UserConfig } from "../../../powerlines/src/types/config.cjs";
|
|
2
2
|
import { ResolvedConfig } from "../../../powerlines/src/types/resolved.cjs";
|
|
3
3
|
import { PluginContext } from "../../../powerlines/src/types/context.cjs";
|
|
4
|
-
import {
|
|
4
|
+
import { Children, PrintTreeOptions } from "@alloy-js/core";
|
|
5
5
|
|
|
6
6
|
//#region ../plugin-alloy/src/types/plugin.d.ts
|
|
7
|
-
type AlloyPluginOptions = Partial<
|
|
7
|
+
type AlloyPluginOptions = Partial<PrintTreeOptions> & {
|
|
8
8
|
/**
|
|
9
9
|
* If true, the Alloy framework is used to generate Typescript output files.
|
|
10
10
|
*
|
|
@@ -31,7 +31,7 @@ type AlloyPluginResolvedConfig = ResolvedConfig & {
|
|
|
31
31
|
alloy: AlloyPluginOptions;
|
|
32
32
|
};
|
|
33
33
|
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
34
|
-
render: <TContext extends AlloyPluginContext>(this: TContext, children:
|
|
34
|
+
render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
37
37
|
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { UserConfig } from "../../../powerlines/src/types/config.mjs";
|
|
2
2
|
import { ResolvedConfig } from "../../../powerlines/src/types/resolved.mjs";
|
|
3
3
|
import { PluginContext } from "../../../powerlines/src/types/context.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { Children, PrintTreeOptions } from "@alloy-js/core";
|
|
5
5
|
|
|
6
6
|
//#region ../plugin-alloy/src/types/plugin.d.ts
|
|
7
|
-
type AlloyPluginOptions = Partial<
|
|
7
|
+
type AlloyPluginOptions = Partial<PrintTreeOptions> & {
|
|
8
8
|
/**
|
|
9
9
|
* If true, the Alloy framework is used to generate Typescript output files.
|
|
10
10
|
*
|
|
@@ -31,7 +31,7 @@ type AlloyPluginResolvedConfig = ResolvedConfig & {
|
|
|
31
31
|
alloy: AlloyPluginOptions;
|
|
32
32
|
};
|
|
33
33
|
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
34
|
-
render: <TContext extends AlloyPluginContext>(this: TContext, children:
|
|
34
|
+
render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
37
37
|
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-function`);require(`@stryke/type-checks/is-object`);let n=require(`@stryke/type-checks/is-set-string`);function r(e){return(0,n.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 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isFunction as e}from"@stryke/type-checks/is-function";import"@stryke/type-checks/is-object";import{isSetString as t}from"@stryke/type-checks/is-set-string";function n(e){return t(e)?e:Array.isArray(e)&&e.length>0?n(e[0]):e.$$name||e.name?e.$$name||e.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 +1 @@
|
|
|
1
|
-
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./helpers/filters.cjs`),n=require(`./helpers/options.cjs`),r=require(`./helpers/create-plugin.cjs`),i=require(`./helpers/module-helpers.cjs`);require(`./helpers/index.cjs`);let a=require(
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./helpers/filters.cjs`),n=require(`./helpers/options.cjs`),r=require(`./helpers/create-plugin.cjs`),i=require(`./helpers/module-helpers.cjs`);require(`./helpers/index.cjs`);let a=require(`defu`);a=e.__toESM(a);let o=require(`@babel/core`),s=require(`@storm-software/config-tools/types`),c=require(`@stryke/path/file-path-fns`),l=require(`@stryke/path/is-parent-path`),u=require(`@stryke/type-checks/is-set-object`);const d=(e={})=>({name:`babel`,config(){if((0,u.isSetObject)(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=(0,a.default)(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(r,i){if((0,l.isParentPath)(i,this.powerlinesPath)||r.includes(`/* @storm-ignore */`)||r.includes(`/* @storm-disable */`))return this.log(s.LogLevelLabel.TRACE,`Skipping Babel transformation for: ${i}`),{code:r,id:i};this.log(s.LogLevelLabel.TRACE,`Babel transforming file: ${i}`);let u=this.config.transform.babel.plugins.map(e=>n.resolveBabelPlugin(this,r,i,e)).filter((e,n,r)=>e&&!t.isDuplicatePlugin(r,e)),d=this.config.transform.babel.presets.map(e=>n.resolveBabelPlugin(this,r,i,e)).filter((e,n,r)=>e&&!t.isDuplicatePlugin(r,e));if(Array.isArray(u)&&u.length===0&&Array.isArray(d)&&d.length===0)return{code:r,id:i};[`ts`,`cts`,`mts`,`tsx`].includes((0,c.findFileExtensionSafe)(i))&&!t.isDuplicatePlugin(u,`@babel/plugin-syntax-typescript`)&&!t.isDuplicatePlugin(d,`@babel/preset-typescript`)&&u.unshift([`@babel/plugin-syntax-typescript`,{isTSX:(0,c.findFileExtension)(i)===`.tsx`}]);let f=await(0,o.transformAsync)(r,{highlightCode:!0,code:!0,ast:!1,cloneInputAst:!1,comments:!0,sourceType:`module`,configFile:!1,babelrc:!1,envName:this.config.mode,caller:{name:this.config.framework},...this.config.transform.babel??{},filename:i,plugins:u.map(t=>Array.isArray(t)&&t.length>=2?[t[0],(0,a.default)(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:d.map(t=>Array.isArray(t)&&t.length>=2?[t[0],(0,a.default)(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean)});if(!f?.code)throw Error(`Powerlines - Babel plugin failed to compile ${i}`);return{code:f.code,id:i}}});var f=d;exports.default=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getPluginName as e,isDuplicatePlugin as t}from"./helpers/filters.mjs";import{resolveBabelPlugin as n,resolvePluginFunction as r}from"./helpers/options.mjs";import{createBabelPlugin as i}from"./helpers/create-plugin.mjs";import{addImport as a,addImportsToProgram as o}from"./helpers/module-helpers.mjs";import"./helpers/index.mjs";import
|
|
1
|
+
import{getPluginName as e,isDuplicatePlugin as t}from"./helpers/filters.mjs";import{resolveBabelPlugin as n,resolvePluginFunction as r}from"./helpers/options.mjs";import{createBabelPlugin as i}from"./helpers/create-plugin.mjs";import{addImport as a,addImportsToProgram as o}from"./helpers/module-helpers.mjs";import"./helpers/index.mjs";import s from"defu";import{transformAsync as c}from"@babel/core";import{LogLevelLabel as l}from"@storm-software/config-tools/types";import{findFileExtension as u,findFileExtensionSafe as d}from"@stryke/path/file-path-fns";import{isParentPath as f}from"@stryke/path/is-parent-path";import{isSetObject as p}from"@stryke/type-checks/is-set-object";var m=(e={})=>({name:`babel`,config(){if(p(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=s(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(r,i){if(f(i,this.powerlinesPath)||r.includes(`/* @storm-ignore */`)||r.includes(`/* @storm-disable */`))return this.log(l.TRACE,`Skipping Babel transformation for: ${i}`),{code:r,id:i};this.log(l.TRACE,`Babel transforming file: ${i}`);let a=this.config.transform.babel.plugins.map(e=>n(this,r,i,e)).filter((e,n,r)=>e&&!t(r,e)),o=this.config.transform.babel.presets.map(e=>n(this,r,i,e)).filter((e,n,r)=>e&&!t(r,e));if(Array.isArray(a)&&a.length===0&&Array.isArray(o)&&o.length===0)return{code:r,id:i};[`ts`,`cts`,`mts`,`tsx`].includes(d(i))&&!t(a,`@babel/plugin-syntax-typescript`)&&!t(o,`@babel/preset-typescript`)&&a.unshift([`@babel/plugin-syntax-typescript`,{isTSX:u(i)===`.tsx`}]);let p=await c(r,{highlightCode:!0,code:!0,ast:!1,cloneInputAst:!1,comments:!0,sourceType:`module`,configFile:!1,babelrc:!1,envName:this.config.mode,caller:{name:this.config.framework},...this.config.transform.babel??{},filename:i,plugins:a.map(t=>Array.isArray(t)&&t.length>=2?[t[0],s(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:o.map(t=>Array.isArray(t)&&t.length>=2?[t[0],s(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean)});if(!p?.code)throw Error(`Powerlines - Babel plugin failed to compile ${i}`);return{code:p.code,id:i}}});export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`./source-file-env.cjs`);let n=require(`@stryke/
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`./source-file-env.cjs`);let n=require(`@stryke/path/join-paths`),r=require(`c12`),i=require(`defu`);i=e.__toESM(i);let a=require(`@stryke/type-checks/is-set-object`),o=require(`@stryke/type-checks/is-set-string`),s=require(`@stryke/string-format/kebab-case`),c=require(`@stryke/env/load-env`);async function l(e,n,r){let a=await(0,c.loadEnv)(r,n);if(e.additionalFiles&&e.additionalFiles?.length>0){let t=await Promise.all(e.additionalFiles.map(async e=>(0,c.loadEnvFile)(e,r)));for(let e of t)a=(0,i.default)(e,a)}return t.removeEnvPrefix(a)}async function u(e,t,a,o,s,c){let[u,d]=await Promise.all([l(e,a,t),(0,r.loadConfig)({cwd:t,name:`storm`,envName:a,defaults:{NAME:s.name?.replace(`@${c.namespace}/`,``),MODE:a,ORG:c.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:(0,n.joinPaths)(o,`jiti`),moduleCache:!0}})]);return(0,i.default)(u,d.config,c)}function d(e,t){return(0,i.default)({APP_NAME:(0,s.kebabCase)(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:`${(0,s.kebabCase)(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:(0,o.isSetString)(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},(0,a.isSetObject)(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[n,r,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(0,i.default)(d(e,process.env),n,r,a)}exports.loadEnv=f,exports.loadEnvFromContext=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{removeEnvPrefix as e}from"./source-file-env.mjs";import{
|
|
1
|
+
import{removeEnvPrefix as e}from"./source-file-env.mjs";import{joinPaths as t}from"@stryke/path/join-paths";import{loadConfig as n}from"c12";import r from"defu";import{isSetObject as i}from"@stryke/type-checks/is-set-object";import{isSetString as a}from"@stryke/type-checks/is-set-string";import{kebabCase as o}from"@stryke/string-format/kebab-case";import{loadEnv as s,loadEnvFile as c}from"@stryke/env/load-env";async function l(t,n,i){let a=await s(i,n);if(t.additionalFiles&&t.additionalFiles?.length>0){let e=await Promise.all(t.additionalFiles.map(async e=>c(e,i)));for(let t of e)a=r(t,a)}return e(a)}async function u(e,i,a,o,s,c){let[u,d]=await Promise.all([l(e,a,i),n({cwd:i,name:`storm`,envName:a,defaults:{NAME:s.name?.replace(`@${c.namespace}/`,``),MODE:a,ORG:c.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:t(o,`jiti`),moduleCache:!0}})]);return r(u,d.config,c)}function d(e,t){return r({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:a(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},i(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[n,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 r(d(e,process.env),n,i,a)}export{f as loadEnv,d as loadEnvFromContext};
|
|
@@ -1 +1 @@
|
|
|
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/path/
|
|
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/path/join-paths`),a=require(`@stryke/path/is-parent-path`),o=require(`@stryke/string-format/title-case`);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{APP_NAME;APP_VERSION;BUILD_ID;BUILD_TIMESTAMP;BUILD_CHECKSUM;RELEASE_ID;RELEASE_TAG;ORGANIZATION;PLATFORM=`neutral`;MODE=`production`;ENVIRONMENT;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;ERROR_URL;DEFAULT_TIMEZONE;DEFAULT_LOCALE;CI=!1},u=class{ENCRYPTION_KEY};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,o.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,o.titleCase)(e.config.name)} project.`,types:[]}]});r.name=`Env`;let i=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,o.titleCase)(e.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Env`,i}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,o.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,o.titleCase)(e.config.name)} project.`,types:[]}]});r.name=`Secrets`;let i=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,o.titleCase)(e.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Secrets`,i}async function p(e,o,c){let l;o&&(l=(0,t.type_exports.resolveClassType)(await n.reflectType(e,{file:(0,a.isParentPath)(o,e.workspaceConfig.workspaceRoot)?o:(0,i.joinPaths)(e.workspaceConfig.workspaceRoot,o),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,o,s){let l;o&&(l=(0,t.type_exports.resolveClassType)(await n.reflectType(e,{file:(0,a.isParentPath)(o,e.workspaceConfig.workspaceRoot)?o:(0,i.joinPaths)(e.workspaceConfig.workspaceRoot,o),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 +1 @@
|
|
|
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{
|
|
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{joinPaths as o}from"@stryke/path/join-paths";import{isParentPath as s}from"@stryke/path/is-parent-path";import{titleCase as c}from"@stryke/string-format/title-case";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{APP_NAME;APP_VERSION;BUILD_ID;BUILD_TIMESTAMP;BUILD_CHECKSUM;RELEASE_ID;RELEASE_TAG;ORGANIZATION;PLATFORM=`neutral`;MODE=`production`;ENVIRONMENT;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;ERROR_URL;DEFAULT_TIMEZONE;DEFAULT_LOCALE;CI=!1},f=class{ENCRYPTION_KEY};function p(t,n={}){let r=n.superReflection??new e.ReflectionClass({kind:e.ReflectionKind.class,description:`The base environment configuration definition for the ${c(t.config.name)} project.`,classType:d,types:[],implements:[{kind:e.ReflectionKind.objectLiteral,typeName:`EnvInterface`,description:`The environment configuration interface definition for the ${c(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?`${c(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 ${c(t.config.name)} project.`,classType:f,types:[],implements:[{kind:e.ReflectionKind.objectLiteral,typeName:`SecretsInterface`,description:`The secrets configuration interface definition for the ${c(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?`${c(t.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Secrets`,i}async function h(r,a,c){let u;a&&(u=(0,e.resolveClassType)(await t(r,{file:s(a,r.workspaceConfig.workspaceRoot)?a:o(r.workspaceConfig.workspaceRoot,a),name:c},{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,c){let l;i&&(l=(0,e.resolveClassType)(await t(n,{file:s(i,n.workspaceConfig.workspaceRoot)?i:o(n.workspaceConfig.workspaceRoot,i),name:c},{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,4 +1,4 @@
|
|
|
1
|
-
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../deepkit/src/vendor/type.cjs`),n=require(`../../plugin-alloy/src/index.cjs`),r=require(`../../plugin-automd/src/index.cjs`),i=require(`../../plugin-babel/src/index.cjs`),a=require(`./helpers/reflect.cjs`),o=require(`./helpers/persistence.cjs`),s=require(`./babel/plugin.cjs`),c=require(`./helpers/source-file-env.cjs`),l=require(`./helpers/load.cjs`),u=require(`./helpers/create-reflection-resource.cjs`),d=require(`./components/env.cjs`),f=require(`./helpers/automd-generator.cjs`);require(`./babel/index.cjs`),require(`./components/index.cjs`),require(`./helpers/index.cjs`);let p=require(
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../deepkit/src/vendor/type.cjs`),n=require(`../../plugin-alloy/src/index.cjs`),r=require(`../../plugin-automd/src/index.cjs`),i=require(`../../plugin-babel/src/index.cjs`),a=require(`./helpers/reflect.cjs`),o=require(`./helpers/persistence.cjs`),s=require(`./babel/plugin.cjs`),c=require(`./helpers/source-file-env.cjs`),l=require(`./helpers/load.cjs`),u=require(`./helpers/create-reflection-resource.cjs`),d=require(`./components/env.cjs`),f=require(`./helpers/automd-generator.cjs`);require(`./babel/index.cjs`),require(`./components/index.cjs`),require(`./helpers/index.cjs`);let p=require(`react/jsx-runtime`),m=require(`@stryke/convert/to-array`),h=require(`defu`);h=e.__toESM(h);let g=require(`@storm-software/config-tools/types`),_=require(`@stryke/path/is-parent-path`),v=require(`@stryke/string-format/title-case`),y=require(`@stryke/convert/parse-type-definition`),b=require(`@stryke/env/types`),x=require(`@stryke/fs/exists`),S=require(`@stryke/fs/helpers`),C=require(`@stryke/path/join`),w=require(`@stryke/string-format/constant-case`);const T=(e={})=>[n.default(e.alloy),i.default(e.babel),{name:`env`,async config(){this.log(g.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,h.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[s.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,y.parseTypeDefinition)(t.env.types);else{this.log(g.LogLevelLabel.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await o.getEnvDefaultTypeDefinition(this);t.env.types=(0,y.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,y.parseTypeDefinition)(t.env.secrets);else{let e=await o.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,y.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,m.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,w.constantCase)(t);return e.includes(n)||e.push(n),e},[...b.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(g.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,h.default)({parsed:await l.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,x.existsSync)(o.getEnvTypeReflectionsPath(this,`env`)))this.log(g.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await o.readEnvTypeReflection(this,`env`),(0,x.existsSync)(o.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await o.readEnvReflection(this)),(0,x.existsSync)(o.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await o.readEnvTypeReflection(this,`secrets`)),(0,x.existsSync)(o.getEnvReflectionsPath(this,`secrets`))&&(this.env.used.secrets=await o.readSecretsReflection(this));else{if(this.env.types.env=await a.reflectEnv(this,this.config.env.types?.file?(0,_.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 o.writeEnvTypeReflection(this,this.env.types.env,`env`),this.env.types.secrets=await a.reflectSecrets(this,this.config.env.secrets?.file?(0,_.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 o.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.log(g.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 l.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 o.writeEnvReflection(this,this.env.used.env,`env`),this.env.types.secrets&&(await o.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 o.writeEnvReflection(this,this.env.used.secrets,`secrets`))}},async prepare(){return this.log(g.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render((0,p.jsx)(d.EnvBuiltin,{defaultConfig:this.config.env.defaultConfig}))},async docs(){this.log(g.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,C.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,x.existsSync)(e)||await(0,S.createDirectory)(e);let n=await o.readEnvTypeReflection(this,`env`),r=(0,C.joinPaths)(e,`env.md`);this.log(g.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${(0,v.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
|
|
|
@@ -7,4 +7,4 @@ Below is a list of environment variables used by the [${this.packageJson.name}](
|
|
|
7
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(`
|
|
8
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(`
|
|
9
9
|
`)}
|
|
10
|
-
`)},async buildEnd(){let e=o.getEnvReflectionsPath(this,`env`);this.log(
|
|
10
|
+
`)},async buildEnd(){let e=o.getEnvReflectionsPath(this,`env`);this.log(g.LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await o.writeEnvReflection(this,this.env.used.env,`env`)}},{name:`env:automd-generator`,config(){return{automd:(0,h.default)(e.automd??{},{generators:{env:f.env(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},r.default(e.automd)];var E=T;exports.default=E;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{type_exports as e}from"../../deepkit/src/vendor/type.mjs";import t from"../../plugin-alloy/src/index.mjs";import n from"../../plugin-automd/src/index.mjs";import r from"../../plugin-babel/src/index.mjs";import{BaseEnv as i,BaseSecrets as a,createEnvReflection as o,createSecretsReflection as s,mergeEnvReflections as c,mergeSecretsReflections as l,reflectEnv as u,reflectSecrets as d}from"./helpers/reflect.mjs";import{getEnvDefaultTypeDefinition as f,getEnvReflectionsPath as p,getEnvTypeReflectionsPath as m,getSecretsDefaultTypeDefinition as h,readEnvReflection as g,readEnvTypeReflection as _,readSecretsReflection as v,resolveRuntimeTypeFile as y,writeEnvReflection as b,writeEnvTypeReflection as x}from"./helpers/persistence.mjs";import{envBabelPlugin as S}from"./babel/plugin.mjs";import{removeEnvPrefix as C}from"./helpers/source-file-env.mjs";import{loadEnv as w,loadEnvFromContext as T}from"./helpers/load.mjs";import{createReflectionResource as E}from"./helpers/create-reflection-resource.mjs";import{EnvBuiltin as D,EnvTypeDefinition as O}from"./components/env.mjs";import{env as k}from"./helpers/automd-generator.mjs";import"./babel/index.mjs";import"./components/index.mjs";import"./helpers/index.mjs";import{
|
|
1
|
+
import{type_exports as e}from"../../deepkit/src/vendor/type.mjs";import t from"../../plugin-alloy/src/index.mjs";import n from"../../plugin-automd/src/index.mjs";import r from"../../plugin-babel/src/index.mjs";import{BaseEnv as i,BaseSecrets as a,createEnvReflection as o,createSecretsReflection as s,mergeEnvReflections as c,mergeSecretsReflections as l,reflectEnv as u,reflectSecrets as d}from"./helpers/reflect.mjs";import{getEnvDefaultTypeDefinition as f,getEnvReflectionsPath as p,getEnvTypeReflectionsPath as m,getSecretsDefaultTypeDefinition as h,readEnvReflection as g,readEnvTypeReflection as _,readSecretsReflection as v,resolveRuntimeTypeFile as y,writeEnvReflection as b,writeEnvTypeReflection as x}from"./helpers/persistence.mjs";import{envBabelPlugin as S}from"./babel/plugin.mjs";import{removeEnvPrefix as C}from"./helpers/source-file-env.mjs";import{loadEnv as w,loadEnvFromContext as T}from"./helpers/load.mjs";import{createReflectionResource as E}from"./helpers/create-reflection-resource.mjs";import{EnvBuiltin as D,EnvTypeDefinition as O}from"./components/env.mjs";import{env as k}from"./helpers/automd-generator.mjs";import"./babel/index.mjs";import"./components/index.mjs";import"./helpers/index.mjs";import{jsx as A}from"react/jsx-runtime";import{toArray as j}from"@stryke/convert/to-array";import M from"defu";import{LogLevelLabel as N}from"@storm-software/config-tools/types";import{isParentPath as P}from"@stryke/path/is-parent-path";import{titleCase as F}from"@stryke/string-format/title-case";import{parseTypeDefinition as I}from"@stryke/convert/parse-type-definition";import{ENV_PREFIXES as L}from"@stryke/env/types";import{existsSync as R}from"@stryke/fs/exists";import{createDirectory as z}from"@stryke/fs/helpers";import{joinPaths as B}from"@stryke/path/join";import{constantCase as V}from"@stryke/string-format/constant-case";var H=(i={})=>[t(i.alloy),r(i.babel),{name:`env`,async config(){this.log(N.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:M(i,{types:{},prefix:[]}),transform:{babel:{plugins:[S]}}};if(e.env.types)e.env.types=I(e.env.types);else{this.log(N.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await f(this);e.env.types=I(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=I(e.env.secrets);else{let t=await h(this);e.env.secrets=I(`${t.file}#${t.name}`)}return e.env.prefix=j(e.env.prefix??[]).reduce((e,t)=>{let n=V(t);return e.includes(n)||e.push(n),e},[...L,`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(N.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=M({parsed:await w(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&R(m(this,`env`)))this.log(N.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await _(this,`env`),R(p(this,`env`))&&(this.env.used.env=await g(this)),R(m(this,`secrets`))&&(this.env.types.secrets=await _(this,`secrets`)),R(p(this,`secrets`))&&(this.env.used.secrets=await v(this));else{if(this.env.types.env=await u(this,this.config.env.types?.file?P(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:B(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 x(this,this.env.types.env,`env`),this.env.types.secrets=await d(this,this.config.env.secrets?.file?P(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:B(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 x(this,this.env.types.secrets,`secrets`),this.log(N.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 w(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 b(this,this.env.used.env,`env`),this.env.types.secrets&&(await x(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 b(this,this.env.used.secrets,`secrets`))}},async prepare(){return this.log(N.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render(A(D,{defaultConfig:this.config.env.defaultConfig}))},async docs(){this.log(N.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let t=B(this.config.projectRoot,`docs`,`generated`);R(t)||await z(t);let n=await _(this,`env`),r=B(t,`env.md`);this.log(N.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${F(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
|
|
|
@@ -7,4 +7,4 @@ Below is a list of environment variables used by the [${this.packageJson.name}](
|
|
|
7
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(`
|
|
8
8
|
`,``)??``).trim()} | ${(0,e.stringifyType)(t.getType()).trim().replaceAll(` | `,`, or `)} | ${t.hasDefault()?String(t.getDefaultValue())?.includes(`"`)?t.getDefaultValue():`\`${t.getDefaultValue()}\``:``} | ${t.isValueRequired()?``:`✔`} |`).join(`
|
|
9
9
|
`)}
|
|
10
|
-
`)},async buildEnd(){let e=p(this,`env`);this.log(
|
|
10
|
+
`)},async buildEnd(){let e=p(this,`env`);this.log(N.TRACE,`Writing env reflection types to ${e}.`),await b(this,this.env.used.env,`env`)}},{name:`env:automd-generator`,config(){return{automd:M(i.automd??{},{generators:{env:k(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},n(i.automd)];export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/path/replace`),t=require(`@stryke/
|
|
1
|
+
require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/path/replace`),t=require(`@stryke/convert/to-array`),n=require(`@stryke/fs/is-file`),r=require(`@stryke/fs/list-files`),i=require(`@stryke/path/append`),a=require(`@stryke/path/join-paths`),o=require(`@stryke/type-checks/is-set-string`),s=require(`@stryke/type-checks/is-string`),c=require(`@stryke/convert/parse-type-definition`),l=require(`@stryke/helpers/get-unique`);require(`@stryke/hash/murmurhash`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../plugin-utils/paths.mjs";import{replacePath as e}from"@stryke/path/replace";import{
|
|
1
|
+
import"../plugin-utils/paths.mjs";import{replacePath as e}from"@stryke/path/replace";import{toArray as t}from"@stryke/convert/to-array";import"@stryke/fs/is-file";import{listFiles as n}from"@stryke/fs/list-files";import{appendPath as r}from"@stryke/path/append";import{joinPaths as i}from"@stryke/path/join-paths";import{isSetString as a}from"@stryke/type-checks/is-set-string";import{isString as o}from"@stryke/type-checks/is-string";import{parseTypeDefinition as s}from"@stryke/convert/parse-type-definition";import{getUniqueBy as c}from"@stryke/helpers/get-unique";import"@stryke/hash/murmurhash";export{};
|
|
@@ -4,9 +4,9 @@ import { StoragePort, StoragePreset } from "./fs.mjs";
|
|
|
4
4
|
import { TSConfig } from "./tsconfig.mjs";
|
|
5
5
|
import { PluginContext } from "./context.mjs";
|
|
6
6
|
import { Plugin } from "./plugin.mjs";
|
|
7
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
8
7
|
import "c12";
|
|
9
8
|
import { transformAsync } from "@babel/core";
|
|
9
|
+
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
10
10
|
import { MaybePromise } from "@stryke/types/base";
|
|
11
11
|
import { PreviewOptions } from "vite";
|
|
12
12
|
import { Format } from "@storm-software/build-tools/types";
|
|
@@ -312,6 +312,15 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
312
312
|
* @param options - Additional options for writing the builtin file
|
|
313
313
|
*/
|
|
314
314
|
emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
|
|
315
|
+
/**
|
|
316
|
+
* Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
317
|
+
*
|
|
318
|
+
* @param code - The source code of the builtin file
|
|
319
|
+
* @param id - The unique identifier of the builtin file
|
|
320
|
+
* @param path - An optional path to write the builtin file to
|
|
321
|
+
* @param options - Additional options for writing the builtin file
|
|
322
|
+
*/
|
|
323
|
+
emitBuiltinSync: (code: string, id: string, path?: string, options?: WriteOptions) => void;
|
|
315
324
|
/**
|
|
316
325
|
* Resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
317
326
|
*
|
|
@@ -320,6 +329,14 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
320
329
|
* @param options - Additional options for writing the entry file
|
|
321
330
|
*/
|
|
322
331
|
emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
|
|
332
|
+
/**
|
|
333
|
+
* Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
334
|
+
*
|
|
335
|
+
* @param code - The source code of the entry file
|
|
336
|
+
* @param path - An optional path to write the entry file to
|
|
337
|
+
* @param options - Additional options for writing the entry file
|
|
338
|
+
*/
|
|
339
|
+
emitEntrySync: (code: string, path: string, options?: EmitEntryOptions) => void;
|
|
323
340
|
/**
|
|
324
341
|
* A function to update the context fields using a new user configuration options
|
|
325
342
|
*/
|
|
@@ -314,6 +314,15 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
314
314
|
* @param options - Additional options for writing the builtin file
|
|
315
315
|
*/
|
|
316
316
|
emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
|
|
317
|
+
/**
|
|
318
|
+
* Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
319
|
+
*
|
|
320
|
+
* @param code - The source code of the builtin file
|
|
321
|
+
* @param id - The unique identifier of the builtin file
|
|
322
|
+
* @param path - An optional path to write the builtin file to
|
|
323
|
+
* @param options - Additional options for writing the builtin file
|
|
324
|
+
*/
|
|
325
|
+
emitBuiltinSync: (code: string, id: string, path?: string, options?: WriteOptions) => void;
|
|
317
326
|
/**
|
|
318
327
|
* Resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
319
328
|
*
|
|
@@ -322,6 +331,14 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
322
331
|
* @param options - Additional options for writing the entry file
|
|
323
332
|
*/
|
|
324
333
|
emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
|
|
334
|
+
/**
|
|
335
|
+
* Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
336
|
+
*
|
|
337
|
+
* @param code - The source code of the entry file
|
|
338
|
+
* @param path - An optional path to write the entry file to
|
|
339
|
+
* @param options - Additional options for writing the entry file
|
|
340
|
+
*/
|
|
341
|
+
emitEntrySync: (code: string, path: string, options?: EmitEntryOptions) => void;
|
|
325
342
|
/**
|
|
326
343
|
* A function to update the context fields using a new user configuration options
|
|
327
344
|
*/
|
|
@@ -13,6 +13,13 @@ interface StorageAdapter {
|
|
|
13
13
|
* A name identifying the storage adapter type.
|
|
14
14
|
*/
|
|
15
15
|
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* The storage preset for the adapter.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* This can be used as an alternate way to identify the type of storage being used.
|
|
21
|
+
*/
|
|
22
|
+
preset?: StoragePreset | null;
|
|
16
23
|
/**
|
|
17
24
|
* Checks if a key exists in the storage.
|
|
18
25
|
*
|
|
@@ -207,6 +214,13 @@ interface WriteOptions {
|
|
|
207
214
|
* @defaultValue false
|
|
208
215
|
*/
|
|
209
216
|
skipFormat?: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* The storage preset or adapter name for the output file.
|
|
219
|
+
*
|
|
220
|
+
* @remarks
|
|
221
|
+
* If not specified, the output mode will be determined by the provided `output.mode` value.
|
|
222
|
+
*/
|
|
223
|
+
storage?: StoragePreset | string;
|
|
210
224
|
/**
|
|
211
225
|
* Additional metadata for the file.
|
|
212
226
|
*/
|
|
@@ -217,6 +231,10 @@ interface ResolveOptions$1 extends ResolveOptions {
|
|
|
217
231
|
* If true, the module is being resolved as an entry point.
|
|
218
232
|
*/
|
|
219
233
|
isEntry?: boolean;
|
|
234
|
+
/**
|
|
235
|
+
* If true, the resolver will skip alias resolution when resolving modules.
|
|
236
|
+
*/
|
|
237
|
+
skipAlias?: boolean;
|
|
220
238
|
/**
|
|
221
239
|
* If true, the resolver will skip using the cache when resolving modules.
|
|
222
240
|
*/
|
|
@@ -449,6 +467,16 @@ interface VirtualFileSystemInterface {
|
|
|
449
467
|
* @returns The resolved module path.
|
|
450
468
|
*/
|
|
451
469
|
resolveSync: (id: string, importer?: string, options?: ResolveOptions$1) => string | undefined;
|
|
470
|
+
/**
|
|
471
|
+
* Resolves a given module ID using the configured aliases.
|
|
472
|
+
*
|
|
473
|
+
* @remarks
|
|
474
|
+
* This function can be used to map module IDs to different paths based on the alias configuration.
|
|
475
|
+
*
|
|
476
|
+
* @param id - The module ID to resolve.
|
|
477
|
+
* @returns The resolved module ID - after applying any configured aliases (this will be the same as the input ID if no aliases match).
|
|
478
|
+
*/
|
|
479
|
+
resolveAlias: (id: string) => string;
|
|
452
480
|
/**
|
|
453
481
|
* Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
|
|
454
482
|
*/
|
|
@@ -13,6 +13,13 @@ interface StorageAdapter {
|
|
|
13
13
|
* A name identifying the storage adapter type.
|
|
14
14
|
*/
|
|
15
15
|
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* The storage preset for the adapter.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* This can be used as an alternate way to identify the type of storage being used.
|
|
21
|
+
*/
|
|
22
|
+
preset?: StoragePreset | null;
|
|
16
23
|
/**
|
|
17
24
|
* Checks if a key exists in the storage.
|
|
18
25
|
*
|
|
@@ -207,6 +214,13 @@ interface WriteOptions {
|
|
|
207
214
|
* @defaultValue false
|
|
208
215
|
*/
|
|
209
216
|
skipFormat?: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* The storage preset or adapter name for the output file.
|
|
219
|
+
*
|
|
220
|
+
* @remarks
|
|
221
|
+
* If not specified, the output mode will be determined by the provided `output.mode` value.
|
|
222
|
+
*/
|
|
223
|
+
storage?: StoragePreset | string;
|
|
210
224
|
/**
|
|
211
225
|
* Additional metadata for the file.
|
|
212
226
|
*/
|
|
@@ -217,6 +231,10 @@ interface ResolveOptions$1 extends ResolveOptions {
|
|
|
217
231
|
* If true, the module is being resolved as an entry point.
|
|
218
232
|
*/
|
|
219
233
|
isEntry?: boolean;
|
|
234
|
+
/**
|
|
235
|
+
* If true, the resolver will skip alias resolution when resolving modules.
|
|
236
|
+
*/
|
|
237
|
+
skipAlias?: boolean;
|
|
220
238
|
/**
|
|
221
239
|
* If true, the resolver will skip using the cache when resolving modules.
|
|
222
240
|
*/
|
|
@@ -449,6 +467,16 @@ interface VirtualFileSystemInterface {
|
|
|
449
467
|
* @returns The resolved module path.
|
|
450
468
|
*/
|
|
451
469
|
resolveSync: (id: string, importer?: string, options?: ResolveOptions$1) => string | undefined;
|
|
470
|
+
/**
|
|
471
|
+
* Resolves a given module ID using the configured aliases.
|
|
472
|
+
*
|
|
473
|
+
* @remarks
|
|
474
|
+
* This function can be used to map module IDs to different paths based on the alias configuration.
|
|
475
|
+
*
|
|
476
|
+
* @param id - The module ID to resolve.
|
|
477
|
+
* @returns The resolved module ID - after applying any configured aliases (this will be the same as the input ID if no aliases match).
|
|
478
|
+
*/
|
|
479
|
+
resolveAlias: (id: string) => string;
|
|
452
480
|
/**
|
|
453
481
|
* Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
|
|
454
482
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-date",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.131",
|
|
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": {
|
|
@@ -128,15 +128,15 @@
|
|
|
128
128
|
"files": ["dist/**/*"],
|
|
129
129
|
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
130
130
|
"dependencies": {
|
|
131
|
-
"@powerlines/plugin-env": "^0.14.
|
|
131
|
+
"@powerlines/plugin-env": "^0.14.21",
|
|
132
132
|
"@storm-software/config-tools": "^1.188.74",
|
|
133
133
|
"@stryke/path": "^0.24.0",
|
|
134
|
-
"powerlines": "^0.36.
|
|
134
|
+
"powerlines": "^0.36.22"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
|
-
"@powerlines/nx": "^0.11.
|
|
137
|
+
"@powerlines/nx": "^0.11.48",
|
|
138
138
|
"@types/node": "^24.10.4"
|
|
139
139
|
},
|
|
140
140
|
"publishConfig": { "access": "public" },
|
|
141
|
-
"gitHead": "
|
|
141
|
+
"gitHead": "f88fe8eb30f96536b83fc9af884972d48e31e63a"
|
|
142
142
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`);var t={};e.__reExport(t,require(`@alloy-js/core`)),Object.defineProperty(exports,`vendor_exports`,{enumerable:!0,get:function(){return t}});var n=require(`@alloy-js/core`);Object.keys(n).forEach(function(e){e!==`default`&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__reExport as e}from"../../../_virtual/rolldown_runtime.mjs";export*from"@alloy-js/core";var t={};import*as n from"@alloy-js/core";e(t,n);export{t as vendor_exports};
|