@powerlines/plugin-env 0.14.8 → 0.14.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.cjs +1 -0
- package/dist/{chunk-D1UamjDs.mjs → _virtual/rolldown_runtime.mjs} +1 -1
- package/dist/babel/index.cjs +1 -0
- package/dist/babel/index.d.cts +1 -0
- package/dist/babel/index.d.mts +1 -0
- package/dist/babel/index.mjs +1 -0
- package/dist/babel/plugin.cjs +5 -0
- package/dist/babel/plugin.d.cts +8 -0
- package/dist/babel/plugin.d.mts +8 -0
- package/dist/babel/plugin.mjs +5 -0
- package/dist/components/docs.cjs +1 -1
- package/dist/components/docs.d.cts +8 -1
- package/dist/components/docs.d.mts +8 -1
- package/dist/components/docs.mjs +1 -1
- package/dist/components/env.cjs +34 -1
- package/dist/components/env.d.cts +19 -1
- package/dist/components/env.d.mts +19 -1
- package/dist/components/env.mjs +31 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.cts +2 -3
- package/dist/components/index.d.mts +2 -3
- package/dist/components/index.mjs +1 -1
- package/dist/deepkit/schemas/reflection.cjs +1 -0
- package/dist/{plugin-vBgCrEuY.d.cts → deepkit/schemas/reflection.d.cts} +1 -260
- package/dist/{plugin-D9GLc9S_.d.mts → deepkit/schemas/reflection.d.mts} +1 -261
- package/dist/deepkit/schemas/reflection.mjs +1 -0
- package/dist/deepkit/schemas/reflection2.cjs +1 -0
- package/dist/deepkit/schemas/reflection2.mjs +1 -0
- package/dist/deepkit/src/capnp.cjs +1 -0
- package/dist/deepkit/src/capnp.mjs +1 -0
- package/dist/deepkit/src/esbuild-plugin.cjs +4 -0
- package/dist/deepkit/src/esbuild-plugin.mjs +4 -0
- package/dist/deepkit/src/reflect-type.cjs +1 -0
- package/dist/deepkit/src/reflect-type.mjs +1 -0
- package/dist/deepkit/src/resolve-reflections.cjs +1 -0
- package/dist/deepkit/src/resolve-reflections.mjs +1 -0
- package/dist/deepkit/src/transformer.cjs +1 -0
- package/dist/deepkit/src/transformer.mjs +1 -0
- package/dist/deepkit/src/transpile.cjs +1 -0
- package/dist/deepkit/src/transpile.mjs +1 -0
- package/dist/deepkit/src/types.d.cts +10 -0
- package/dist/deepkit/src/types.d.mts +10 -0
- package/dist/deepkit/src/utilities.cjs +1 -0
- package/dist/deepkit/src/utilities.mjs +1 -0
- package/dist/deepkit/src/vendor/core.cjs +1 -0
- package/dist/deepkit/src/vendor/core.mjs +1 -0
- package/dist/deepkit/src/vendor/type-compiler/index.cjs +1 -0
- package/dist/deepkit/src/vendor/type-compiler/index.mjs +1 -0
- package/dist/deepkit/src/vendor/type.cjs +1 -0
- package/dist/deepkit/src/vendor/type.d.cts +7 -0
- package/dist/deepkit/src/vendor/type.d.mts +7 -0
- package/dist/deepkit/src/vendor/type.mjs +1 -0
- package/dist/helpers/automd-generator.cjs +1 -0
- package/dist/helpers/automd-generator.mjs +1 -0
- package/dist/helpers/create-reflection-resource.cjs +1 -0
- package/dist/helpers/create-reflection-resource.d.cts +15 -0
- package/dist/helpers/create-reflection-resource.d.mts +15 -0
- package/dist/helpers/create-reflection-resource.mjs +1 -0
- package/dist/helpers/index.cjs +1 -0
- package/dist/helpers/index.d.cts +6 -0
- package/dist/helpers/index.d.mts +6 -0
- package/dist/helpers/index.mjs +1 -0
- package/dist/helpers/load.cjs +1 -0
- package/dist/helpers/load.d.cts +35 -0
- package/dist/helpers/load.d.mts +35 -0
- package/dist/helpers/load.mjs +1 -0
- package/dist/helpers/persistence.cjs +1 -0
- package/dist/helpers/persistence.d.cts +84 -0
- package/dist/helpers/persistence.d.mts +84 -0
- package/dist/helpers/persistence.mjs +1 -0
- package/dist/helpers/reflect.cjs +1 -0
- package/dist/helpers/reflect.d.cts +46 -0
- package/dist/helpers/reflect.d.mts +46 -0
- package/dist/helpers/reflect.mjs +1 -0
- package/dist/helpers/source-file-env.cjs +1 -0
- package/dist/helpers/source-file-env.d.cts +8 -0
- package/dist/helpers/source-file-env.d.mts +8 -0
- package/dist/helpers/source-file-env.mjs +1 -0
- package/dist/helpers/template-helpers.cjs +1 -0
- package/dist/helpers/template-helpers.d.cts +15 -0
- package/dist/helpers/template-helpers.d.mts +15 -0
- package/dist/helpers/template-helpers.mjs +1 -0
- package/dist/index.cjs +4 -8
- package/dist/index.d.cts +13 -184
- package/dist/index.d.mts +15 -184
- package/dist/index.mjs +4 -8
- package/dist/plugin-alloy/src/core/components/index.cjs +1 -0
- package/dist/plugin-alloy/src/core/components/index.mjs +1 -0
- package/dist/plugin-alloy/src/core/components/output.cjs +1 -0
- package/dist/plugin-alloy/src/core/components/output.mjs +1 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +1 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +1 -0
- package/dist/plugin-alloy/src/core/components/source-file.cjs +1 -0
- package/dist/plugin-alloy/src/core/components/source-file.mjs +1 -0
- package/dist/plugin-alloy/src/core/contexts/context.cjs +1 -0
- package/dist/plugin-alloy/src/core/contexts/context.mjs +1 -0
- package/dist/plugin-alloy/src/core/contexts/index.cjs +1 -0
- package/dist/plugin-alloy/src/core/contexts/index.mjs +1 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +1 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +1 -0
- package/dist/plugin-alloy/src/core/index.cjs +1 -0
- package/dist/plugin-alloy/src/core/index.mjs +1 -0
- package/dist/plugin-alloy/src/helpers/capnp.cjs +1 -0
- package/dist/plugin-alloy/src/helpers/capnp.mjs +1 -0
- package/dist/plugin-alloy/src/helpers/create-builtin.cjs +1 -0
- package/dist/plugin-alloy/src/helpers/create-builtin.mjs +1 -0
- package/dist/plugin-alloy/src/helpers/index.cjs +1 -0
- package/dist/plugin-alloy/src/helpers/index.mjs +1 -0
- package/dist/plugin-alloy/src/helpers/refkey.cjs +1 -0
- package/dist/plugin-alloy/src/helpers/refkey.mjs +1 -0
- package/dist/plugin-alloy/src/helpers/typescript.cjs +1 -0
- package/dist/plugin-alloy/src/helpers/typescript.mjs +1 -0
- package/dist/plugin-alloy/src/index.cjs +2 -0
- package/dist/plugin-alloy/src/index.mjs +2 -0
- package/dist/plugin-alloy/src/markdown/components/index.cjs +1 -0
- package/dist/plugin-alloy/src/markdown/components/index.mjs +1 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +1 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +1 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +1 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +1 -0
- package/dist/plugin-alloy/src/markdown/contexts/index.cjs +1 -0
- package/dist/plugin-alloy/src/markdown/contexts/index.mjs +1 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +1 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +1 -0
- package/dist/plugin-alloy/src/markdown/index.cjs +1 -0
- package/dist/plugin-alloy/src/markdown/index.mjs +1 -0
- package/dist/plugin-alloy/src/types/components.d.mts +5 -0
- package/dist/plugin-alloy/src/types/index.d.mts +2 -0
- package/dist/plugin-alloy/src/types/plugin.d.cts +38 -0
- package/dist/plugin-alloy/src/types/plugin.d.mts +38 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/dynamic-import-statement.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/dynamic-import-statement.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/entry-file.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/entry-file.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/index.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/index.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/record-expression.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/record-expression.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/index.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/index.mjs +1 -0
- 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/helpers/ast-utils.cjs +1 -0
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +1 -0
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +1 -0
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +1 -0
- package/dist/plugin-babel/src/helpers/filters.cjs +1 -0
- package/dist/plugin-babel/src/helpers/filters.mjs +1 -0
- package/dist/plugin-babel/src/helpers/index.cjs +1 -0
- package/dist/plugin-babel/src/helpers/index.mjs +1 -0
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +1 -0
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +1 -0
- package/dist/plugin-babel/src/helpers/options.cjs +1 -0
- package/dist/plugin-babel/src/helpers/options.mjs +1 -0
- package/dist/plugin-babel/src/index.cjs +1 -0
- package/dist/plugin-babel/src/index.mjs +1 -0
- package/dist/plugin-babel/src/types/index.d.mts +1 -0
- package/dist/plugin-babel/src/types/plugin.d.cts +15 -0
- package/dist/plugin-babel/src/types/plugin.d.mts +15 -0
- package/dist/powerlines/src/lib/build/esbuild.cjs +14 -0
- package/dist/powerlines/src/lib/build/esbuild.mjs +14 -0
- package/dist/powerlines/src/lib/entry.cjs +1 -0
- package/dist/powerlines/src/lib/entry.mjs +1 -0
- package/dist/powerlines/src/lib/logger.cjs +1 -0
- package/dist/powerlines/src/lib/logger.mjs +1 -0
- package/dist/powerlines/src/lib/utilities/bundle.cjs +1 -0
- package/dist/powerlines/src/lib/utilities/bundle.mjs +1 -0
- package/dist/powerlines/src/lib/utilities/file-header.cjs +1 -0
- package/dist/powerlines/src/lib/utilities/file-header.mjs +1 -0
- package/dist/powerlines/src/lib/utilities/resolve.cjs +1 -0
- package/dist/powerlines/src/lib/utilities/resolve.mjs +1 -0
- package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
- package/dist/powerlines/src/plugin-utils/paths.mjs +1 -0
- package/dist/powerlines/src/types/babel.d.cts +22 -0
- package/dist/powerlines/src/types/babel.d.mts +22 -0
- package/dist/powerlines/src/types/build.d.cts +145 -0
- package/dist/powerlines/src/types/build.d.mts +147 -0
- package/dist/powerlines/src/types/commands.d.cts +8 -0
- package/dist/powerlines/src/types/commands.d.mts +9 -0
- package/dist/powerlines/src/types/config.d.cts +368 -0
- package/dist/powerlines/src/types/config.d.mts +369 -0
- package/dist/powerlines/src/types/context.d.cts +373 -0
- package/dist/powerlines/src/types/context.d.mts +375 -0
- package/dist/powerlines/src/types/fs.d.cts +458 -0
- package/dist/powerlines/src/types/fs.d.mts +458 -0
- package/dist/powerlines/src/types/hooks.d.mts +2 -0
- package/dist/powerlines/src/types/plugin.d.cts +231 -0
- package/dist/powerlines/src/types/plugin.d.mts +231 -0
- package/dist/powerlines/src/types/resolved.d.cts +82 -0
- package/dist/powerlines/src/types/resolved.d.mts +83 -0
- package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
- package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
- package/dist/types/index.cjs +0 -1
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.mts +2 -3
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +156 -2
- package/dist/types/plugin.d.mts +158 -2
- package/dist/types/plugin.mjs +1 -1
- package/dist/types/runtime.cjs +0 -1
- package/dist/types/runtime.d.cts +793 -1
- package/dist/types/runtime.d.mts +793 -1
- package/dist/types/runtime.mjs +1 -1
- package/package.json +13 -20
- package/dist/components-ByVHjWXF.mjs +0 -1
- package/dist/components-C9bYrQVK.cjs +0 -0
- package/dist/create-reflection-resource-B9d8LEWF.mjs +0 -17
- package/dist/create-reflection-resource-BEDScc6f.cjs +0 -17
- package/dist/docs--ddXDQBx.cjs +0 -1
- package/dist/docs-CKCRAUnO.d.mts +0 -9
- package/dist/docs-CdtUw4WA.d.cts +0 -9
- package/dist/docs-DwPacakH.mjs +0 -1
- package/dist/env-COWzTupf.d.cts +0 -20
- package/dist/env-CdR46Bis.mjs +0 -31
- package/dist/env-DqPOEUEu.d.mts +0 -20
- package/dist/env-k_8Sz-kF.cjs +0 -34
- package/dist/index-B_e8BwCm.d.cts +0 -1
- package/dist/index-CW2WHUXP.d.mts +0 -1
- package/dist/index-DCQ5Y2ED.d.mts +0 -1
- package/dist/index-DWPDThxu.d.cts +0 -1
- package/dist/plugin-CyRU_Pln.mjs +0 -1
- package/dist/plugin-D5qyQPqC.cjs +0 -0
- package/dist/runtime-Bisl_1Ja.cjs +0 -0
- package/dist/runtime-CRLPiOqf.d.mts +0 -2499
- package/dist/runtime-g_eXGBBi.mjs +0 -1
- package/dist/runtime-rhT2IfSg.d.cts +0 -2497
- package/dist/types-DMh7K7VC.mjs +0 -1
- package/dist/types-MYBaygjr.cjs +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../core/contexts/context.mjs";import"../../../../deepkit/src/utilities.mjs";import{createComponent as e,createIntrinsic as t,memo as n,mergeProps as r}from"@alloy-js/core/jsx-runtime";import{For as i,Show as a,splitProps as o}from"@alloy-js/core";import{isSetString as s}from"@stryke/type-checks/is-set-string";import{isUndefined as c}from"@stryke/type-checks/is-undefined";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../core/contexts/context.cjs`),require(`../../core/components/single-line-comment.cjs`),require(`../../core/components/source-file.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`),n=require(`@stryke/path/append`),r=require(`@stryke/type-checks/is-string`),i=require(`@stryke/string-format/title-case`),a=require(`@alloy-js/typescript`);require(`@stryke/type-checks/is-boolean`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../core/contexts/context.mjs";import"../../core/components/single-line-comment.mjs";import"../../core/components/source-file.mjs";import{createComponent as e,createIntrinsic as t,memo as n,mergeProps as r}from"@alloy-js/core/jsx-runtime";import{Show as i,code as a,splitProps as o}from"@alloy-js/core";import{appendPath as s}from"@stryke/path/append";import{isString as c}from"@stryke/type-checks/is-string";import{titleCase as l}from"@stryke/string-format/title-case";import"@alloy-js/typescript";import"@stryke/type-checks/is-boolean";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../../../deepkit/src/vendor/type.cjs`),require(`../../core/contexts/reflection.cjs`),require(`./tsdoc-reflection.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`),n=require(`@stryke/type-checks/is-string`);require(`@stryke/string-format/pascal-case`);let r=require(`@alloy-js/typescript`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../../../deepkit/src/vendor/type.mjs";import"../../core/contexts/reflection.mjs";import"./tsdoc-reflection.mjs";import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{For as n,computed as r,splitProps as i}from"@alloy-js/core";import{isString as a}from"@stryke/type-checks/is-string";import"@stryke/string-format/pascal-case";import"@alloy-js/typescript";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../core/contexts/reflection.cjs`),require(`../../../../deepkit/src/utilities.cjs`),require(`./tsdoc-reflection.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`),n=require(`@stryke/type-checks/is-string`),r=require(`@stryke/type-checks/is-undefined`),i=require(`@stryke/string-format/camel-case`);require(`@stryke/string-format/pascal-case`);let a=require(`@alloy-js/typescript`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../core/contexts/reflection.mjs";import"../../../../deepkit/src/utilities.mjs";import"./tsdoc-reflection.mjs";import{createComponent as e,createIntrinsic as t,memo as n}from"@alloy-js/core/jsx-runtime";import{For as r,Show as i,computed as a,splitProps as o}from"@alloy-js/core";import{isString as s}from"@stryke/type-checks/is-string";import{isUndefined as c}from"@stryke/type-checks/is-undefined";import{camelCase as l}from"@stryke/string-format/camel-case";import"@stryke/string-format/pascal-case";import"@alloy-js/typescript";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./components/index.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./components/index.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/path/replace`),n=require(`@stryke/path/append`),r=require(`defu`);r=e.__toESM(r);let i=require(`@stryke/convert/to-array`),a=require(`@stryke/path/join-paths`),o=require(`@stryke/fs/is-file`),s=require(`@stryke/fs/list-files`),c=require(`@stryke/path/is-type`),l=require(`automd`),u=require(`c12`),d=require(`markdown-toc`);d=e.__toESM(d);const f=(e={})=>({name:`automd`,async config(){let t=await(0,l.loadConfig)((0,a.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot),e);return(!t.prefix||!Array.isArray(t.prefix))&&(t.prefix=(0,i.toArray)(t.prefix??[])),t.prefix.includes(`automd`)||t.prefix.push(`automd`),t.prefix.includes(`powerlines`)||t.prefix.push(`powerlines`),{automd:(0,r.default)(t??{},{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,u.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,r.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,s.listFiles)((0,c.isAbsolutePath)(e)?e:(0,n.appendPath)(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):(0,c.isAbsolutePath)(e)?e:(0,n.appendPath)(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!(0,c.isAbsolutePath)(this.config.automd.output)&&(this.config.automd.output=(0,n.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 r=await this.fs.read(e);if(r){let i=await(0,l.transform)(r,this.config.automd);if(i.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.`);i.hasChanged&&await this.fs.write((0,n.appendPath)(this.config.automd.output?(0,o.isDirectory)(this.config.automd.output)?(0,t.replacePath)(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),i.contents)}}))}});var p=f;exports.default=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{replacePath as e}from"@stryke/path/replace";import{appendPath as t}from"@stryke/path/append";import n from"defu";import{toArray as r}from"@stryke/convert/to-array";import{joinPaths as i}from"@stryke/path/join-paths";import{isDirectory as a}from"@stryke/fs/is-file";import{listFiles as o}from"@stryke/fs/list-files";import{isAbsolutePath as s}from"@stryke/path/is-type";import{loadConfig as c,resolveConfig as l,transform as u}from"automd";import{loadConfig as d}from"c12";import f from"markdown-toc";var p=(p={})=>({name:`automd`,async config(){let e=await c(i(this.workspaceConfig.workspaceRoot,this.config.projectRoot),p);return(!e.prefix||!Array.isArray(e.prefix))&&(e.prefix=r(e.prefix??[])),e.prefix.includes(`automd`)||e.prefix.push(`automd`),e.prefix.includes(`powerlines`)||e.prefix.push(`powerlines`),{automd:n(e??{},{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 d({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=l(n(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(`*`)?o(s(e)?e:t(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):s(e)?e:t(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!s(this.config.automd.output)&&(this.config.automd.output=t(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 n=>{let r=await this.fs.read(n);if(r){let i=await u(r,this.config.automd);if(i.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${n}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);i.hasChanged&&await this.fs.write(t(this.config.automd.output?a(this.config.automd.output)?e(n,this.config.automd.output):this.config.automd.output:n,this.config.projectRoot),i.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/context.mjs";
|
|
2
|
+
import "../../../powerlines/src/types/config.mjs";
|
|
3
|
+
import "../../../powerlines/src/types/resolved.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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@babel/generator`);t=e.__toESM(t),require(`@babel/parser`);let n=t.default;`default`in n&&(n=n.default);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/generator";import"@babel/parser";let t=e;`default`in t&&(t=t.default);export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../powerlines/src/lib/logger.cjs`);let n=require(`@storm-software/config-tools/types`),r=require(`chalk`);r=e.__toESM(r);let i=require(`@babel/helper-plugin-utils`);function a(e,a){let o=o=>(0,i.declare)((i,s,c)=>{i.cache.using(()=>o.meta.checksum),i.assertVersion(`^7.0.0-0`);let l=t.extendLog(o.log,e);l(n.LogLevelLabel.TRACE,`Initializing the ${r.default.bold.cyanBright(e)} Babel plugin`);let u=a({log:l,name:e,api:i,options:s,context:o,dirname:c});return u.name=e,l(n.LogLevelLabel.TRACE,`Completed initialization of the ${r.default.bold.cyanBright(e)} Babel plugin`),u});return o.$$name=e,o}exports.createBabelPlugin=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{extendLog as e}from"../../../powerlines/src/lib/logger.mjs";import{LogLevelLabel as t}from"@storm-software/config-tools/types";import n from"chalk";import{declare as r}from"@babel/helper-plugin-utils";function i(i,a){let o=o=>r((r,s,c)=>{r.cache.using(()=>o.meta.checksum),r.assertVersion(`^7.0.0-0`);let l=e(o.log,i);l(t.TRACE,`Initializing the ${n.bold.cyanBright(i)} Babel plugin`);let u=a({log:l,name:i,api:r,options:s,context:o,dirname:c});return u.name=i,l(t.TRACE,`Completed initialization of the ${n.bold.cyanBright(i)} Babel plugin`),u});return o.$$name=i,o}export{i as createBabelPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/type-checks/is-function`);require(`@stryke/type-checks/is-object`);function r(e){return(0,t.isSetString)(e)?e:Array.isArray(e)&&e.length>0?r(e[0]):e.$$name||e.name?e.$$name||e.name:void 0}function i(e,t){return!!(r(t)&&e.some(e=>Array.isArray(e)&&r(e[0])===r(t)))}exports.getPluginName=r,exports.isDuplicatePlugin=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isSetString as e}from"@stryke/type-checks/is-set-string";import{isFunction as t}from"@stryke/type-checks/is-function";import"@stryke/type-checks/is-object";function n(t){return e(t)?t:Array.isArray(t)&&t.length>0?n(t[0]):t.$$name||t.name?t.$$name||t.name:void 0}function r(e,t){return!!(n(t)&&e.some(e=>Array.isArray(e)&&n(e[0])===n(t)))}export{n as getPluginName,r as isDuplicatePlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./filters.cjs`),t=require(`./options.cjs`);require(`./ast-utils.cjs`);const n=require(`./create-plugin.cjs`),r=require(`./module-helpers.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getPluginName as e,isDuplicatePlugin as t}from"./filters.mjs";import{resolveBabelPlugin as n,resolvePluginFunction as r}from"./options.mjs";import"./ast-utils.mjs";import{createBabelPlugin as i}from"./create-plugin.mjs";import{addImport as a,addImportsToProgram as o}from"./module-helpers.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`);require(`./ast-utils.cjs`);let t=require(`@stryke/type-checks/is-string`),n=require(`@babel/types`);n=e.__toESM(n);function r(e,t){o(e.scope.getProgramParent().path,t)}function i(e){return e.get(`specifiers`).filter(Boolean).every(e=>e?.isImportSpecifier())&&e.node.importKind!==`type`&&e.node.importKind!==`typeof`}function a(e){let t=new Map;return e.traverse({ImportDeclaration(e){i(e)&&t.set(e.node.source.value,e)}}),t}function o(e,t){a(e).get(t.module)||e.unshiftContainer(`body`,n.importDeclaration([n.importSpecifier(n.identifier(t.name||t.imported),n.identifier(t.imported))],n.stringLiteral(t.module)))}exports.addImport=r,exports.addImportsToProgram=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./ast-utils.mjs";import{isString as e}from"@stryke/type-checks/is-string";import*as t from"@babel/types";function n(e,t){a(e.scope.getProgramParent().path,t)}function r(e){return e.get(`specifiers`).filter(Boolean).every(e=>e?.isImportSpecifier())&&e.node.importKind!==`type`&&e.node.importKind!==`typeof`}function i(e){let t=new Map;return e.traverse({ImportDeclaration(e){r(e)&&t.set(e.node.source.value,e)}}),t}function a(e,n){i(e).get(n.module)||e.unshiftContainer(`body`,t.importDeclaration([t.importSpecifier(t.identifier(n.name||n.imported),t.identifier(n.imported))],t.stringLiteral(n.module)))}export{n as addImport,a as addImportsToProgram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`./filters.cjs`);let n=require(`@storm-software/config-tools/types`),r=require(`@stryke/type-checks/is-function`),i=require(`chalk`);i=e.__toESM(i);function a(e,t){try{return Array.isArray(t)&&t.length>0&&t[0]?(0,r.isFunction)(t[0])?t[0](e):t[0]:(0,r.isFunction)(t)?t(e):t}catch{return t[0]}}function o(e,o,s,c){if(Array.isArray(c)&&c.length>0&&c[0]){if(c.length>2&&c[2]&&(0,r.isFunction)(c[2])&&!c[2](o,s)){e.log(n.LogLevelLabel.TRACE,`Skipping filtered Babel plugin ${i.default.bold.cyanBright(t.getPluginName(c)||`unnamed`)} for ${s}`);return}return c.length>2?[a(e,c),c[1],c[2]]:[a(e,c),c[1],null]}return[a(e,c),{},null]}exports.resolveBabelPlugin=o,exports.resolvePluginFunction=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getPluginName as e}from"./filters.mjs";import{LogLevelLabel as t}from"@storm-software/config-tools/types";import{isFunction as n}from"@stryke/type-checks/is-function";import r from"chalk";function i(e,t){try{return Array.isArray(t)&&t.length>0&&t[0]?n(t[0])?t[0](e):t[0]:n(t)?t(e):t}catch{return t[0]}}function a(a,o,s,c){if(Array.isArray(c)&&c.length>0&&c[0]){if(c.length>2&&c[2]&&n(c[2])&&!c[2](o,s)){a.log(t.TRACE,`Skipping filtered Babel plugin ${r.bold.cyanBright(e(c)||`unnamed`)} for ${s}`);return}return c.length>2?[i(a,c),c[1],c[2]]:[i(a,c),c[1],null]}return[i(a,c),{},null]}export{a as resolveBabelPlugin,i as resolvePluginFunction};
|
|
@@ -0,0 +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(`@storm-software/config-tools/types`),o=require(`@stryke/path/is-parent-path`),s=require(`defu`);s=e.__toESM(s);let c=require(`@babel/core`),l=require(`@stryke/path/file-path-fns`),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,s.default)(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(r,i){if((0,o.isParentPath)(i,this.powerlinesPath)||r.includes(`/* @storm-ignore */`)||r.includes(`/* @storm-disable */`))return this.log(a.LogLevelLabel.TRACE,`Skipping Babel transformation for: ${i}`),{code:r,id:i};this.log(a.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,l.findFileExtensionSafe)(i))&&!t.isDuplicatePlugin(u,`@babel/plugin-syntax-typescript`)&&!t.isDuplicatePlugin(d,`@babel/preset-typescript`)&&u.unshift([`@babel/plugin-syntax-typescript`,{isTSX:(0,l.findFileExtension)(i)===`.tsx`}]);let f=await(0,c.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,s.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,s.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;
|
|
@@ -0,0 +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{LogLevelLabel as s}from"@storm-software/config-tools/types";import{isParentPath as c}from"@stryke/path/is-parent-path";import l from"defu";import{transformAsync as u}from"@babel/core";import{findFileExtension as d,findFileExtensionSafe as f}from"@stryke/path/file-path-fns";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=l(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(r,i){if(c(i,this.powerlinesPath)||r.includes(`/* @storm-ignore */`)||r.includes(`/* @storm-disable */`))return this.log(s.TRACE,`Skipping Babel transformation for: ${i}`),{code:r,id:i};this.log(s.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(f(i))&&!t(a,`@babel/plugin-syntax-typescript`)&&!t(o,`@babel/preset-typescript`)&&a.unshift([`@babel/plugin-syntax-typescript`,{isTSX:d(i)===`.tsx`}]);let p=await u(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],l(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:o.map(t=>Array.isArray(t)&&t.length>=2?[t[0],l(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "./plugin.mjs";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PluginContext } from "../../../powerlines/src/types/context.cjs";
|
|
2
|
+
import { BabelUserConfig, UserConfig } from "../../../powerlines/src/types/config.cjs";
|
|
3
|
+
import { BabelResolvedConfig, ResolvedConfig } from "../../../powerlines/src/types/resolved.cjs";
|
|
4
|
+
|
|
5
|
+
//#region ../plugin-babel/src/types/plugin.d.ts
|
|
6
|
+
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
7
|
+
type BabelPluginUserConfig = UserConfig;
|
|
8
|
+
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
9
|
+
transform: {
|
|
10
|
+
babel: BabelResolvedConfig;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PluginContext } from "../../../powerlines/src/types/context.mjs";
|
|
2
|
+
import { BabelUserConfig, UserConfig } from "../../../powerlines/src/types/config.mjs";
|
|
3
|
+
import { BabelResolvedConfig, ResolvedConfig } from "../../../powerlines/src/types/resolved.mjs";
|
|
4
|
+
|
|
5
|
+
//#region ../plugin-babel/src/types/plugin.d.ts
|
|
6
|
+
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
7
|
+
type BabelPluginUserConfig = UserConfig;
|
|
8
|
+
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
9
|
+
transform: {
|
|
10
|
+
babel: BabelResolvedConfig;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`);require(`../entry.cjs`);let t=require(`@stryke/path/replace`),n=require(`defu`);n=e.__toESM(n);let r=require(`@stryke/type-checks/is-string`),i=require(`@stryke/string-format/camel-case`),a=require(`@stryke/path/join-paths`),o=require(`@stryke/helpers/omit`);const s={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function c(e){let t=e.config.build.override.inject??e.config.build.inject;return t&&Object.keys(t).length>0&&e.fs.writeSync((0,a.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`),Object.entries(t).map(([e,t])=>{if(t)if(Array.isArray(t)){if((0,i.camelCase)(e)!==e){if(t.length===1)return`
|
|
2
|
+
import ${(0,i.camelCase)(e)} from "${t[0]}";
|
|
3
|
+
export { ${(0,i.camelCase)(e)} as "${e}" }`;if(t.length>1)return`
|
|
4
|
+
import ${t[1]===`*`?`* as ${(0,i.camelCase)(e)}`:`{ ${t[1]} as ${(0,i.camelCase)(e)} }`} from "${t[0]}";
|
|
5
|
+
export { ${(0,i.camelCase)(e)} as "${e}" }`}else if(t.length===1)return`
|
|
6
|
+
import ${e} from "${t[0]}";
|
|
7
|
+
export { ${e} };`;else if(t.length>1)return`
|
|
8
|
+
import ${t[1]===`*`?`* as ${e}`:`{ ${t[1]} as ${e} }`} from "${t[0]}";
|
|
9
|
+
export { ${e} };`}else if((0,i.camelCase)(e)!==e)return`
|
|
10
|
+
import ${(0,i.camelCase)(e)} from "${t[0]}";
|
|
11
|
+
export { ${(0,i.camelCase)(e)} as "${e}" }`;else return`
|
|
12
|
+
import ${e} from "${t}";
|
|
13
|
+
export { ${e} };`;return``}).join(`
|
|
14
|
+
`)),(0,n.default)({alias:e.builtins.reduce((t,n)=>{if(!t[n]){let r=e.fs.ids[n];r&&(t[n]=r)}return t},e.config.build.alias?Array.isArray(e.config.build.alias)?e.config.build.alias.reduce((e,t)=>(e[t.find.toString()]||(e[t.find.toString()]=t.replacement),e),{}):e.config.build.alias:{}),inject:t&&Object.keys(t).length>0?[(0,a.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`)]:void 0},e.config.build.variant===`esbuild`?(0,o.omit)(e.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},e.config.build.variant===`esbuild`?(0,o.omit)(e.config.build,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`,`variant`,`override`]):{},{mainFields:e.config.build.mainFields,conditions:e.config.build.conditions,define:e.config.build.define,resolveExtensions:e.config.build.extensions,packages:e.config.build.skipNodeModulesBundle?`external`:e.config.build.variant===`esbuild`?e.config.build.packages:void 0,format:Array.isArray(e.config.output.format)?e.config.output.format[0]:e.config.output.format,platform:e.config.build.platform,treeShaking:!!e.config.build?.treeshake||e.config.build?.treeShaking,outdir:e.config.output.buildPath,tsconfig:e.tsconfig.tsconfigFilePath,minify:e.config.mode!==`development`,metafile:e.config.mode===`development`,sourcemap:e.config.mode===`development`},s)}exports.extractESBuildConfig=c;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import"../entry.mjs";import{replacePath as e}from"@stryke/path/replace";import t from"defu";import{isString as n}from"@stryke/type-checks/is-string";import{camelCase as r}from"@stryke/string-format/camel-case";import{joinPaths as i}from"@stryke/path/join-paths";import{omit as a}from"@stryke/helpers/omit";const o={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function s(e){let n=e.config.build.override.inject??e.config.build.inject;return n&&Object.keys(n).length>0&&e.fs.writeSync(i(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`),Object.entries(n).map(([e,t])=>{if(t)if(Array.isArray(t)){if(r(e)!==e){if(t.length===1)return`
|
|
2
|
+
import ${r(e)} from "${t[0]}";
|
|
3
|
+
export { ${r(e)} as "${e}" }`;if(t.length>1)return`
|
|
4
|
+
import ${t[1]===`*`?`* as ${r(e)}`:`{ ${t[1]} as ${r(e)} }`} from "${t[0]}";
|
|
5
|
+
export { ${r(e)} as "${e}" }`}else if(t.length===1)return`
|
|
6
|
+
import ${e} from "${t[0]}";
|
|
7
|
+
export { ${e} };`;else if(t.length>1)return`
|
|
8
|
+
import ${t[1]===`*`?`* as ${e}`:`{ ${t[1]} as ${e} }`} from "${t[0]}";
|
|
9
|
+
export { ${e} };`}else if(r(e)!==e)return`
|
|
10
|
+
import ${r(e)} from "${t[0]}";
|
|
11
|
+
export { ${r(e)} as "${e}" }`;else return`
|
|
12
|
+
import ${e} from "${t}";
|
|
13
|
+
export { ${e} };`;return``}).join(`
|
|
14
|
+
`)),t({alias:e.builtins.reduce((t,n)=>{if(!t[n]){let r=e.fs.ids[n];r&&(t[n]=r)}return t},e.config.build.alias?Array.isArray(e.config.build.alias)?e.config.build.alias.reduce((e,t)=>(e[t.find.toString()]||(e[t.find.toString()]=t.replacement),e),{}):e.config.build.alias:{}),inject:n&&Object.keys(n).length>0?[i(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`)]:void 0},e.config.build.variant===`esbuild`?a(e.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},e.config.build.variant===`esbuild`?a(e.config.build,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`,`variant`,`override`]):{},{mainFields:e.config.build.mainFields,conditions:e.config.build.conditions,define:e.config.build.define,resolveExtensions:e.config.build.extensions,packages:e.config.build.skipNodeModulesBundle?`external`:e.config.build.variant===`esbuild`?e.config.build.packages:void 0,format:Array.isArray(e.config.output.format)?e.config.output.format[0]:e.config.output.format,platform:e.config.build.platform,treeShaking:!!e.config.build?.treeshake||e.config.build?.treeShaking,outdir:e.config.output.buildPath,tsconfig:e.tsconfig.tsconfigFilePath,minify:e.config.mode!==`development`,metafile:e.config.mode===`development`,sourcemap:e.config.mode===`development`},o)}export{s as extractESBuildConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/path/replace`),t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/path/append`),r=require(`@stryke/helpers/get-unique`),i=require(`@stryke/type-checks/is-string`),a=require(`@stryke/convert/to-array`),o=require(`@stryke/path/join-paths`),s=require(`@stryke/fs/is-file`),c=require(`@stryke/fs/list-files`),l=require(`@stryke/convert/parse-type-definition`);require(`@stryke/hash/murmurhash`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../plugin-utils/paths.mjs";import{replacePath as e}from"@stryke/path/replace";import{isSetString as t}from"@stryke/type-checks/is-set-string";import{appendPath as n}from"@stryke/path/append";import{getUniqueBy as r}from"@stryke/helpers/get-unique";import{isString as i}from"@stryke/type-checks/is-string";import{toArray as a}from"@stryke/convert/to-array";import{joinPaths as o}from"@stryke/path/join-paths";import"@stryke/fs/is-file";import{listFiles as s}from"@stryke/fs/list-files";import{parseTypeDefinition as c}from"@stryke/convert/parse-type-definition";import"@stryke/hash/murmurhash";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@storm-software/config-tools/types`),n=require(`@stryke/string-format/title-case`),r=require(`chalk`);r=e.__toESM(r),require(`@storm-software/config-tools/logger`),require(`@storm-software/config-tools/utilities/colors`),require(`@stryke/helpers/noop`);let i=require(`@stryke/string-format/kebab-case`);const a=[`#00A0DD`,`#6FCE4E`,`#FBBF24`,`#F43F5E`,`#3B82F6`,`#A855F7`,`#469592`,`#288EDF`,`#D8B4FE`,`#10B981`,`#EF4444`,`#F0EC56`,`#F472B6`,`#22D3EE`,`#EAB308`,`#84CC16`,`#F87171`,`#0EA5E9`,`#D946EF`,`#FACC15`,`#34D399`,`#8B5CF6`],o=(e,t)=>(i,...o)=>e(i,` ${r.default.inverse.hex(a[t.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,0)%a.length]||a[0])(` ${(0,n.titleCase)(t)} `)} ${o.join(` `)} `);exports.extendLog=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{LogLevelLabel as e}from"@storm-software/config-tools/types";import{titleCase as t}from"@stryke/string-format/title-case";import n from"chalk";import"@storm-software/config-tools/logger";import"@storm-software/config-tools/utilities/colors";import"@stryke/helpers/noop";import{kebabCase as r}from"@stryke/string-format/kebab-case";const i=[`#00A0DD`,`#6FCE4E`,`#FBBF24`,`#F43F5E`,`#3B82F6`,`#A855F7`,`#469592`,`#288EDF`,`#D8B4FE`,`#10B981`,`#EF4444`,`#F0EC56`,`#F472B6`,`#22D3EE`,`#EAB308`,`#84CC16`,`#F87171`,`#0EA5E9`,`#D946EF`,`#FACC15`,`#34D399`,`#8B5CF6`],a=(e,r)=>(a,...o)=>e(a,` ${n.inverse.hex(i[r.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,0)%i.length]||i[0])(` ${t(r)} `)} ${o.join(` `)} `);export{a as extendLog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../build/esbuild.cjs`);let n=require(`@storm-software/config-tools/types`),r=require(`esbuild`);async function i(e,i,a={}){let o=await e.fs.resolve(i);if(!o||!e.fs.existsSync(o))throw Error(`Module not found: "${i}". Please check the path and try again.`);let s=await(0,r.build)({...t.extractESBuildConfig(e),entryPoints:[o],write:!1,sourcemap:!1,splitting:!1,treeShaking:!1,bundle:!0,...a});if(s.errors.length>0)throw Error(`Failed to transpile ${i}: ${s.errors.map(e=>e.text).join(`, `)}`);if(s.warnings.length>0&&e.log(n.LogLevelLabel.WARN,`Warnings while transpiling ${i}: ${s.warnings.map(e=>e.text).join(`, `)}`),!s.outputFiles||s.outputFiles.filter(Boolean).length===0)throw Error(`No output files generated for ${i}. Please check the configuration and try again.`);return s.outputFiles.filter(Boolean)[0]}exports.bundle=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{extractESBuildConfig as e}from"../build/esbuild.mjs";import{LogLevelLabel as t}from"@storm-software/config-tools/types";import{build as n}from"esbuild";async function r(r,i,a={}){let o=await r.fs.resolve(i);if(!o||!r.fs.existsSync(o))throw Error(`Module not found: "${i}". Please check the path and try again.`);let s=await n({...e(r),entryPoints:[o],write:!1,sourcemap:!1,splitting:!1,treeShaking:!1,bundle:!0,...a});if(s.errors.length>0)throw Error(`Failed to transpile ${i}: ${s.errors.map(e=>e.text).join(`, `)}`);if(s.warnings.length>0&&r.log(t.WARN,`Warnings while transpiling ${i}: ${s.warnings.map(e=>e.text).join(`, `)}`),!s.outputFiles||s.outputFiles.filter(Boolean).length===0)throw Error(`No output files generated for ${i}. Please check the configuration and try again.`);return s.outputFiles.filter(Boolean)[0]}export{r as bundle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require(`@stryke/string-format/title-case`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{titleCase as e}from"@stryke/string-format/title-case";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`./bundle.cjs`);let n=require(`@stryke/type-checks/is-set-string`),r=require(`@stryke/convert/parse-type-definition`);async function i(e,i,a={}){let o;o=(0,n.isSetString)(i)?(0,r.parseTypeDefinition)(i):i;let s=await t.bundle(e,o.file,a),c=await e.resolver.evalModule(s.text,{filename:s.path,forceTranspile:!0}),l=o.name;return l||=`default`,c[l]??c[`__Ω${l}`]}exports.resolve=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bundle as e}from"./bundle.mjs";import{isSetString as t}from"@stryke/type-checks/is-set-string";import{parseTypeDefinition as n}from"@stryke/convert/parse-type-definition";async function r(r,i,a={}){let o;o=t(i)?n(i):i;let s=await e(r,o.file,a),c=await r.resolver.evalModule(s.text,{filename:s.path,forceTranspile:!0}),l=o.name;return l||=`default`,c[l]??c[`__Ω${l}`]}export{r as resolve};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require(`@stryke/path/replace`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{replacePath as e}from"@stryke/path/replace";export{};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Context } from "./context.cjs";
|
|
2
|
+
import { LogFn } from "./config.cjs";
|
|
3
|
+
import { PluginItem, PluginObj, PluginPass } from "@babel/core";
|
|
4
|
+
import { BabelAPI } from "@babel/helper-plugin-utils";
|
|
5
|
+
|
|
6
|
+
//#region ../powerlines/src/types/babel.d.ts
|
|
7
|
+
|
|
8
|
+
type BabelPluginPass<TState = unknown> = PluginPass & TState;
|
|
9
|
+
type BabelTransformPluginFilter = (code: string, id: string) => boolean;
|
|
10
|
+
type BabelTransformPlugin<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = ((context: TContext) => (options: {
|
|
11
|
+
name: string;
|
|
12
|
+
log: LogFn;
|
|
13
|
+
api: BabelAPI;
|
|
14
|
+
options: TOptions;
|
|
15
|
+
context: TContext;
|
|
16
|
+
dirname: string;
|
|
17
|
+
}) => PluginObj<TOptions & BabelPluginPass<TState>>) & {
|
|
18
|
+
$$name: string;
|
|
19
|
+
};
|
|
20
|
+
type BabelTransformPluginOptions<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = PluginItem | BabelTransformPlugin<TContext, TOptions, TState> | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions] | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions, BabelTransformPluginFilter];
|
|
21
|
+
//#endregion
|
|
22
|
+
export { BabelTransformPluginOptions };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Context } from "./context.mjs";
|
|
2
|
+
import { LogFn } from "./config.mjs";
|
|
3
|
+
import { PluginItem, PluginObj, PluginPass } from "@babel/core";
|
|
4
|
+
import { BabelAPI } from "@babel/helper-plugin-utils";
|
|
5
|
+
|
|
6
|
+
//#region ../powerlines/src/types/babel.d.ts
|
|
7
|
+
|
|
8
|
+
type BabelPluginPass<TState = unknown> = PluginPass & TState;
|
|
9
|
+
type BabelTransformPluginFilter = (code: string, id: string) => boolean;
|
|
10
|
+
type BabelTransformPlugin<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = ((context: TContext) => (options: {
|
|
11
|
+
name: string;
|
|
12
|
+
log: LogFn;
|
|
13
|
+
api: BabelAPI;
|
|
14
|
+
options: TOptions;
|
|
15
|
+
context: TContext;
|
|
16
|
+
dirname: string;
|
|
17
|
+
}) => PluginObj<TOptions & BabelPluginPass<TState>>) & {
|
|
18
|
+
$$name: string;
|
|
19
|
+
};
|
|
20
|
+
type BabelTransformPluginOptions<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = PluginItem | BabelTransformPlugin<TContext, TOptions, TState> | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions] | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions, BabelTransformPluginFilter];
|
|
21
|
+
//#endregion
|
|
22
|
+
export { BabelTransformPluginOptions };
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
//#region ../powerlines/src/types/build.d.ts
|
|
2
|
+
|
|
3
|
+
type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
|
|
4
|
+
interface BuildConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The platform to build the project for
|
|
7
|
+
*
|
|
8
|
+
* @defaultValue "neutral"
|
|
9
|
+
*/
|
|
10
|
+
platform?: "node" | "browser" | "neutral";
|
|
11
|
+
/**
|
|
12
|
+
* Array of strings indicating the polyfills to include for the build.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* {
|
|
20
|
+
* polyfill: ['{projectRoot}/custom-polyfill.ts']
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
polyfill?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
|
|
29
|
+
*/
|
|
30
|
+
mainFields?: string[];
|
|
31
|
+
/**
|
|
32
|
+
* Array of strings indicating what conditions should be used for module resolution.
|
|
33
|
+
*/
|
|
34
|
+
conditions?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Array of strings indicating what file extensions should be used for module resolution.
|
|
37
|
+
*
|
|
38
|
+
* @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
|
|
39
|
+
*/
|
|
40
|
+
extensions?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* Array of strings indicating what modules should be deduplicated to a single version in the build.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* This option is useful for ensuring that only one version of a module is included in the bundle, which can help reduce bundle size and avoid conflicts.
|
|
46
|
+
*/
|
|
47
|
+
dedupe?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Array of strings or regular expressions that indicate what modules are builtin for the environment.
|
|
50
|
+
*/
|
|
51
|
+
builtins?: (string | RegExp)[];
|
|
52
|
+
/**
|
|
53
|
+
* Define global variable replacements.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* This option allows you to specify global constants that will be replaced in the code during the build process. It is similar to the `define` option in esbuild and Vite, enabling you to replace specific identifiers with constant expressions at build time.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* {
|
|
61
|
+
* define: {
|
|
62
|
+
* __VERSION__: '"1.0.0"',
|
|
63
|
+
* __DEV__: 'process.env.NODE_ENV !== "production"'
|
|
64
|
+
* }
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @see https://esbuild.github.io/api/#define
|
|
69
|
+
* @see https://vitejs.dev/config/build-options.html#define
|
|
70
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/replace
|
|
71
|
+
*/
|
|
72
|
+
define?: Record<string, any>;
|
|
73
|
+
/**
|
|
74
|
+
* Global variables that will have import statements injected where necessary
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* This option allows you to specify global variables that should be automatically imported from specified modules whenever they are used in the code. This is particularly useful for polyfilling Node.js globals in a browser environment.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* {
|
|
82
|
+
* inject: {
|
|
83
|
+
* process: 'process/browser',
|
|
84
|
+
* Buffer: ['buffer', 'Buffer'],
|
|
85
|
+
* }
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/inject
|
|
90
|
+
*/
|
|
91
|
+
inject?: Record<string, string | string[]>;
|
|
92
|
+
/**
|
|
93
|
+
* The alias mappings to use for module resolution during the build process.
|
|
94
|
+
*
|
|
95
|
+
* @remarks
|
|
96
|
+
* This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* {
|
|
101
|
+
* alias: {
|
|
102
|
+
* "@utils": "./src/utils",
|
|
103
|
+
* "@components": "./src/components"
|
|
104
|
+
* }
|
|
105
|
+
* }
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/alias
|
|
109
|
+
*/
|
|
110
|
+
alias?: Record<string, string> | Array<{
|
|
111
|
+
find: string | RegExp;
|
|
112
|
+
replacement: string;
|
|
113
|
+
}>;
|
|
114
|
+
/**
|
|
115
|
+
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
116
|
+
*
|
|
117
|
+
* @remarks
|
|
118
|
+
* This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
|
|
119
|
+
*/
|
|
120
|
+
external?: (string | RegExp)[];
|
|
121
|
+
/**
|
|
122
|
+
* A list of modules that should always be bundled, even if they are external dependencies.
|
|
123
|
+
*/
|
|
124
|
+
noExternal?: (string | RegExp)[];
|
|
125
|
+
/**
|
|
126
|
+
* Should the Powerlines CLI processes skip bundling the `node_modules` directory?
|
|
127
|
+
*/
|
|
128
|
+
skipNodeModulesBundle?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* If true, `process.env` referenced in code will be preserved as-is and evaluated in runtime. Otherwise, it is statically replaced as an empty object.
|
|
131
|
+
*
|
|
132
|
+
* @defaultValue false
|
|
133
|
+
*/
|
|
134
|
+
keepProcessEnv?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* An optional set of override options to apply to the selected build variant.
|
|
137
|
+
*
|
|
138
|
+
* @remarks
|
|
139
|
+
* This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
|
|
140
|
+
*/
|
|
141
|
+
override?: Record<string, any>;
|
|
142
|
+
}
|
|
143
|
+
type BuildResolvedConfig = Omit<BuildConfig, "override">;
|
|
144
|
+
//#endregion
|
|
145
|
+
export { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant };
|