@powerlines/plugin-automd 0.1.46 → 0.1.48

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.
Files changed (44) hide show
  1. package/dist/index-CA4VvAY_.d.mts +1 -0
  2. package/dist/index-CmCelmEL.d.cts +1 -0
  3. package/dist/index.cjs +1 -7
  4. package/dist/index.d.cts +8 -24
  5. package/dist/index.d.cts.map +1 -0
  6. package/dist/index.d.mts +21 -0
  7. package/dist/index.d.mts.map +1 -0
  8. package/dist/index.mjs +2 -0
  9. package/dist/index.mjs.map +1 -0
  10. package/dist/plugin-Gb47Xzf6.mjs +1 -0
  11. package/dist/plugin-Mffyu6MQ.d.cts +1686 -0
  12. package/dist/plugin-Mffyu6MQ.d.cts.map +1 -0
  13. package/dist/plugin-qhy9lRM9.d.mts +1687 -0
  14. package/dist/plugin-qhy9lRM9.d.mts.map +1 -0
  15. package/dist/toc-BMJnT26b.mjs +1 -0
  16. package/dist/toc-CbG2Hl5G.d.cts +35 -0
  17. package/dist/toc-CbG2Hl5G.d.cts.map +1 -0
  18. package/dist/toc-KnOLp5Tz.d.mts +35 -0
  19. package/dist/toc-KnOLp5Tz.d.mts.map +1 -0
  20. package/dist/types/index.cjs +1 -1
  21. package/dist/types/index.d.cts +4 -21
  22. package/dist/types/index.d.mts +4 -0
  23. package/dist/types/index.mjs +1 -0
  24. package/dist/types/plugin.cjs +1 -1
  25. package/dist/types/plugin.d.cts +3 -21
  26. package/dist/types/plugin.d.mts +3 -0
  27. package/dist/types/plugin.mjs +1 -0
  28. package/dist/types/toc.cjs +1 -1
  29. package/dist/types/toc.d.cts +2 -33
  30. package/dist/types/toc.d.mts +2 -0
  31. package/dist/types/toc.mjs +1 -0
  32. package/dist/types-CBTc19th.cjs +0 -0
  33. package/dist/types-CwXe_Ycf.mjs +1 -0
  34. package/package.json +44 -26
  35. package/dist/index-fI31NKTu.d.ts +0 -1527
  36. package/dist/index-nKehSVvf.d.cts +0 -1527
  37. package/dist/index.d.ts +0 -37
  38. package/dist/index.js +0 -7
  39. package/dist/types/index.d.ts +0 -21
  40. package/dist/types/index.js +0 -1
  41. package/dist/types/plugin.d.ts +0 -21
  42. package/dist/types/toc.d.ts +0 -33
  43. /package/dist/{types/plugin.js → plugin-DHXHjv16.cjs} +0 -0
  44. /package/dist/{types/toc.js → toc-BMD8zasy.cjs} +0 -0
package/dist/index.d.ts DELETED
@@ -1,37 +0,0 @@
1
- import { A as AutoMDPluginContext, a as AutoMDPluginOptions, P as Plugin } from './index-fI31NKTu.js';
2
- export { c as AutoMDPluginResolvedConfig, b as AutoMDPluginUserConfig, f as __ΩAutoMDPluginContext, _ as __ΩAutoMDPluginOptions, e as __ΩAutoMDPluginResolvedConfig, d as __ΩAutoMDPluginUserConfig } from './index-fI31NKTu.js';
3
- export { TOCOptions, __ΩTOCOptions } from './types/toc.js';
4
- import 'automd';
5
- import '@storm-software/build-tools/types';
6
- import '@storm-software/config-tools/types';
7
- import '@storm-software/config/types';
8
- import '@stryke/types/base';
9
- import '@stryke/types/configuration';
10
- import '@stryke/types/file';
11
- import 'vite';
12
- import '@stryke/env/get-env-paths';
13
- import '@stryke/types/package-json';
14
- import 'jiti';
15
- import 'magic-string';
16
- import 'semver';
17
- import 'ts-morph';
18
- import 'unplugin';
19
- import '@stryke/fs/resolve';
20
- import '@stryke/types/tsconfig';
21
- import 'typescript';
22
- import '@stryke/types/array';
23
-
24
- /**
25
- * AutoMD Plugin
26
- *
27
- * @remarks
28
- * A Powerlines plugin to use the AutoMD markdown transformer during the prepare task.
29
- *
30
- * @see https://automd.unjs.io/
31
- *
32
- * @param options - The plugin options.
33
- * @returns A Powerlines plugin instance.
34
- */
35
- declare const plugin: <TContext extends AutoMDPluginContext = AutoMDPluginContext>(options?: AutoMDPluginOptions) => Plugin<TContext>;
36
-
37
- export { AutoMDPluginContext, AutoMDPluginOptions, plugin as default, plugin };
package/dist/index.js DELETED
@@ -1,7 +0,0 @@
1
- import {toArray}from'@stryke/convert/to-array';import {isDirectory}from'@stryke/fs/is-file';import {listFiles}from'@stryke/fs/list-files';import {appendPath}from'@stryke/path/append';import {isAbsolutePath}from'@stryke/path/is-type';import {joinPaths}from'@stryke/path/join-paths';import {replacePath}from'@stryke/path/replace';import {transform,resolveConfig,loadConfig as loadConfig$1}from'automd';import {loadConfig}from'c12';import f from'defu';import C from'markdown-toc';export*from'./types';/*****************************************
2
- *
3
- * ⚡ Built by Storm Software
4
- *
5
- *****************************************/
6
-
7
- var u=Object.defineProperty;var r=(i,o)=>u(i,"name",{value:o,configurable:true});const w=r((i={})=>({name:"automd",async config(){const o=await loadConfig$1(joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot),i);return (!o.prefix||!Array.isArray(o.prefix))&&(o.prefix=toArray(o.prefix??[])),o.prefix.includes("automd")||o.prefix.push("automd"),o.prefix.includes("powerlines")||o.prefix.push("powerlines"),{automd:f(o??{},{configFile:i.configFile,allowIssues:true,dir:this.config.projectRoot,watch:false,input:"README.md",toc:{maxDepth:6,bullets:"-"}})}},async configResolved(){if(this.config.automd.configFile){const{config:o}=await loadConfig({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:["**/node_modules","**/dist","**/.*"],dir:this.config.automd.dir}});this.config.automd=resolveConfig(f(this.config.automd,{...o,prefix:toArray(o.prefix??[])}));}this.config.automd.input=(await Promise.all(toArray(this.config.automd.input).map(async o=>o.includes("*")?listFiles(isAbsolutePath(o)?o:appendPath(o,this.config.projectRoot),{ignore:this.config.automd.ignore}):isAbsolutePath(o)?o:appendPath(o,this.config.projectRoot)))).flat(),this.config.automd.output&&!isAbsolutePath(this.config.automd.output)&&(this.config.automd.output=appendPath(this.config.automd.output,this.config.projectRoot)),this.config.automd.generators??={},this.config.automd.toc!==false&&(this.config.automd.generators.toc??={name:"toc",generate:r(o=>{const t=this.config.automd.toc??{};return {contents:C(o.block.md,{...t,maxdepth:t.maxDepth,first1:t.firstH1}).content}},"generate")});},async docs(){await Promise.all(toArray(this.config.automd.input).map(async o=>{const t=await this.fs.read(o);if(t){const s=await transform(t,this.config.automd);if(s.hasIssues&&this.config.automd.allowIssues===false)throw new Error(`AutoMD found issues in file "${o}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);s.hasChanged&&await this.fs.write(appendPath(this.config.automd.output?isDirectory(this.config.automd.output)?replacePath(o,this.config.automd.output):this.config.automd.output:o,this.config.projectRoot),s.contents);}}));}}),"plugin");var L=w;export{L as default,w as plugin};
@@ -1,21 +0,0 @@
1
- export { A as AutoMDPluginContext, a as AutoMDPluginOptions, c as AutoMDPluginResolvedConfig, b as AutoMDPluginUserConfig, f as __ΩAutoMDPluginContext, _ as __ΩAutoMDPluginOptions, e as __ΩAutoMDPluginResolvedConfig, d as __ΩAutoMDPluginUserConfig } from '../index-fI31NKTu.js';
2
- export { TOCOptions, __ΩTOCOptions } from './toc.js';
3
- import 'automd';
4
- import '@storm-software/build-tools/types';
5
- import '@storm-software/config-tools/types';
6
- import '@storm-software/config/types';
7
- import '@stryke/types/base';
8
- import '@stryke/types/configuration';
9
- import '@stryke/types/file';
10
- import 'vite';
11
- import '@stryke/env/get-env-paths';
12
- import '@stryke/types/package-json';
13
- import 'jiti';
14
- import 'magic-string';
15
- import 'semver';
16
- import 'ts-morph';
17
- import 'unplugin';
18
- import '@stryke/fs/resolve';
19
- import '@stryke/types/tsconfig';
20
- import 'typescript';
21
- import '@stryke/types/array';
@@ -1 +0,0 @@
1
- export*from'./plugin';export*from'./toc';
@@ -1,21 +0,0 @@
1
- import 'automd';
2
- export { A as AutoMDPluginContext, a as AutoMDPluginOptions, c as AutoMDPluginResolvedConfig, b as AutoMDPluginUserConfig, f as __ΩAutoMDPluginContext, _ as __ΩAutoMDPluginOptions, e as __ΩAutoMDPluginResolvedConfig, d as __ΩAutoMDPluginUserConfig } from '../index-fI31NKTu.js';
3
- import './toc.js';
4
- import '@storm-software/build-tools/types';
5
- import '@storm-software/config-tools/types';
6
- import '@storm-software/config/types';
7
- import '@stryke/types/base';
8
- import '@stryke/types/configuration';
9
- import '@stryke/types/file';
10
- import 'vite';
11
- import '@stryke/env/get-env-paths';
12
- import '@stryke/types/package-json';
13
- import 'jiti';
14
- import 'magic-string';
15
- import 'semver';
16
- import 'ts-morph';
17
- import 'unplugin';
18
- import '@stryke/fs/resolve';
19
- import '@stryke/types/tsconfig';
20
- import 'typescript';
21
- import '@stryke/types/array';
@@ -1,33 +0,0 @@
1
- interface TOCOptions {
2
- /**
3
- * A slugify function to generate slugs for the headings.
4
- */
5
- slugify?: (str: string) => string;
6
- /**
7
- * The maximum depth of headings to include in the TOC.
8
- *
9
- * @defaultValue 6
10
- */
11
- maxDepth?: number;
12
- /**
13
- * Whether to include the first H1 heading in the TOC.
14
- */
15
- firstH1?: boolean;
16
- /**
17
- * The bullet character to use for list items in the TOC.
18
- *
19
- * @defaultValue "-"
20
- */
21
- bullets?: string;
22
- /**
23
- * A prefix to add to each heading in the TOC.
24
- */
25
- prefix?: string;
26
- /**
27
- * A filter function to determine which headings to include in the TOC.
28
- */
29
- filter?: (str: string, level: number) => boolean;
30
- }
31
- declare type __ΩTOCOptions = any[];
32
-
33
- export type { TOCOptions, __ΩTOCOptions };
File without changes
File without changes