@kitschpatrol/mdat-config 4.7.12 → 5.0.1
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 +6305 -58
- package/dist/index.d.ts +17 -0
- package/dist/index.js +24 -0
- package/init/mdat.config.ts +3 -0
- package/license.txt +1 -1
- package/package.json +32 -24
- package/readme.md +116 -18
- package/dist/mdat.config.d.ts +0 -2
- package/dist/mdat.config.js +0 -5
- package/init/.mdatrc.ts +0 -6
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Config as MdatConfig } from 'mdat';
|
|
2
|
+
declare const sharedMdatConfig: MdatConfig;
|
|
3
|
+
/**
|
|
4
|
+
* **\@Kitschpatrol's Shared Mdat Configuration**
|
|
5
|
+
* @see [@kitschpatrol/mdat-config](https://github.com/kitschpatrol/shared-config/tree/main/packages/mdat-config)
|
|
6
|
+
* @see [@kitschpatrol/shared-config](https://github.com/kitschpatrol/shared-config)
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* export default mdatConfig({
|
|
10
|
+
* rules: {
|
|
11
|
+
* test: '**This is a test rule.**',
|
|
12
|
+
* },
|
|
13
|
+
* })
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function mdatConfig(config?: MdatConfig): MdatConfig;
|
|
17
|
+
export default sharedMdatConfig;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { mergeConfigs } from 'mdat';
|
|
2
|
+
// export { commandDefinition } from './command.js'
|
|
3
|
+
const sharedMdatConfig = {
|
|
4
|
+
rules: {
|
|
5
|
+
'shared-config': '## Project configuration\n\nThis project uses [@kitschpatrol/shared-config](https://github.com/kitschpatrol/shared-config) to consolidate various linting and formatting tool configurations under a single dependency and the CLI command `kpi`. (ESLint, Prettier, CSpell, etc.)',
|
|
6
|
+
},
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* **\@Kitschpatrol's Shared Mdat Configuration**
|
|
10
|
+
* @see [@kitschpatrol/mdat-config](https://github.com/kitschpatrol/shared-config/tree/main/packages/mdat-config)
|
|
11
|
+
* @see [@kitschpatrol/shared-config](https://github.com/kitschpatrol/shared-config)
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* export default mdatConfig({
|
|
15
|
+
* rules: {
|
|
16
|
+
* test: '**This is a test rule.**',
|
|
17
|
+
* },
|
|
18
|
+
* })
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export function mdatConfig(config) {
|
|
22
|
+
return mergeConfigs(sharedMdatConfig, config ?? {});
|
|
23
|
+
}
|
|
24
|
+
export default sharedMdatConfig;
|
package/license.txt
CHANGED
package/package.json
CHANGED
|
@@ -1,56 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/mdat-config",
|
|
3
|
-
"version": "
|
|
4
|
-
"type": "module",
|
|
3
|
+
"version": "5.0.1",
|
|
5
4
|
"description": "MDAT configuration for @kitschpatrol/shared-config.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"shared-config",
|
|
7
|
+
"mdat-config",
|
|
8
|
+
"markdown",
|
|
9
|
+
"readme",
|
|
10
|
+
"mdat",
|
|
11
|
+
"cli",
|
|
12
|
+
"kpi",
|
|
13
|
+
"kpi-mdat"
|
|
14
|
+
],
|
|
15
|
+
"bugs": "https://github.com/kitschpatrol/shared-config/issues",
|
|
6
16
|
"repository": {
|
|
7
17
|
"type": "git",
|
|
8
18
|
"url": "git+https://github.com/kitschpatrol/shared-config/cli.git",
|
|
9
19
|
"directory": "packages/mdat-config"
|
|
10
20
|
},
|
|
11
|
-
"
|
|
21
|
+
"license": "MIT",
|
|
12
22
|
"author": {
|
|
13
23
|
"name": "Eric Mika",
|
|
14
24
|
"email": "eric@ericmika.com",
|
|
15
25
|
"url": "https://ericmika.com"
|
|
16
26
|
},
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
27
|
+
"type": "module",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"import": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts"
|
|
32
|
+
}
|
|
21
33
|
},
|
|
34
|
+
"main": "dist/index.js",
|
|
35
|
+
"types": "dist/index.d.ts",
|
|
22
36
|
"bin": {
|
|
23
|
-
"mdat
|
|
37
|
+
"kpi-mdat": "bin/cli.js"
|
|
24
38
|
},
|
|
25
|
-
"main": "dist/mdat.config.js",
|
|
26
|
-
"types": "dist/mdat.config.d.ts",
|
|
27
39
|
"files": [
|
|
28
40
|
"bin/*",
|
|
29
41
|
"dist/*",
|
|
30
42
|
"init/*"
|
|
31
43
|
],
|
|
32
|
-
"keywords": [
|
|
33
|
-
"shared-config",
|
|
34
|
-
"mdat-config",
|
|
35
|
-
"markdown",
|
|
36
|
-
"readme",
|
|
37
|
-
"mdat",
|
|
38
|
-
"cli"
|
|
39
|
-
],
|
|
40
|
-
"peerDependencies": {
|
|
41
|
-
"mdat": "^0.8.0"
|
|
42
|
-
},
|
|
43
44
|
"dependencies": {
|
|
44
45
|
"@pinojs/json-colorizer": "^4.0.0",
|
|
45
46
|
"cosmiconfig": "^9.0.0",
|
|
46
|
-
"execa": "^
|
|
47
|
-
"
|
|
47
|
+
"execa": "^9.5.2",
|
|
48
|
+
"find-workspaces": "^0.3.1",
|
|
49
|
+
"fs-extra": "^11.3.0",
|
|
50
|
+
"mdat": "^0.10.0",
|
|
51
|
+
"prettier": "^3.4.2"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=22.0.0",
|
|
55
|
+
"pnpm": ">=10.0.0"
|
|
48
56
|
},
|
|
49
57
|
"publishConfig": {
|
|
50
58
|
"access": "public"
|
|
51
59
|
},
|
|
52
60
|
"scripts": {
|
|
53
|
-
"build": "tsc && ../../scripts/build.ts
|
|
61
|
+
"build": "tsc && ../../scripts/build.ts",
|
|
54
62
|
"cli": "node ./bin/cli.js"
|
|
55
63
|
}
|
|
56
64
|
}
|
package/readme.md
CHANGED
|
@@ -21,9 +21,17 @@
|
|
|
21
21
|
|
|
22
22
|
## Overview
|
|
23
23
|
|
|
24
|
-
It's a shared [MDAT (Markdown Autophagic Template)](https://github.com/kitschpatrol/mdat) system config.
|
|
24
|
+
It's a shared [MDAT (Markdown Autophagic Template)](https://github.com/kitschpatrol/mdat) system config, plus a command-line tool `kpi-mdat` to perform mdat-related project initialization, linting, and fixing.
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
<!-- recommendation -->
|
|
27
|
+
|
|
28
|
+
> [!Important]
|
|
29
|
+
>
|
|
30
|
+
> **You can use this package on its own, but it's recommended to use [`@kitschpatrol/shared-config`](https://www.npmjs.com/package/@kitschpatrol/shared-config) instead for a single-dependency and single-package approach to linting and fixing your project.**
|
|
31
|
+
>
|
|
32
|
+
> This package is included as a dependency in [`@kitschpatrol/shared-config`](https://www.npmjs.com/package/@kitschpatrol/shared-config), which also automatically invokes the command line functionality in this package via its `kpi` command
|
|
33
|
+
|
|
34
|
+
<!-- /recommendation -->
|
|
27
35
|
|
|
28
36
|
## Setup
|
|
29
37
|
|
|
@@ -32,7 +40,7 @@ To use just `mdat-config` in isolation:
|
|
|
32
40
|
1. Install the `.npmrc` in your project root. This is required for correct PNPM behavior:
|
|
33
41
|
|
|
34
42
|
```sh
|
|
35
|
-
pnpm dlx @kitschpatrol/repo-config
|
|
43
|
+
pnpm dlx @kitschpatrol/repo-config init
|
|
36
44
|
```
|
|
37
45
|
|
|
38
46
|
2. Add the package:
|
|
@@ -44,7 +52,7 @@ To use just `mdat-config` in isolation:
|
|
|
44
52
|
3. Add the starter `.mdatrc.ts` file to your project root, and add any customizations you'd like:
|
|
45
53
|
|
|
46
54
|
```sh
|
|
47
|
-
pnpm exec mdat
|
|
55
|
+
pnpm exec kpi-mdat init
|
|
48
56
|
```
|
|
49
57
|
|
|
50
58
|
## Usage
|
|
@@ -56,9 +64,11 @@ You can call it directly, or use the script bundled with the config.
|
|
|
56
64
|
Integrate with your `package.json` scripts as you see fit, for example:
|
|
57
65
|
|
|
58
66
|
```json
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
67
|
+
{
|
|
68
|
+
"scripts": {
|
|
69
|
+
"lint": "kpi-mdat lint",
|
|
70
|
+
"fix": "kpi-mdat fix"
|
|
71
|
+
}
|
|
62
72
|
}
|
|
63
73
|
```
|
|
64
74
|
|
|
@@ -66,28 +76,116 @@ Integrate with your `package.json` scripts as you see fit, for example:
|
|
|
66
76
|
|
|
67
77
|
It runs `mdat readme expand` to expand placeholder comments in your readme.md using the bundled [`mdat readme`](https://github.com/kitschpatrol/mdat/blob/main/packages/mdat/readme.md#the-mdat-readme-subcommand) expansion rules, plus custom rules provided by `mdat-config`'s `mdat.config.ts` file, plus any additional rules specified in the repository-specific `.mdatrc.ts` file.
|
|
68
78
|
|
|
79
|
+
### Configuration
|
|
80
|
+
|
|
81
|
+
To create a `mdat.config.ts` in your project root:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
pnpm exec kpi-mdat init
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
(Note that this will delete the `mdat` property in your `package.json`!)
|
|
88
|
+
|
|
89
|
+
_Or_
|
|
90
|
+
|
|
91
|
+
To create a `mdat` property in `package.json`:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
pnpm exec kpi-mdat init --location package
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
(Note that this will delete the `mdat.config.ts` file in your project root!)
|
|
98
|
+
|
|
69
99
|
### CLI
|
|
70
100
|
|
|
71
101
|
<!-- cli-help -->
|
|
72
102
|
|
|
73
|
-
#### Command: `mdat
|
|
103
|
+
#### Command: `kpi-mdat`
|
|
104
|
+
|
|
105
|
+
Kitschpatrol's Mdat shared configuration tools.
|
|
106
|
+
|
|
107
|
+
This section lists top-level commands for `kpi-mdat`.
|
|
108
|
+
|
|
109
|
+
Usage:
|
|
110
|
+
|
|
111
|
+
```txt
|
|
112
|
+
kpi-mdat <command>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
| Command | Description |
|
|
116
|
+
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
117
|
+
| `init` | Initialize by copying starter config files to your project root or to your package.json file. |
|
|
118
|
+
| `lint` | Validate that all Mdat content placeholders in your readme.md file(s) have been expanded. Package-scoped. In a monorepo, it will also run in all packages below the current working directory. |
|
|
119
|
+
| `fix` | Expand all Mdat content placeholders in your readme.md file(s). Package-scoped. In a monorepo, it will also run in all packages below the current working directory. |
|
|
120
|
+
| `print-config` | Print the effective Mdat configuration. Package-scoped.. Searches up to the root of a monorepo if necessary.. Includes configuration provided by the `mdat readme` command. |
|
|
121
|
+
|
|
122
|
+
| Option | Description | Type |
|
|
123
|
+
| ------------------- | ------------------- | --------- |
|
|
124
|
+
| `--help`<br>`-h` | Show help | `boolean` |
|
|
125
|
+
| `--version`<br>`-v` | Show version number | `boolean` |
|
|
126
|
+
|
|
127
|
+
_See the sections below for more information on each subcommand._
|
|
128
|
+
|
|
129
|
+
#### Subcommand: `kpi-mdat init`
|
|
130
|
+
|
|
131
|
+
Initialize by copying starter config files to your project root or to your package.json file.
|
|
132
|
+
|
|
133
|
+
Usage:
|
|
134
|
+
|
|
135
|
+
```txt
|
|
136
|
+
kpi-mdat init
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
| Option | Description | Type | Default |
|
|
140
|
+
| ------------------- | ------------------- | -------------------- | -------- |
|
|
141
|
+
| `--location` | TK | `"file"` `"package"` | `"file"` |
|
|
142
|
+
| `--help`<br>`-h` | Show help | `boolean` | |
|
|
143
|
+
| `--version`<br>`-v` | Show version number | `boolean` | |
|
|
144
|
+
|
|
145
|
+
#### Subcommand: `kpi-mdat lint`
|
|
146
|
+
|
|
147
|
+
Validate that all Mdat content placeholders in your readme.md file(s) have been expanded. Package-scoped. In a monorepo, it will also run in all packages below the current working directory.
|
|
148
|
+
|
|
149
|
+
Usage:
|
|
150
|
+
|
|
151
|
+
```txt
|
|
152
|
+
kpi-mdat lint
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
| Option | Description | Type |
|
|
156
|
+
| ------------------- | ------------------- | --------- |
|
|
157
|
+
| `--help`<br>`-h` | Show help | `boolean` |
|
|
158
|
+
| `--version`<br>`-v` | Show version number | `boolean` |
|
|
159
|
+
|
|
160
|
+
#### Subcommand: `kpi-mdat fix`
|
|
161
|
+
|
|
162
|
+
Expand all Mdat content placeholders in your readme.md file(s). Package-scoped. In a monorepo, it will also run in all packages below the current working directory.
|
|
163
|
+
|
|
164
|
+
Usage:
|
|
165
|
+
|
|
166
|
+
```txt
|
|
167
|
+
kpi-mdat fix
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
| Option | Description | Type |
|
|
171
|
+
| ------------------- | ------------------- | --------- |
|
|
172
|
+
| `--help`<br>`-h` | Show help | `boolean` |
|
|
173
|
+
| `--version`<br>`-v` | Show version number | `boolean` |
|
|
174
|
+
|
|
175
|
+
#### Subcommand: `kpi-mdat print-config`
|
|
74
176
|
|
|
75
|
-
|
|
177
|
+
Print the effective Mdat configuration. Package-scoped.. Searches up to the root of a monorepo if necessary.. Includes configuration provided by the `mdat readme` command.
|
|
76
178
|
|
|
77
179
|
Usage:
|
|
78
180
|
|
|
79
181
|
```txt
|
|
80
|
-
mdat-config
|
|
182
|
+
kpi-mdat print-config
|
|
81
183
|
```
|
|
82
184
|
|
|
83
|
-
| Option
|
|
84
|
-
|
|
|
85
|
-
| `--
|
|
86
|
-
| `--
|
|
87
|
-
| `--init`<br>`-i` | | Initialize by copying starter config files to your project root. |
|
|
88
|
-
| `--print-config`<br>`-p` | `<path>` | Print the effective configuration at a certain path. |
|
|
89
|
-
| `--help`<br>`-h` | | Print this help info. |
|
|
90
|
-
| `--version`<br>`-v` | | Print the package version. |
|
|
185
|
+
| Option | Description | Type |
|
|
186
|
+
| ------------------- | ------------------- | --------- |
|
|
187
|
+
| `--help`<br>`-h` | Show help | `boolean` |
|
|
188
|
+
| `--version`<br>`-v` | Show version number | `boolean` |
|
|
91
189
|
|
|
92
190
|
<!-- /cli-help -->
|
|
93
191
|
|
package/dist/mdat.config.d.ts
DELETED
package/dist/mdat.config.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
rules: {
|
|
3
|
-
'shared-config': '## Project configuration\n\nThis project uses [@kitschpatrol/shared-config](https://github.com/kitschpatrol/shared-config) to consolidate various linting and formatting tool configurations under a single dependency and command. (ESLint, Prettier, CSpell, etc.)',
|
|
4
|
-
},
|
|
5
|
-
};
|