mdat 0.6.16 → 0.7.0
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/bin/cli.js +105 -105
- package/dist/.DS_Store +0 -0
- package/dist/index.js +87 -87
- package/package.json +17 -11
- package/readme.md +22 -9
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI tool and library implementing the Markdown Autophagic Template (MDAT) system. MDAT lets you use comments as dynamic content templates in Markdown files, making it easy to generate and update readme boilerplate.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git@github.com:kitschpatrol/mdat.git"
|
|
9
|
-
"directory": "packages/mdat"
|
|
8
|
+
"url": "git@github.com:kitschpatrol/mdat.git"
|
|
10
9
|
},
|
|
10
|
+
"homepage": "https://github.com/kitschpatrol/mdat",
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/kitschpatrol/mdat/issues",
|
|
13
13
|
"email": "eric@ericmika.com"
|
|
@@ -36,27 +36,31 @@
|
|
|
36
36
|
"mdat",
|
|
37
37
|
"markdown",
|
|
38
38
|
"template",
|
|
39
|
+
"readme",
|
|
39
40
|
"comments",
|
|
40
41
|
"docs-generator",
|
|
41
42
|
"docs",
|
|
42
|
-
"cli"
|
|
43
|
+
"cli",
|
|
44
|
+
"npm-package"
|
|
43
45
|
],
|
|
44
46
|
"dependencies": {
|
|
45
47
|
"@clack/prompts": "^0.7.0",
|
|
46
48
|
"@kitschpatrol/tldraw-cli": "^4.5.4",
|
|
47
49
|
"@types/mdast": "^4.0.4",
|
|
48
|
-
"@types/node": "^20.14.
|
|
50
|
+
"@types/node": "^20.14.2",
|
|
49
51
|
"@types/unist": "^3.0.2",
|
|
50
52
|
"@types/which": "^3.0.4",
|
|
51
53
|
"@types/yargs": "^17.0.32",
|
|
52
54
|
"cosmiconfig": "^9.0.0",
|
|
53
55
|
"cosmiconfig-typescript-loader": "^5.0.0",
|
|
54
|
-
"execa": "^9.
|
|
56
|
+
"execa": "^9.2.0",
|
|
55
57
|
"globby": "^14.0.1",
|
|
56
58
|
"read-pkg": "^9.0.1",
|
|
57
59
|
"which": "^4.0.0"
|
|
58
60
|
},
|
|
59
61
|
"devDependencies": {
|
|
62
|
+
"@kitschpatrol/shared-config": "^4.6.7",
|
|
63
|
+
"bumpp": "^9.4.1",
|
|
60
64
|
"chalk": "^5.3.0",
|
|
61
65
|
"chevrotain": "^11.0.3",
|
|
62
66
|
"find-up": "^7.0.0",
|
|
@@ -70,25 +74,27 @@
|
|
|
70
74
|
"pretty-ms": "^9.0.0",
|
|
71
75
|
"remark": "^15.0.1",
|
|
72
76
|
"remark-gfm": "^4.0.0",
|
|
77
|
+
"remark-mdat": "^0.7.0",
|
|
73
78
|
"to-vfile": "^8.0.0",
|
|
74
79
|
"tsup": "^8.1.0",
|
|
75
|
-
"type-fest": "^4.
|
|
80
|
+
"type-fest": "^4.20.0",
|
|
76
81
|
"typescript": "^5.4.5",
|
|
77
82
|
"untildify": "^5.0.0",
|
|
78
83
|
"vfile": "^6.0.1",
|
|
79
84
|
"vitest": "^1.6.0",
|
|
80
85
|
"yargs": "^17.7.2",
|
|
81
|
-
"zod": "^3.23.8"
|
|
82
|
-
"remark-mdat": "0.6.16"
|
|
86
|
+
"zod": "^3.23.8"
|
|
83
87
|
},
|
|
84
88
|
"publishConfig": {
|
|
85
89
|
"access": "public"
|
|
86
90
|
},
|
|
87
91
|
"scripts": {
|
|
88
92
|
"build": "tsup && tsc -p tsconfig.build.lib.json",
|
|
93
|
+
"clean": "git clean -fdX && rm ./pnpm-lock.yaml",
|
|
89
94
|
"dev": "pnpm run test",
|
|
90
|
-
"
|
|
91
|
-
"
|
|
95
|
+
"fix": "pnpm shared-config --fix",
|
|
96
|
+
"lint": "pnpm shared-config --lint",
|
|
97
|
+
"release": "pnpm bumpp --commit 'Release: %s' --tag 'v%s' && pnpm build && pnpm publish --otp $(op read 'op://Personal/Npmjs/one-time password?attribute=otp')",
|
|
92
98
|
"test": "vitest --no-file-parallelism"
|
|
93
99
|
}
|
|
94
100
|
}
|
package/readme.md
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
<!--+ Warning: Content inside HTML comment blocks was generated by mdat and may be overwritten. +-->
|
|
2
2
|
|
|
3
|
-
<!--
|
|
3
|
+
<!-- title -->
|
|
4
4
|
|
|
5
5
|
# mdat
|
|
6
6
|
|
|
7
|
+
<!-- /title -->
|
|
8
|
+
|
|
9
|
+
<!-- badges -->
|
|
10
|
+
|
|
7
11
|
[](https://npmjs.com/package/mdat)
|
|
8
12
|
[](https://opensource.org/licenses/MIT)
|
|
9
13
|
|
|
14
|
+
<!-- /badges -->
|
|
15
|
+
|
|
16
|
+
<!-- description -->
|
|
17
|
+
|
|
10
18
|
**CLI tool and library implementing the Markdown Autophagic Template (MDAT) system. MDAT lets you use comments as dynamic content templates in Markdown files, making it easy to generate and update readme boilerplate.**
|
|
11
19
|
|
|
12
|
-
<!-- /
|
|
20
|
+
<!-- /description -->
|
|
13
21
|
|
|
14
22
|
<!-- table-of-contents -->
|
|
15
23
|
|
|
@@ -29,6 +37,7 @@
|
|
|
29
37
|
- [Background](#background)
|
|
30
38
|
- [Motivation](#motivation)
|
|
31
39
|
- [Similar projects](#similar-projects)
|
|
40
|
+
- [Implementation notes](#implementation-notes)
|
|
32
41
|
- [The future](#the-future)
|
|
33
42
|
- [Maintainers](#maintainers)
|
|
34
43
|
- [Acknowledgments](#acknowledgments)
|
|
@@ -85,20 +94,20 @@ In this case, according to a set of rules defined in an external configuration f
|
|
|
85
94
|
|
|
86
95
|
### Dependencies
|
|
87
96
|
|
|
88
|
-
The `mdat` CLI tool requires Node
|
|
97
|
+
The `mdat` CLI tool requires Node 18+. The exported APIs for expanding Markdown text and documents are ESM-only and share the Node 18+ requirement. `mdat` is implemented in TypeScript and bundles a complete set of type definitions.
|
|
89
98
|
|
|
90
99
|
### Installation
|
|
91
100
|
|
|
92
101
|
Install locally to access the CLI commands in a single project or to import the provided APIs:
|
|
93
102
|
|
|
94
103
|
```sh
|
|
95
|
-
npm install
|
|
104
|
+
npm install mdat
|
|
96
105
|
```
|
|
97
106
|
|
|
98
107
|
Or, install globally for access across your system:
|
|
99
108
|
|
|
100
109
|
```sh
|
|
101
|
-
npm install --global
|
|
110
|
+
npm install --global mdat
|
|
102
111
|
```
|
|
103
112
|
|
|
104
113
|
## Features
|
|
@@ -578,7 +587,7 @@ function loadConfig(options?: {
|
|
|
578
587
|
}): Promise<ConfigLoaded> // returns a single merged config object
|
|
579
588
|
```
|
|
580
589
|
|
|
581
|
-
This is provided for more advanced use cases. It assists in discovering and loading ambient configuration in your project (e.g. fields in your package.json, or dedicated `mdat` config files). It also dynamically loads, validates, and merges additional `mdat` configuration and rule files into a final `ConfigLoaded` object ready to be passed into the [`remark-mdat`](
|
|
590
|
+
This is provided for more advanced use cases. It assists in discovering and loading ambient configuration in your project (e.g. fields in your package.json, or dedicated `mdat` config files). It also dynamically loads, validates, and merges additional `mdat` configuration and rule files into a final `ConfigLoaded` object ready to be passed into the [`remark-mdat`](https://github.com/kitschpatorl/remark-mdat) plugin or one of the API functions like `expandFile()`.
|
|
582
591
|
|
|
583
592
|
#### Examples
|
|
584
593
|
|
|
@@ -649,7 +658,7 @@ If multiple configuration and rule files are loaded, they are merged. CLI option
|
|
|
649
658
|
|
|
650
659
|
The underlying rule expansion system is flexible and easy to extend.
|
|
651
660
|
|
|
652
|
-
See the [Examples section](
|
|
661
|
+
See the [Examples section](https://github.com/kitschpatrol/remark-mdat/readme.md#examples) of the `remark-mdat` readme, or take a look at the implementation of the [rules provided through the `mdat readme` subcommand](./src/lib/readme/rules/) for more complex examples.
|
|
653
662
|
|
|
654
663
|
### The `mdat readme` subcommand
|
|
655
664
|
|
|
@@ -699,7 +708,7 @@ See the [Examples section](../remark-mdat/readme.md#examples) of the `remark-mda
|
|
|
699
708
|
|
|
700
709
|
Currently, the rule can only parse help output in the format provided by [Yargs](https://yargs.js.org)- and [Meow](https://github.com/sindresorhus/meow)-based tools. If parsing fails, the rule will fall back to show the raw help output in a regular code block.
|
|
701
710
|
|
|
702
|
-
([Parsing help output](https://github.com/kitschpatrol/mdat/tree/main/
|
|
711
|
+
([Parsing help output](https://github.com/kitschpatrol/mdat/tree/main/src/lib/readme/rules/cli-help/utilities/parsers) is a bit tricky. The [jc](https://github.com/kellyjonbrazil/jc) project is a heroic collection of output parsers, but does not currently implement help output parsing. It might be interesting to try to contribute mdat's help parsing implementations to jc.)
|
|
703
712
|
|
|
704
713
|
This rule is also aliased under the `<!-- cli -->` keyword.
|
|
705
714
|
|
|
@@ -745,7 +754,7 @@ The `init` command provides a number of "starter readme" templates incorporating
|
|
|
745
754
|
|
|
746
755
|
- ##### MDAT Readme
|
|
747
756
|
|
|
748
|
-
The house style. An expansive starting point. Prune to your context and taste. The readme
|
|
757
|
+
The house style. An expansive starting point. Prune to your context and taste. The readme file in this repo was started from this template.
|
|
749
758
|
|
|
750
759
|
- ##### Standard Readme basic
|
|
751
760
|
|
|
@@ -782,6 +791,10 @@ This has been done several times before:
|
|
|
782
791
|
|
|
783
792
|
- lillallol's [md-in-place](https://www.npmjs.com/package/md-in-place)
|
|
784
793
|
|
|
794
|
+
### Implementation notes
|
|
795
|
+
|
|
796
|
+
This project was split from a monorepo containing both `mdat` and `remark-mdat` into separate repos in July 2024.
|
|
797
|
+
|
|
785
798
|
## The future
|
|
786
799
|
|
|
787
800
|
Additional rules:
|