@powerlines/plugin-automd 0.1.432 → 0.1.435
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/index.cjs +1 -0
- package/dist/index.d.cts +25 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +25 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.d.cts +50 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +50 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +1 -0
- package/dist/types/toc.cjs +0 -0
- package/dist/types/toc.d.cts +35 -0
- package/dist/types/toc.d.cts.map +1 -0
- package/dist/types/toc.d.mts +35 -0
- package/dist/types/toc.d.mts.map +1 -0
- package/dist/types/toc.mjs +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});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,1);let d=require(`markdown-toc`);d=e.__toESM(d,1);const f=(e={})=>({name:`automd`,async config(){let n=await(0,c.loadConfig)((0,o.joinPaths)(this.config.cwd||process.cwd(),this.config.root),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.root,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.root),{ignore:this.config.automd.ignore}):(0,a.isAbsolutePath)(e)?e:(0,i.appendPath)(e,this.config.root)))).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.root)),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.contents,{...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.root),r.contents)}}))}});exports.default=f,exports.plugin=f;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TOCOptions, __ΩTOCOptions } from "./types/toc.cjs";
|
|
2
|
+
import { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig } from "./types/plugin.cjs";
|
|
3
|
+
import { Plugin } from "powerlines";
|
|
4
|
+
|
|
5
|
+
//#region src/index.d.ts
|
|
6
|
+
declare module "powerlines" {
|
|
7
|
+
interface Config {
|
|
8
|
+
automd?: AutoMDPluginOptions;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* AutoMD Plugin
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* A Powerlines plugin to use the AutoMD markdown transformer during the prepare task.
|
|
16
|
+
*
|
|
17
|
+
* @see https://automd.unjs.io/
|
|
18
|
+
*
|
|
19
|
+
* @param options - The plugin options.
|
|
20
|
+
* @returns A Powerlines plugin instance.
|
|
21
|
+
*/
|
|
22
|
+
declare const plugin: <TContext extends AutoMDPluginContext = AutoMDPluginContext>(options?: AutoMDPluginOptions) => Plugin<TContext>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, TOCOptions, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig, __ΩTOCOptions, plugin as default, plugin };
|
|
25
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YA2CY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;AAAA;;;;;;;;;AAeb;;;cAAa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TOCOptions, __ΩTOCOptions } from "./types/toc.mjs";
|
|
2
|
+
import { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig } from "./types/plugin.mjs";
|
|
3
|
+
import { Plugin } from "powerlines";
|
|
4
|
+
|
|
5
|
+
//#region src/index.d.ts
|
|
6
|
+
declare module "powerlines" {
|
|
7
|
+
interface Config {
|
|
8
|
+
automd?: AutoMDPluginOptions;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* AutoMD Plugin
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* A Powerlines plugin to use the AutoMD markdown transformer during the prepare task.
|
|
16
|
+
*
|
|
17
|
+
* @see https://automd.unjs.io/
|
|
18
|
+
*
|
|
19
|
+
* @param options - The plugin options.
|
|
20
|
+
* @returns A Powerlines plugin instance.
|
|
21
|
+
*/
|
|
22
|
+
declare const plugin: <TContext extends AutoMDPluginContext = AutoMDPluginContext>(options?: AutoMDPluginOptions) => Plugin<TContext>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, TOCOptions, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig, __ΩTOCOptions, plugin as default, plugin };
|
|
25
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YA2CY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;AAAA;;;;;;;;;AAeb;;;cAAa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
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.config.cwd||process.cwd(),this.config.root),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.root,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.root),{ignore:this.config.automd.ignore}):i(e)?e:r(e,this.config.root)))).flat(),this.config.automd.output&&!i(this.config.automd.output)&&(this.config.automd.output=r(this.config.automd.output,this.config.root)),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.contents,{...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.root),i.contents)}}))}});export{p as default,p as plugin};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["loadConfigFile"],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { isDirectory } from \"@stryke/fs/is-file\";\nimport { listFiles } from \"@stryke/fs/list-files\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport {\n Config,\n GenerateContext,\n GenerateResult,\n loadConfig,\n resolveConfig,\n transform\n} from \"automd\";\nimport { loadConfig as loadConfigFile } from \"c12\";\nimport defu from \"defu\";\nimport toc from \"markdown-toc\";\nimport type { Plugin } from \"powerlines\";\nimport { AutoMDPluginContext, AutoMDPluginOptions } from \"./types/plugin\";\nimport { TOCOptions } from \"./types/toc\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n automd?: AutoMDPluginOptions;\n }\n}\n\n/**\n * AutoMD Plugin\n *\n * @remarks\n * A Powerlines plugin to use the AutoMD markdown transformer during the prepare task.\n *\n * @see https://automd.unjs.io/\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends AutoMDPluginContext = AutoMDPluginContext\n>(\n options: AutoMDPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"automd\",\n async config() {\n const config = await loadConfig(\n joinPaths(this.config.cwd || process.cwd(), this.config.root),\n options\n );\n\n if (!config.prefix || !Array.isArray(config.prefix)) {\n config.prefix = toArray(config.prefix ?? []);\n }\n\n if (!config.prefix.includes(\"automd\")) {\n config.prefix.push(\"automd\");\n }\n if (!config.prefix.includes(\"powerlines\")) {\n config.prefix.push(\"powerlines\");\n }\n\n return {\n automd: defu(config ?? {}, {\n configFile: options.configFile,\n allowIssues: true,\n dir: this.config.root,\n watch: false,\n input: \"README.md\",\n toc: {\n maxDepth: 6,\n bullets: \"-\"\n }\n })\n };\n },\n async configResolved() {\n if (\n this.config.framework &&\n !toArray(this.config.automd.prefix).includes(this.config.framework)\n ) {\n this.config.automd.prefix = toArray(this.config.automd.prefix).concat(\n this.config.framework\n );\n }\n\n if (this.config.automd.configFile) {\n const { config } = await loadConfigFile<Config>({\n cwd: this.config.automd.dir,\n configFile: this.config.automd.configFile,\n defaults: {\n ignore: [\"**/node_modules\", \"**/dist\", \"**/.*\"],\n dir: this.config.automd.dir\n }\n });\n\n this.config.automd = resolveConfig(\n defu(this.config.automd, {\n ...config,\n prefix: toArray(config.prefix ?? [])\n }) as Config\n );\n }\n\n this.config.automd.input = (\n await Promise.all(\n toArray(this.config.automd.input).map(async input => {\n if (input.includes(\"*\")) {\n return listFiles(\n isAbsolutePath(input)\n ? input\n : appendPath(input, this.config.root),\n {\n ignore: this.config.automd.ignore\n }\n );\n }\n\n return isAbsolutePath(input)\n ? input\n : appendPath(input, this.config.root);\n })\n )\n ).flat();\n\n if (\n this.config.automd.output &&\n !isAbsolutePath(this.config.automd.output)\n ) {\n this.config.automd.output = appendPath(\n this.config.automd.output,\n this.config.root\n );\n }\n\n this.config.automd.generators ??= {};\n\n if (this.config.automd.toc !== false) {\n this.config.automd.generators.toc ??= {\n name: \"toc\",\n generate: (ctx: GenerateContext): GenerateResult => {\n const opts = (this.config.automd.toc ?? {}) as TOCOptions;\n\n return {\n contents: toc(ctx.block.contents, {\n ...opts,\n maxdepth: opts.maxDepth,\n first1: opts.firstH1\n }).content\n };\n }\n };\n }\n },\n async docs() {\n await Promise.all(\n toArray(this.config.automd.input).map(async input => {\n const contents = await this.fs.read(input);\n if (contents) {\n const result = await transform(contents, this.config.automd);\n if (result.hasIssues && this.config.automd.allowIssues === false) {\n throw new Error(\n `AutoMD found issues in file \"${\n input\n }\". Please resolve the issues or set \\`allowIssues\\` to true in the plugin configuration to ignore them.`\n );\n }\n\n if (result.hasChanged) {\n await this.fs.write(\n appendPath(\n this.config.automd.output\n ? isDirectory(this.config.automd.output)\n ? replacePath(input, this.config.automd.output)\n : this.config.automd.output\n : input,\n this.config.root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,KAAK,OAAO,KACb,CACD,EAAO,SACR,GAGL,CACH,EAEJ"}
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TOCOptions, __ΩTOCOptions } from "./toc.cjs";
|
|
2
|
+
import { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig } from "./plugin.cjs";
|
|
3
|
+
export { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, TOCOptions, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig, __ΩTOCOptions };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TOCOptions, __ΩTOCOptions } from "./toc.mjs";
|
|
2
|
+
import { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig } from "./plugin.mjs";
|
|
3
|
+
export { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, TOCOptions, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig, __ΩTOCOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TOCOptions } from "./toc.cjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
3
|
+
import { Config } from "automd";
|
|
4
|
+
|
|
5
|
+
//#region src/types/plugin.d.ts
|
|
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
|
+
type AutoMDPluginUserConfig = UserConfig & {
|
|
38
|
+
automd?: Config & Pick<AutoMDPluginOptions, "configFile" | "allowIssues" | "toc">;
|
|
39
|
+
};
|
|
40
|
+
type AutoMDPluginResolvedConfig = ResolvedConfig & {
|
|
41
|
+
automd: Config & Pick<AutoMDPluginOptions, "configFile" | "allowIssues" | "toc">;
|
|
42
|
+
};
|
|
43
|
+
type AutoMDPluginContext<TResolvedConfig extends AutoMDPluginResolvedConfig = AutoMDPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
44
|
+
declare type __ΩAutoMDPluginOptions = any[];
|
|
45
|
+
declare type __ΩAutoMDPluginUserConfig = any[];
|
|
46
|
+
declare type __ΩAutoMDPluginResolvedConfig = any[];
|
|
47
|
+
declare type __ΩAutoMDPluginContext = any[];
|
|
48
|
+
//#endregion
|
|
49
|
+
export { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig };
|
|
50
|
+
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;KAsBY,mBAAA,GAAsB,IAAA,CAChC,MAAA;;AADF;;;;;EAUE,UAAA;EAyBwB;;;;;EAlBxB,WAAA;EAUA;;;;;AAWF;;;EAXE,MAAA;EAYS;;;;;;EAJT,GAAA,WAAc,UAAA;AAAA;AAAA,KAGJ,sBAAA,GAAyB,UAAA;EACnC,MAAA,GAAS,MAAA,GACP,IAAA,CAAK,mBAAA;AAAA;AAAA,KAGG,0BAAA,GAA6B,cAAA;EACvC,MAAA,EAAQ,MAAA,GACN,IAAA,CAAK,mBAAA;AAAA;AAAA,KAGG,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TOCOptions } from "./toc.mjs";
|
|
2
|
+
import { Config } from "automd";
|
|
3
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
4
|
+
|
|
5
|
+
//#region src/types/plugin.d.ts
|
|
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
|
+
type AutoMDPluginUserConfig = UserConfig & {
|
|
38
|
+
automd?: Config & Pick<AutoMDPluginOptions, "configFile" | "allowIssues" | "toc">;
|
|
39
|
+
};
|
|
40
|
+
type AutoMDPluginResolvedConfig = ResolvedConfig & {
|
|
41
|
+
automd: Config & Pick<AutoMDPluginOptions, "configFile" | "allowIssues" | "toc">;
|
|
42
|
+
};
|
|
43
|
+
type AutoMDPluginContext<TResolvedConfig extends AutoMDPluginResolvedConfig = AutoMDPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
44
|
+
declare type __ΩAutoMDPluginOptions = any[];
|
|
45
|
+
declare type __ΩAutoMDPluginUserConfig = any[];
|
|
46
|
+
declare type __ΩAutoMDPluginResolvedConfig = any[];
|
|
47
|
+
declare type __ΩAutoMDPluginContext = any[];
|
|
48
|
+
//#endregion
|
|
49
|
+
export { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig };
|
|
50
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;KAsBY,mBAAA,GAAsB,IAAA,CAChC,MAAA;;AADF;;;;;EAUE,UAAA;EAyBwB;;;;;EAlBxB,WAAA;EAUA;;;;;AAWF;;;EAXE,MAAA;EAYS;;;;;;EAJT,GAAA,WAAc,UAAA;AAAA;AAAA,KAGJ,sBAAA,GAAyB,UAAA;EACnC,MAAA,GAAS,MAAA,GACP,IAAA,CAAK,mBAAA;AAAA;AAAA,KAGG,0BAAA,GAA6B,cAAA;EACvC,MAAA,EAAQ,MAAA,GACN,IAAA,CAAK,mBAAA;AAAA;AAAA,KAGG,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region 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
|
+
declare type __ΩTOCOptions = any[];
|
|
33
|
+
//#endregion
|
|
34
|
+
export { TOCOptions, __ΩTOCOptions };
|
|
35
|
+
//# sourceMappingURL=toc.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toc.d.cts","names":[],"sources":["../../src/types/toc.ts"],"mappings":";UAkBiB,UAAA;EAAA;;;EAIf,OAAA,IAAW,GAAA;EAAX;;;;;EAOA,QAAA;EAsBA;;;EAjBA,OAAA;EAiBoC;;;;;EAVpC,OAAA;;;;EAKA,MAAA;;;;EAKA,MAAA,IAAU,GAAA,UAAa,KAAA;AAAA;AAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region 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
|
+
declare type __ΩTOCOptions = any[];
|
|
33
|
+
//#endregion
|
|
34
|
+
export { TOCOptions, __ΩTOCOptions };
|
|
35
|
+
//# sourceMappingURL=toc.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toc.d.mts","names":[],"sources":["../../src/types/toc.ts"],"mappings":";UAkBiB,UAAA;EAAA;;;EAIf,OAAA,IAAW,GAAA;EAAX;;;;;EAOA,QAAA;EAsBA;;;EAjBA,OAAA;EAiBoC;;;;;EAVpC,OAAA;;;;EAKA,MAAA;;;;EAKA,MAAA,IAAU,GAAA,UAAa,KAAA;AAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-automd",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.435",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Powerlines plugin to maintain a project's markdown files using AutoMD generators.",
|
|
6
6
|
"keywords": ["automd", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -104,20 +104,20 @@
|
|
|
104
104
|
"typings": "dist/index.d.mts",
|
|
105
105
|
"files": ["dist/**/*"],
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@stryke/convert": "^0.7.
|
|
108
|
-
"@stryke/fs": "^0.33.
|
|
109
|
-
"@stryke/path": "^0.
|
|
110
|
-
"@stryke/type-checks": "^0.6.
|
|
111
|
-
"@stryke/types": "^0.11.
|
|
107
|
+
"@stryke/convert": "^0.7.2",
|
|
108
|
+
"@stryke/fs": "^0.33.69",
|
|
109
|
+
"@stryke/path": "^0.28.1",
|
|
110
|
+
"@stryke/type-checks": "^0.6.4",
|
|
111
|
+
"@stryke/types": "^0.11.6",
|
|
112
112
|
"c12": "^3.3.4",
|
|
113
113
|
"defu": "^6.1.7",
|
|
114
114
|
"markdown-toc": "^1.2.0"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
117
|
+
"@powerlines/plugin-plugin": "^0.12.386",
|
|
118
118
|
"@types/node": "^25.6.0",
|
|
119
119
|
"automd": "^0.4.3"
|
|
120
120
|
},
|
|
121
121
|
"publishConfig": { "access": "public" },
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "abf752430f7af954a70fd6c9805e50eba2fa666b"
|
|
123
123
|
}
|