@powerlines/plugin-automd 0.1.97 → 0.1.98

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 CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`);let 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/is-type`),o=require(`@stryke/path/join-paths`),s=require(`@stryke/path/replace`),c=require(`automd`),l=require(`c12`),u=require(`defu`);u=e.__toESM(u);let d=require(`markdown-toc`);d=e.__toESM(d);const f=(e={})=>({name:`automd`,async config(){let n=await(0,c.loadConfig)((0,o.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot),e);return(!n.prefix||!Array.isArray(n.prefix))&&(n.prefix=(0,t.toArray)(n.prefix??[])),n.prefix.includes(`automd`)||n.prefix.push(`automd`),n.prefix.includes(`powerlines`)||n.prefix.push(`powerlines`),{automd:(0,u.default)(n??{},{configFile:e.configFile,allowIssues:!0,dir:this.config.projectRoot,watch:!1,input:`README.md`,toc:{maxDepth:6,bullets:`-`}})}},async configResolved(){if(this.config.automd.configFile){let{config:e}=await(0,l.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,c.resolveConfig)((0,u.default)(this.config.automd,{...e,prefix:(0,t.toArray)(e.prefix??[])}))}this.config.automd.input=(await Promise.all((0,t.toArray)(this.config.automd.input).map(async e=>e.includes(`*`)?(0,r.listFiles)((0,a.isAbsolutePath)(e)?e:(0,i.appendPath)(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):(0,a.isAbsolutePath)(e)?e:(0,i.appendPath)(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!(0,a.isAbsolutePath)(this.config.automd.output)&&(this.config.automd.output=(0,i.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,t.toArray)(this.config.automd.input).map(async e=>{let t=await this.fs.read(e);if(t){let r=await(0,c.transform)(t,this.config.automd);if(r.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${e}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);r.hasChanged&&await this.fs.write((0,i.appendPath)(this.config.automd.output?(0,n.isDirectory)(this.config.automd.output)?(0,s.replacePath)(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),r.contents)}}))}});var p=f;exports.default=p,exports.plugin=f;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`);let 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/is-type`),o=require(`@stryke/path/join-paths`),s=require(`@stryke/path/replace`),c=require(`automd`),l=require(`c12`),u=require(`defu`);u=e.__toESM(u);let d=require(`markdown-toc`);d=e.__toESM(d);const f=(e={})=>({name:`automd`,async config(){let n=await(0,c.loadConfig)((0,o.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot),e);return(!n.prefix||!Array.isArray(n.prefix))&&(n.prefix=(0,t.toArray)(n.prefix??[])),n.prefix.includes(`automd`)||n.prefix.push(`automd`),n.prefix.includes(`powerlines`)||n.prefix.push(`powerlines`),{automd:(0,u.default)(n??{},{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,t.toArray)(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=(0,t.toArray)(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:e}=await(0,l.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,c.resolveConfig)((0,u.default)(this.config.automd,{...e,prefix:(0,t.toArray)(e.prefix??[])}))}this.config.automd.input=(await Promise.all((0,t.toArray)(this.config.automd.input).map(async e=>e.includes(`*`)?(0,r.listFiles)((0,a.isAbsolutePath)(e)?e:(0,i.appendPath)(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):(0,a.isAbsolutePath)(e)?e:(0,i.appendPath)(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!(0,a.isAbsolutePath)(this.config.automd.output)&&(this.config.automd.output=(0,i.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,t.toArray)(this.config.automd.input).map(async e=>{let t=await this.fs.read(e);if(t){let r=await(0,c.transform)(t,this.config.automd);if(r.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${e}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);r.hasChanged&&await this.fs.write((0,i.appendPath)(this.config.automd.output?(0,n.isDirectory)(this.config.automd.output)?(0,s.replacePath)(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),r.contents)}}))}});var p=f;exports.default=p,exports.plugin=f;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{toArray as e}from"@stryke/convert/to-array";import{isDirectory as t}from"@stryke/fs/is-file";import{listFiles as n}from"@stryke/fs/list-files";import{appendPath as r}from"@stryke/path/append";import{isAbsolutePath as i}from"@stryke/path/is-type";import{joinPaths as a}from"@stryke/path/join-paths";import{replacePath as o}from"@stryke/path/replace";import{loadConfig as s,resolveConfig as c,transform as l}from"automd";import{loadConfig as u}from"c12";import d from"defu";import f from"markdown-toc";const p=(p={})=>({name:`automd`,async config(){let t=await s(a(this.workspaceConfig.workspaceRoot,this.config.projectRoot),p);return(!t.prefix||!Array.isArray(t.prefix))&&(t.prefix=e(t.prefix??[])),t.prefix.includes(`automd`)||t.prefix.push(`automd`),t.prefix.includes(`powerlines`)||t.prefix.push(`powerlines`),{automd:d(t??{},{configFile:p.configFile,allowIssues:!0,dir:this.config.projectRoot,watch:!1,input:`README.md`,toc:{maxDepth:6,bullets:`-`}})}},async configResolved(){if(this.config.automd.configFile){let{config:t}=await u({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=c(d(this.config.automd,{...t,prefix:e(t.prefix??[])}))}this.config.automd.input=(await Promise.all(e(this.config.automd.input).map(async e=>e.includes(`*`)?n(i(e)?e:r(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):i(e)?e:r(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!i(this.config.automd.output)&&(this.config.automd.output=r(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(e(this.config.automd.input).map(async e=>{let n=await this.fs.read(e);if(n){let i=await l(n,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(r(this.config.automd.output?t(this.config.automd.output)?o(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),i.contents)}}))}});var m=p;export{m as default,p as plugin};
1
+ import{toArray as e}from"@stryke/convert/to-array";import{isDirectory as t}from"@stryke/fs/is-file";import{listFiles as n}from"@stryke/fs/list-files";import{appendPath as r}from"@stryke/path/append";import{isAbsolutePath as i}from"@stryke/path/is-type";import{joinPaths as a}from"@stryke/path/join-paths";import{replacePath as o}from"@stryke/path/replace";import{loadConfig as s,resolveConfig as c,transform as l}from"automd";import{loadConfig as u}from"c12";import d from"defu";import f from"markdown-toc";const p=(p={})=>({name:`automd`,async config(){let t=await s(a(this.workspaceConfig.workspaceRoot,this.config.projectRoot),p);return(!t.prefix||!Array.isArray(t.prefix))&&(t.prefix=e(t.prefix??[])),t.prefix.includes(`automd`)||t.prefix.push(`automd`),t.prefix.includes(`powerlines`)||t.prefix.push(`powerlines`),{automd:d(t??{},{configFile:p.configFile,allowIssues:!0,dir:this.config.projectRoot,watch:!1,input:`README.md`,toc:{maxDepth:6,bullets:`-`}})}},async configResolved(){if(this.config.framework&&!e(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=e(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:t}=await u({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=c(d(this.config.automd,{...t,prefix:e(t.prefix??[])}))}this.config.automd.input=(await Promise.all(e(this.config.automd.input).map(async e=>e.includes(`*`)?n(i(e)?e:r(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):i(e)?e:r(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!i(this.config.automd.output)&&(this.config.automd.output=r(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(e(this.config.automd.input).map(async e=>{let n=await this.fs.read(e);if(n){let i=await l(n,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(r(this.config.automd.output?t(this.config.automd.output)?o(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),i.contents)}}))}});var m=p;export{m as default,p as plugin};
@@ -25,7 +25,7 @@ type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix">
25
25
  * @remarks
26
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
27
  *
28
- * @defaultValue ["automd", "powerlines"]
28
+ * @defaultValue ["automd", "powerlines", "\{framework\}"]
29
29
  */
30
30
  prefix?: string | string[];
31
31
  /**
@@ -25,7 +25,7 @@ type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix">
25
25
  * @remarks
26
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
27
  *
28
- * @defaultValue ["automd", "powerlines"]
28
+ * @defaultValue ["automd", "powerlines", "\{framework\}"]
29
29
  */
30
30
  prefix?: string | string[];
31
31
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-automd",
3
- "version": "0.1.97",
3
+ "version": "0.1.98",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to maintain a project's markdown files using AutoMD generators.",
6
6
  "repository": {
@@ -125,14 +125,14 @@
125
125
  "c12": "^3.3.3",
126
126
  "defu": "^6.1.4",
127
127
  "markdown-toc": "^1.2.0",
128
- "powerlines": "^0.36.2"
128
+ "powerlines": "^0.36.3"
129
129
  },
130
130
  "devDependencies": {
131
- "@powerlines/nx": "^0.11.28",
132
- "@powerlines/plugin-plugin": "^0.12.49",
131
+ "@powerlines/nx": "^0.11.29",
132
+ "@powerlines/plugin-plugin": "^0.12.50",
133
133
  "@types/node": "^24.10.4",
134
134
  "automd": "^0.4.2"
135
135
  },
136
136
  "publishConfig": { "access": "public" },
137
- "gitHead": "916e24a276b03bbc9d64349bf85f37ffb43d5e87"
137
+ "gitHead": "0d695fa64043ba14e7c7ae8759e9e0cf5b2a6b38"
138
138
  }