pm-todos 0.1.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/CHANGELOG.md +7 -0
- package/README.md +95 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +255 -0
- package/dist/index.js.map +1 -0
- package/manifest.json +16 -0
- package/package.json +90 -0
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# pm-todos
|
|
2
|
+
|
|
3
|
+
Markdown TODO round-trip for [pm-cli](https://github.com/unbraind/pm-cli).
|
|
4
|
+
|
|
5
|
+
Import markdown checkboxes (`- [ ]` and `- [x]`) as pm items and export pm items back to markdown TODO lists.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pm install github.com/unbraind/pm-todos --global
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or install locally:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pm install github.com/unbraind/pm-todos
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Build manually:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/unbraind/pm-todos.git
|
|
25
|
+
cd pm-todos
|
|
26
|
+
npm install
|
|
27
|
+
npm run build
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Commands
|
|
33
|
+
|
|
34
|
+
### `pm todos import <file>`
|
|
35
|
+
|
|
36
|
+
Parse a markdown file for `- [ ]` and `- [x]` checkboxes and create pm items.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pm todos import TODO.md
|
|
40
|
+
pm todos import notes.md --dry-run
|
|
41
|
+
pm todos import backlog.md --type Task --priority 2
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Flags**
|
|
45
|
+
|
|
46
|
+
| Flag | Type | Description |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| `--dry-run` | boolean | Preview without writing |
|
|
49
|
+
| `--type <type>` | string | Item type (default: Task) |
|
|
50
|
+
| `--priority <n>` | number | Priority (0–4) |
|
|
51
|
+
| `--tags <tags>` | string | Comma-separated tags |
|
|
52
|
+
|
|
53
|
+
### `pm todos export`
|
|
54
|
+
|
|
55
|
+
Export pm items as a markdown TODO list.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pm todos export
|
|
59
|
+
pm todos export --output TODO.md
|
|
60
|
+
pm todos export --status open --output backlog.md
|
|
61
|
+
pm todos export --type Task
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Flags**
|
|
65
|
+
|
|
66
|
+
| Flag | Type | Description |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| `--output <file>` | string | Write to file instead of stdout |
|
|
69
|
+
| `--status <status>` | string | Filter by status |
|
|
70
|
+
| `--type <type>` | string | Filter by item type |
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Programmatic importer: `todos-import`
|
|
75
|
+
|
|
76
|
+
```jsonc
|
|
77
|
+
{
|
|
78
|
+
"importers": [
|
|
79
|
+
{
|
|
80
|
+
"name": "todos-import",
|
|
81
|
+
"config": { "file": "./TODO.md" }
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
MIT
|
|
92
|
+
|
|
93
|
+
## Release Automation
|
|
94
|
+
|
|
95
|
+
This package is release-ready for GitHub, npm, and Bun-compatible installs. CI runs type checking, build, production dependency audit, package packing, Bun install verification, and pm-changelog validation. The daily release workflow publishes only when commits exist after the latest release tag and uses pm-changelog to generate CHANGELOG.md and GitHub release notes.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;kBAwEgB,GAAG;;AAJnB,wBAuPG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
// pm-todos — Markdown TODO round-trip for pm-cli
|
|
2
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
const defineExtension = ((extension) => extension);
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Markdown TODO parser
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
const TODO_RE = /^(\s*)- \[([ xX])\] (.+)$/;
|
|
10
|
+
function parseMarkdownTodos(md) {
|
|
11
|
+
const lines = md.split("\n");
|
|
12
|
+
const todos = [];
|
|
13
|
+
for (let i = 0; i < lines.length; i++) {
|
|
14
|
+
const match = TODO_RE.exec(lines[i]);
|
|
15
|
+
if (match) {
|
|
16
|
+
todos.push({
|
|
17
|
+
indent: match[1].length,
|
|
18
|
+
checked: match[2] !== " ",
|
|
19
|
+
text: match[3].trim(),
|
|
20
|
+
lineNumber: i + 1,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return todos;
|
|
25
|
+
}
|
|
26
|
+
function mapStatusToPm(checked) {
|
|
27
|
+
return checked ? "closed" : "open";
|
|
28
|
+
}
|
|
29
|
+
function mapPmStatusToChecked(status) {
|
|
30
|
+
return status === "closed" || status === "canceled";
|
|
31
|
+
}
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
// Extension
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
export default defineExtension({
|
|
36
|
+
name: "pm-todos",
|
|
37
|
+
version: "0.1.0",
|
|
38
|
+
activate(api) {
|
|
39
|
+
// -----------------------------------------------------------------------
|
|
40
|
+
// Command: pm todos import <file>
|
|
41
|
+
// -----------------------------------------------------------------------
|
|
42
|
+
api.registerCommand({
|
|
43
|
+
name: "todos import",
|
|
44
|
+
description: "Import markdown TODO items (- [ ] and - [x]) as pm items. " +
|
|
45
|
+
"Each checkbox becomes a pm Task; checked items are closed.",
|
|
46
|
+
intent: "import markdown checkboxes as pm items",
|
|
47
|
+
examples: [
|
|
48
|
+
"pm todos import TODO.md",
|
|
49
|
+
"pm todos import notes.md --dry-run",
|
|
50
|
+
"pm todos import backlog.md --type Task",
|
|
51
|
+
],
|
|
52
|
+
flags: [
|
|
53
|
+
{ long: "--dry-run", description: "Preview without writing" },
|
|
54
|
+
{ long: "--type", value_name: "type", description: "Item type for imported items (default: Task)" },
|
|
55
|
+
{ long: "--priority", value_name: "n", description: "Priority for imported items (0-4)" },
|
|
56
|
+
{ long: "--tags", value_name: "tags", description: "Comma-separated tags to apply" },
|
|
57
|
+
],
|
|
58
|
+
async run(ctx) {
|
|
59
|
+
const filePath = ctx.args[0];
|
|
60
|
+
if (!filePath) {
|
|
61
|
+
console.error("Usage: pm todos import <file> [--dry-run] [--type Task]");
|
|
62
|
+
return { error: "No file path provided" };
|
|
63
|
+
}
|
|
64
|
+
const dryRun = Boolean(ctx.options["dry-run"]);
|
|
65
|
+
const itemType = ctx.options["type"] || "Task";
|
|
66
|
+
const priority = ctx.options["priority"];
|
|
67
|
+
const tags = ctx.options["tags"];
|
|
68
|
+
const absolutePath = resolve(filePath);
|
|
69
|
+
console.error(`Parsing markdown TODOs from: ${absolutePath}`);
|
|
70
|
+
let md;
|
|
71
|
+
try {
|
|
72
|
+
md = readFileSync(absolutePath, "utf-8");
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
76
|
+
console.error(`Failed to read file: ${msg}`);
|
|
77
|
+
return { error: msg };
|
|
78
|
+
}
|
|
79
|
+
const todos = parseMarkdownTodos(md);
|
|
80
|
+
if (todos.length === 0) {
|
|
81
|
+
console.error("No TODO items found in file.");
|
|
82
|
+
return { imported: 0, skipped: 0 };
|
|
83
|
+
}
|
|
84
|
+
let imported = 0;
|
|
85
|
+
let skipped = 0;
|
|
86
|
+
for (const todo of todos) {
|
|
87
|
+
if (dryRun) {
|
|
88
|
+
console.error(` [dry-run] ${todo.checked ? "[x]" : "[ ]"} ${todo.text}`);
|
|
89
|
+
imported++;
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
const spawnArgs = [
|
|
94
|
+
"--path", ctx.pm_root,
|
|
95
|
+
"create",
|
|
96
|
+
"--title", todo.text,
|
|
97
|
+
"--type", itemType,
|
|
98
|
+
"--status", mapStatusToPm(todo.checked),
|
|
99
|
+
"--description", `Imported from ${filePath} line ${todo.lineNumber}`,
|
|
100
|
+
];
|
|
101
|
+
if (priority)
|
|
102
|
+
spawnArgs.push("--priority", priority);
|
|
103
|
+
if (tags)
|
|
104
|
+
spawnArgs.push("--tags", tags);
|
|
105
|
+
const result = spawnSync("pm", spawnArgs, { encoding: "utf-8" });
|
|
106
|
+
if (result.status !== 0) {
|
|
107
|
+
throw new Error(result.stderr || "pm create failed");
|
|
108
|
+
}
|
|
109
|
+
imported++;
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
113
|
+
console.error(`Line ${todo.lineNumber}: create failed — ${msg}`);
|
|
114
|
+
skipped++;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (dryRun) {
|
|
118
|
+
console.error(`[dry-run] Would import ${imported} TODO item(s), skip ${skipped}.`);
|
|
119
|
+
return { dryRun: true, wouldImport: imported, wouldSkip: skipped };
|
|
120
|
+
}
|
|
121
|
+
console.error(`Imported ${imported} TODO item(s), skipped ${skipped}.`);
|
|
122
|
+
return { imported, skipped };
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
// -----------------------------------------------------------------------
|
|
126
|
+
// Command: pm todos export
|
|
127
|
+
// -----------------------------------------------------------------------
|
|
128
|
+
api.registerCommand({
|
|
129
|
+
name: "todos export",
|
|
130
|
+
description: "Export pm items as a markdown TODO list. " +
|
|
131
|
+
"Open items become - [ ], closed/canceled items become - [x].",
|
|
132
|
+
intent: "export pm items to markdown TODO format",
|
|
133
|
+
examples: [
|
|
134
|
+
"pm todos export",
|
|
135
|
+
"pm todos export --output TODO.md",
|
|
136
|
+
"pm todos export --status open --output backlog.md",
|
|
137
|
+
"pm todos export --type Task",
|
|
138
|
+
],
|
|
139
|
+
flags: [
|
|
140
|
+
{ long: "--output", value_name: "file", description: "Write markdown to file (default: stdout)" },
|
|
141
|
+
{ long: "--status", value_name: "status", description: "Filter by status" },
|
|
142
|
+
{ long: "--type", value_name: "type", description: "Filter by item type" },
|
|
143
|
+
],
|
|
144
|
+
async run(ctx) {
|
|
145
|
+
const outputPath = ctx.options["output"];
|
|
146
|
+
const statusFilter = ctx.options["status"];
|
|
147
|
+
const typeFilter = ctx.options["type"];
|
|
148
|
+
const spawnArgs = ["--path", ctx.pm_root, "list-all", "--json"];
|
|
149
|
+
console.error("Fetching pm items…");
|
|
150
|
+
const result = spawnSync("pm", spawnArgs, { encoding: "utf-8" });
|
|
151
|
+
if (result.status !== 0) {
|
|
152
|
+
const msg = result.stderr || "pm list-all failed";
|
|
153
|
+
console.error(msg);
|
|
154
|
+
return { error: msg };
|
|
155
|
+
}
|
|
156
|
+
let items = JSON.parse(result.stdout).items ?? [];
|
|
157
|
+
if (statusFilter) {
|
|
158
|
+
items = items.filter((i) => i.status === statusFilter);
|
|
159
|
+
}
|
|
160
|
+
if (typeFilter) {
|
|
161
|
+
items = items.filter((i) => i.type === typeFilter);
|
|
162
|
+
}
|
|
163
|
+
if (items.length === 0) {
|
|
164
|
+
console.error("No items found.");
|
|
165
|
+
return { exported: 0 };
|
|
166
|
+
}
|
|
167
|
+
const lines = [
|
|
168
|
+
"# TODO",
|
|
169
|
+
"",
|
|
170
|
+
`<!-- Exported from pm-cli on ${new Date().toISOString()} -->`,
|
|
171
|
+
"",
|
|
172
|
+
];
|
|
173
|
+
// Group: open first, then in_progress, then closed/canceled
|
|
174
|
+
const openItems = items.filter((i) => i.status === "open" || i.status === "in_progress" || i.status === "blocked" || i.status === "draft");
|
|
175
|
+
const closedItems = items.filter((i) => i.status === "closed" || i.status === "canceled");
|
|
176
|
+
if (openItems.length > 0) {
|
|
177
|
+
lines.push("## Open");
|
|
178
|
+
lines.push("");
|
|
179
|
+
for (const item of openItems) {
|
|
180
|
+
const check = mapPmStatusToChecked(item.status) ? "x" : " ";
|
|
181
|
+
const typeTag = item.type ? ` [${item.type}]` : "";
|
|
182
|
+
lines.push(`- [${check}] ${item.title}${typeTag} <!-- ${item.id} -->`);
|
|
183
|
+
}
|
|
184
|
+
lines.push("");
|
|
185
|
+
}
|
|
186
|
+
if (closedItems.length > 0) {
|
|
187
|
+
lines.push("## Done");
|
|
188
|
+
lines.push("");
|
|
189
|
+
for (const item of closedItems) {
|
|
190
|
+
lines.push(`- [x] ${item.title} <!-- ${item.id} -->`);
|
|
191
|
+
}
|
|
192
|
+
lines.push("");
|
|
193
|
+
}
|
|
194
|
+
const markdown = lines.join("\n");
|
|
195
|
+
if (outputPath) {
|
|
196
|
+
const absolutePath = resolve(outputPath);
|
|
197
|
+
writeFileSync(absolutePath, markdown, "utf-8");
|
|
198
|
+
console.error(`Exported ${items.length} item(s) to: ${absolutePath}`);
|
|
199
|
+
return { exported: items.length, file: absolutePath };
|
|
200
|
+
}
|
|
201
|
+
console.error(`Exported ${items.length} item(s).`);
|
|
202
|
+
return { exported: items.length, markdown };
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
// -----------------------------------------------------------------------
|
|
206
|
+
// Importer: todos-import
|
|
207
|
+
// -----------------------------------------------------------------------
|
|
208
|
+
api.registerImporter("todos-import", async (ctx) => {
|
|
209
|
+
const filePath = ctx.options["file"];
|
|
210
|
+
if (!filePath) {
|
|
211
|
+
console.error("todos-import: no 'file' provided — skipping.");
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const absolutePath = resolve(filePath);
|
|
215
|
+
console.error(`todos-import: reading ${absolutePath}`);
|
|
216
|
+
let md;
|
|
217
|
+
try {
|
|
218
|
+
md = readFileSync(absolutePath, "utf-8");
|
|
219
|
+
}
|
|
220
|
+
catch (err) {
|
|
221
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
222
|
+
console.error(`todos-import: failed to read — ${msg}`);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const todos = parseMarkdownTodos(md);
|
|
226
|
+
if (todos.length === 0) {
|
|
227
|
+
console.error("todos-import: no TODO items found — skipping.");
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
let imported = 0;
|
|
231
|
+
let skipped = 0;
|
|
232
|
+
for (const todo of todos) {
|
|
233
|
+
try {
|
|
234
|
+
const spawnArgs = [
|
|
235
|
+
"--path", ctx.pm_root,
|
|
236
|
+
"create",
|
|
237
|
+
"--title", todo.text,
|
|
238
|
+
"--type", "Task",
|
|
239
|
+
"--status", mapStatusToPm(todo.checked),
|
|
240
|
+
];
|
|
241
|
+
const result = spawnSync("pm", spawnArgs, { encoding: "utf-8" });
|
|
242
|
+
if (result.status !== 0) {
|
|
243
|
+
throw new Error(result.stderr || "pm create failed");
|
|
244
|
+
}
|
|
245
|
+
imported++;
|
|
246
|
+
}
|
|
247
|
+
catch (err) {
|
|
248
|
+
skipped++;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
console.error(`todos-import: done — imported ${imported}, skipped ${skipped}.`);
|
|
252
|
+
});
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAA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,EAAE,CAAC;gBACvB,OAAO,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;gBAC/D,OAAO;YACT,CAAC;YAED,IAAI,QAAQ,GAAG,CAAC,CAAC;YACjB,IAAI,OAAO,GAAG,CAAC,CAAC;YAEhB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,IAAI,CAAC;oBACH,MAAM,SAAS,GAAG;wBAChB,QAAQ,EAAE,GAAG,CAAC,OAAO;wBACrB,QAAQ;wBACR,SAAS,EAAE,IAAI,CAAC,IAAI;wBACpB,QAAQ,EAAE,MAAM;wBAChB,UAAU,EAAE,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC;qBACxC,CAAC;oBAEF,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;oBACjE,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;wBACxB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,kBAAkB,CAAC,CAAC;oBACvD,CAAC;oBACD,QAAQ,EAAE,CAAC;gBACb,CAAC;gBAAC,OAAO,GAAY,EAAE,CAAC;oBACtB,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC;YAED,OAAO,CAAC,KAAK,CAAC,iCAAiC,QAAQ,aAAa,OAAO,GAAG,CAAC,CAAC;QAClF,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
|
package/manifest.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pm-todos",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Markdown TODO round-trip. Import markdown checkboxes as pm items and export pm items back to markdown TODO lists.",
|
|
5
|
+
"author": "@unbraind",
|
|
6
|
+
"entry": "./dist/index.js",
|
|
7
|
+
"priority": 50,
|
|
8
|
+
"capabilities": [
|
|
9
|
+
"commands",
|
|
10
|
+
"schema",
|
|
11
|
+
"importers"
|
|
12
|
+
],
|
|
13
|
+
"pm": {
|
|
14
|
+
"compatibility": "v2"
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pm-todos",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Markdown TODO round-trip extension for pm-cli",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/unbraind/pm-todos.git"
|
|
8
|
+
},
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/unbraind/pm-todos/issues"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/unbraind/pm-todos#readme",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "dist/index.js",
|
|
15
|
+
"types": "dist/index.d.ts",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/",
|
|
18
|
+
"manifest.json",
|
|
19
|
+
"README.md",
|
|
20
|
+
"CHANGELOG.md"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"prepack": "npm run build",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"check": "npm run typecheck",
|
|
27
|
+
"audit:prod": "npm audit --omit=dev",
|
|
28
|
+
"pack:dry-run": "npm pack --dry-run",
|
|
29
|
+
"changelog": "pm-changelog --pm-root .agents/pm --mode prepend --output CHANGELOG.md --release-version-from-package --since-previous-tag --until-release-tag --item-url-base https://github.com/unbraind/pm-todos/blob/main/.agents/pm",
|
|
30
|
+
"changelog:full": "pm-changelog --pm-root .agents/pm --mode replace --output CHANGELOG.md --all-release-tags --release-version-from-package --item-url-base https://github.com/unbraind/pm-todos/blob/main/.agents/pm",
|
|
31
|
+
"changelog:check": "pm-changelog --pm-root .agents/pm --mode replace --output CHANGELOG.md --all-release-tags --release-version-from-package --item-url-base https://github.com/unbraind/pm-todos/blob/main/.agents/pm --check",
|
|
32
|
+
"release:check": "npm run typecheck && npm run build && npm run audit:prod && npm run pack:dry-run && npm run changelog:check"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@unbrained/pm-cli": ">=2026.5.24"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@unbrained/pm-cli": "^2026.5.24",
|
|
39
|
+
"typescript": "^6.0.3",
|
|
40
|
+
"pm-changelog": "^2026.5.25",
|
|
41
|
+
"@types/node": "^25.9.1"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"exporter",
|
|
45
|
+
"importer",
|
|
46
|
+
"markdown",
|
|
47
|
+
"pm-cli",
|
|
48
|
+
"pm-extension",
|
|
49
|
+
"pm-package",
|
|
50
|
+
"todo",
|
|
51
|
+
"todos"
|
|
52
|
+
],
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=20.0.0"
|
|
56
|
+
},
|
|
57
|
+
"author": "@unbraind",
|
|
58
|
+
"pm": {
|
|
59
|
+
"aliases": [
|
|
60
|
+
"todos"
|
|
61
|
+
],
|
|
62
|
+
"extensions": [
|
|
63
|
+
"."
|
|
64
|
+
],
|
|
65
|
+
"catalog": {
|
|
66
|
+
"display_name": "Markdown TODO Sync",
|
|
67
|
+
"category": "import-export",
|
|
68
|
+
"summary": "Markdown TODO round-trip extension for pm-cli",
|
|
69
|
+
"tags": [
|
|
70
|
+
"markdown",
|
|
71
|
+
"todo",
|
|
72
|
+
"import",
|
|
73
|
+
"export"
|
|
74
|
+
],
|
|
75
|
+
"links": {
|
|
76
|
+
"docs": "https://github.com/unbraind/pm-todos#readme",
|
|
77
|
+
"npm": "https://www.npmjs.com/package/pm-todos",
|
|
78
|
+
"repository": "https://github.com/unbraind/pm-todos",
|
|
79
|
+
"report": "https://github.com/unbraind/pm-todos/issues"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"docs": [
|
|
83
|
+
"README.md",
|
|
84
|
+
"CHANGELOG.md"
|
|
85
|
+
],
|
|
86
|
+
"examples": [
|
|
87
|
+
"README.md"
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
}
|