@plttn/mkd 0.0.2 → 0.1.5

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/index.cjs ADDED
@@ -0,0 +1,423 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ // If the importer is in node compatibility mode or this is not an ESM
19
+ // file that has been converted to a CommonJS file using a Babel-
20
+ // compatible transform (i.e. "__esModule" has not been set), then set
21
+ // "default" to the CommonJS "module.exports" for node compatibility.
22
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
+ mod
24
+ ));
25
+
26
+ // src/index.ts
27
+ var import_cmd_ts6 = require("cmd-ts");
28
+ var import_pwd_fs = require("pwd-fs");
29
+
30
+ // src/lib/deps.ts
31
+ var defaultConfig = {
32
+ blogDir: "./src/blog",
33
+ titleKey: "title",
34
+ author: "",
35
+ publishedAtKey: "publishedAt",
36
+ modifiedAtKey: "updatedAt",
37
+ authorKey: "author",
38
+ draftKey: "draft",
39
+ descriptionKey: "description",
40
+ tagsKey: "tags"
41
+ };
42
+ async function loadConfig(pfs) {
43
+ try {
44
+ const raw = await pfs.read("./mkd.json");
45
+ if (!raw.trim()) {
46
+ return defaultConfig;
47
+ }
48
+ const parsed = JSON.parse(raw);
49
+ if (!isRecord(parsed)) {
50
+ return defaultConfig;
51
+ }
52
+ const { $schema: _schema, ...config } = parsed;
53
+ return {
54
+ ...defaultConfig,
55
+ ...config
56
+ };
57
+ } catch {
58
+ return defaultConfig;
59
+ }
60
+ }
61
+ function isRecord(value) {
62
+ return typeof value === "object" && value !== null && !Array.isArray(value);
63
+ }
64
+
65
+ // src/commands/new.ts
66
+ var import_cmd_ts = require("cmd-ts");
67
+ var import_node_path = __toESM(require("path"), 1);
68
+ var import_slugify = __toESM(require("@sindresorhus/slugify"), 1);
69
+ var import_filenamify = __toESM(require("filenamify"), 1);
70
+ var import_gray_matter = __toESM(require("gray-matter"), 1);
71
+ var import_prompts = require("@clack/prompts");
72
+ function makeNewCommand({ config, pfs }) {
73
+ return (0, import_cmd_ts.command)({
74
+ name: "new",
75
+ description: "Create a new post",
76
+ args: {
77
+ new: (0, import_cmd_ts.restPositionals)({
78
+ type: import_cmd_ts.string,
79
+ displayName: "file",
80
+ description: "name of the new post"
81
+ })
82
+ },
83
+ handler: async ({ new: titleArray }) => {
84
+ (0, import_prompts.intro)("Create a new post");
85
+ let title;
86
+ if (titleArray.length === 0) {
87
+ title = await generateTitle();
88
+ if (title === "") {
89
+ return;
90
+ }
91
+ } else {
92
+ title = titleArray.join(" ");
93
+ }
94
+ const slug = (0, import_slugify.default)(title);
95
+ const fileName = (0, import_filenamify.default)(slug);
96
+ const frontmatter = await generateFrontmatter(title, config);
97
+ const filePath = import_node_path.default.join(config.blogDir, `${fileName}.md`);
98
+ await pfs.write(filePath, frontmatter);
99
+ }
100
+ });
101
+ }
102
+ async function generateFrontmatter(title, config) {
103
+ const description = await makeDescription(title);
104
+ const now = /* @__PURE__ */ new Date();
105
+ const data = {
106
+ [config.titleKey]: title,
107
+ [config.publishedAtKey]: now,
108
+ [config.authorKey]: config.author,
109
+ [config.draftKey]: true,
110
+ [config.descriptionKey]: description,
111
+ [config.tagsKey]: []
112
+ };
113
+ return import_gray_matter.default.stringify("", data);
114
+ }
115
+ async function makeDescription(title) {
116
+ const description = await (0, import_prompts.text)({
117
+ message: "Enter a description for the post:",
118
+ defaultValue: title
119
+ });
120
+ if ((0, import_prompts.isCancel)(description)) {
121
+ return "";
122
+ }
123
+ return description;
124
+ }
125
+ async function generateTitle() {
126
+ const title = await (0, import_prompts.text)({
127
+ message: "Enter a title for the post:",
128
+ validate: (value) => {
129
+ if (!value) {
130
+ return "Title required";
131
+ }
132
+ return void 0;
133
+ }
134
+ });
135
+ if ((0, import_prompts.isCancel)(title)) {
136
+ return "";
137
+ }
138
+ return title;
139
+ }
140
+
141
+ // src/commands/publish.ts
142
+ var import_cmd_ts2 = require("cmd-ts");
143
+ var import_prompts2 = require("@clack/prompts");
144
+ var import_gray_matter3 = __toESM(require("gray-matter"), 1);
145
+
146
+ // src/lib/commands.ts
147
+ var import_gray_matter2 = __toESM(require("gray-matter"), 1);
148
+ async function readPosts(pfs, config) {
149
+ const files = await pfs.readdir(config.blogDir);
150
+ const posts = [];
151
+ for (const file of files) {
152
+ const content = await pfs.read(`${config.blogDir}/${file}`);
153
+ posts.push({ file, content });
154
+ }
155
+ return posts;
156
+ }
157
+ function parseFrontmatter(post) {
158
+ const { data } = (0, import_gray_matter2.default)(post.content);
159
+ return data;
160
+ }
161
+ function postsToOptions(posts, config) {
162
+ return posts.map((post) => {
163
+ const fm = parseFrontmatter(post);
164
+ const title = String(fm[config.titleKey] ?? post.file);
165
+ return {
166
+ value: post.file,
167
+ label: title,
168
+ hint: post.file
169
+ };
170
+ });
171
+ }
172
+ function selectedValuesToPosts(selected, posts) {
173
+ if (typeof selected === "symbol") return [];
174
+ return posts.filter((p) => selected.includes(p.file));
175
+ }
176
+ function findPostByFile(posts, fileName) {
177
+ return posts.find((p) => p.file === fileName);
178
+ }
179
+
180
+ // src/commands/publish.ts
181
+ function makePublishCommand({ config, pfs }) {
182
+ return (0, import_cmd_ts2.command)({
183
+ name: "publish",
184
+ description: "Undraft a post",
185
+ args: {},
186
+ handler: async () => {
187
+ const posts = await readPosts(pfs, config);
188
+ const drafts = posts.filter(
189
+ (post) => parseFrontmatter(post)[config.draftKey] === true
190
+ );
191
+ const selected = await getPostsToPublish(drafts, config);
192
+ for (const draft of selected) {
193
+ await updateDraftFrontMatter(draft, { config, pfs });
194
+ }
195
+ }
196
+ });
197
+ }
198
+ async function getPostsToPublish(drafts, config) {
199
+ const options = postsToOptions(drafts, config);
200
+ (0, import_prompts2.intro)("Publishing posts");
201
+ const selected = await (0, import_prompts2.autocompleteMultiselect)({
202
+ message: "Select posts to publish",
203
+ options
204
+ });
205
+ if ((0, import_prompts2.isCancel)(selected)) {
206
+ (0, import_prompts2.outro)("Publishing cancelled.");
207
+ return [];
208
+ }
209
+ (0, import_prompts2.outro)("Posts undrafted...");
210
+ return selectedValuesToPosts(selected, drafts);
211
+ }
212
+ async function updateDraftFrontMatter(draft, deps) {
213
+ const parsed = (0, import_gray_matter3.default)(draft.content);
214
+ const fm = parsed.data;
215
+ fm[deps.config.draftKey] = false;
216
+ const updatedContent = import_gray_matter3.default.stringify(parsed.content, fm);
217
+ await deps.pfs.write(`${deps.config.blogDir}/${draft.file}`, updatedContent);
218
+ return { ...draft, content: updatedContent };
219
+ }
220
+
221
+ // src/commands/update.ts
222
+ var import_cmd_ts3 = require("cmd-ts");
223
+ var import_prompts3 = require("@clack/prompts");
224
+ var import_gray_matter4 = __toESM(require("gray-matter"), 1);
225
+ function makeUpdateCommand({ config, pfs }) {
226
+ return (0, import_cmd_ts3.command)({
227
+ name: "update",
228
+ description: "Update a post's modified date",
229
+ args: {},
230
+ handler: async () => {
231
+ const posts = await readPosts(pfs, config);
232
+ const post = await getPostToUpdate(posts, config);
233
+ if (!post) return;
234
+ await updatePostDate(post, { config, pfs });
235
+ }
236
+ });
237
+ }
238
+ async function getPostToUpdate(posts, config) {
239
+ const options = postsToOptions(posts, config);
240
+ (0, import_prompts3.intro)("Update a post");
241
+ const selected = await (0, import_prompts3.autocomplete)({
242
+ message: "Select post to update",
243
+ options
244
+ });
245
+ if ((0, import_prompts3.isCancel)(selected)) {
246
+ (0, import_prompts3.outro)("Update cancelled.");
247
+ return null;
248
+ }
249
+ (0, import_prompts3.outro)("Post updated.");
250
+ const found = findPostByFile(posts, selected);
251
+ return found ?? null;
252
+ }
253
+ async function updatePostDate(post, deps) {
254
+ const parsed = (0, import_gray_matter4.default)(post.content);
255
+ const fm = parsed.data;
256
+ fm[deps.config.modifiedAtKey] = /* @__PURE__ */ new Date();
257
+ const updatedContent = import_gray_matter4.default.stringify(parsed.content, fm);
258
+ await deps.pfs.write(`${deps.config.blogDir}/${post.file}`, updatedContent);
259
+ return { ...post, content: updatedContent };
260
+ }
261
+
262
+ // src/commands/unpublish.ts
263
+ var import_cmd_ts4 = require("cmd-ts");
264
+ var import_prompts4 = require("@clack/prompts");
265
+ var import_gray_matter5 = __toESM(require("gray-matter"), 1);
266
+ function makeUnPublishCommand({ config, pfs }) {
267
+ return (0, import_cmd_ts4.command)({
268
+ name: "unpublish",
269
+ description: "Unpublish a post",
270
+ args: {},
271
+ handler: async () => {
272
+ const posts = await readPosts(pfs, config);
273
+ const post = await getPostToUnpub(posts, config);
274
+ if (!post) return;
275
+ await unpubPost(post, { config, pfs });
276
+ }
277
+ });
278
+ }
279
+ async function getPostToUnpub(posts, config) {
280
+ const options = postsToOptions(posts, config);
281
+ (0, import_prompts4.intro)("Unpublish a post");
282
+ const selected = await (0, import_prompts4.autocomplete)({
283
+ message: "Select post to unpublish",
284
+ options
285
+ });
286
+ if ((0, import_prompts4.isCancel)(selected)) {
287
+ (0, import_prompts4.outro)("Unpublish cancelled.");
288
+ return null;
289
+ }
290
+ (0, import_prompts4.outro)("Post unpublished.");
291
+ const found = findPostByFile(posts, selected);
292
+ return found ?? null;
293
+ }
294
+ async function unpubPost(post, deps) {
295
+ const parsed = (0, import_gray_matter5.default)(post.content);
296
+ const fm = parsed.data;
297
+ fm[deps.config.draftKey] = true;
298
+ const updatedContent = import_gray_matter5.default.stringify(parsed.content, fm);
299
+ await deps.pfs.write(`${deps.config.blogDir}/${post.file}`, updatedContent);
300
+ return { ...post, content: updatedContent };
301
+ }
302
+
303
+ // src/commands/init.ts
304
+ var import_cmd_ts5 = require("cmd-ts");
305
+ var import_prompts5 = require("@clack/prompts");
306
+ function makeInitCommand({ config, pfs }) {
307
+ return (0, import_cmd_ts5.command)({
308
+ name: "init",
309
+ description: "Create or update mkd.json configuration",
310
+ args: {},
311
+ handler: async () => {
312
+ (0, import_prompts5.intro)("Initialize mkd configuration");
313
+ const blogDir = await (0, import_prompts5.text)({
314
+ message: "Directory where generated posts are written",
315
+ defaultValue: String(config.blogDir ?? "./src/blog")
316
+ });
317
+ if ((0, import_prompts5.isCancel)(blogDir)) {
318
+ (0, import_prompts5.outro)("Init cancelled");
319
+ return;
320
+ }
321
+ const author = await (0, import_prompts5.text)({
322
+ message: "Default author",
323
+ defaultValue: String(config.author ?? "")
324
+ });
325
+ if ((0, import_prompts5.isCancel)(author)) {
326
+ (0, import_prompts5.outro)("Init cancelled");
327
+ return;
328
+ }
329
+ const titleKey = await (0, import_prompts5.text)({
330
+ message: "Title frontmatter key",
331
+ defaultValue: String(config.titleKey ?? "title")
332
+ });
333
+ if ((0, import_prompts5.isCancel)(titleKey)) {
334
+ (0, import_prompts5.outro)("Init cancelled");
335
+ return;
336
+ }
337
+ const publishedAtKey = await (0, import_prompts5.text)({
338
+ message: "Published date frontmatter key",
339
+ defaultValue: String(config.publishedAtKey ?? "publishedAt")
340
+ });
341
+ if ((0, import_prompts5.isCancel)(publishedAtKey)) {
342
+ (0, import_prompts5.outro)("Init cancelled");
343
+ return;
344
+ }
345
+ const modifiedAtKey = await (0, import_prompts5.text)({
346
+ message: "Modified date frontmatter key",
347
+ defaultValue: String(config.modifiedAtKey ?? "updatedAt")
348
+ });
349
+ if ((0, import_prompts5.isCancel)(modifiedAtKey)) {
350
+ (0, import_prompts5.outro)("Init cancelled");
351
+ return;
352
+ }
353
+ const authorKey = await (0, import_prompts5.text)({
354
+ message: "Author frontmatter key",
355
+ defaultValue: String(config.authorKey ?? "author")
356
+ });
357
+ if ((0, import_prompts5.isCancel)(authorKey)) {
358
+ (0, import_prompts5.outro)("Init cancelled");
359
+ return;
360
+ }
361
+ const draftKey = await (0, import_prompts5.text)({
362
+ message: "Draft frontmatter key",
363
+ defaultValue: String(config.draftKey ?? "draft")
364
+ });
365
+ if ((0, import_prompts5.isCancel)(draftKey)) {
366
+ (0, import_prompts5.outro)("Init cancelled");
367
+ return;
368
+ }
369
+ const descriptionKey = await (0, import_prompts5.text)({
370
+ message: "Description frontmatter key",
371
+ defaultValue: String(config.descriptionKey ?? "description")
372
+ });
373
+ if ((0, import_prompts5.isCancel)(descriptionKey)) {
374
+ (0, import_prompts5.outro)("Init cancelled");
375
+ return;
376
+ }
377
+ const tagsKey = await (0, import_prompts5.text)({
378
+ message: "Tags frontmatter key",
379
+ defaultValue: String(config.tagsKey ?? "tags")
380
+ });
381
+ if ((0, import_prompts5.isCancel)(tagsKey)) {
382
+ (0, import_prompts5.outro)("Init cancelled");
383
+ return;
384
+ }
385
+ const newConfig = {
386
+ blogDir: String(blogDir),
387
+ author: String(author),
388
+ publishedAtKey: String(publishedAtKey),
389
+ modifiedAtKey: String(modifiedAtKey),
390
+ authorKey: String(authorKey),
391
+ draftKey: String(draftKey),
392
+ descriptionKey: String(descriptionKey),
393
+ tagsKey: String(tagsKey),
394
+ titleKey: String(titleKey)
395
+ };
396
+ await pfs.write("./mkd.json", JSON.stringify(newConfig, null, 2) + "\n");
397
+ (0, import_prompts5.outro)("Configuration saved to mkd.json");
398
+ }
399
+ });
400
+ }
401
+
402
+ // src/index.ts
403
+ async function main() {
404
+ const pfs = new import_pwd_fs.PoweredFileSystem();
405
+ const config = await loadConfig(pfs);
406
+ const deps = { config, pfs };
407
+ const app = (0, import_cmd_ts6.subcommands)({
408
+ name: "mkd",
409
+ cmds: {
410
+ new: makeNewCommand(deps),
411
+ publish: makePublishCommand(deps),
412
+ update: makeUpdateCommand(deps),
413
+ unpublish: makeUnPublishCommand(deps),
414
+ init: makeInitCommand(deps)
415
+ }
416
+ });
417
+ await (0, import_cmd_ts6.run)(app, process.argv.slice(2));
418
+ }
419
+ main().catch((error) => {
420
+ console.error(error);
421
+ process.exit(1);
422
+ });
423
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/lib/deps.ts","../src/commands/new.ts","../src/commands/publish.ts","../src/lib/commands.ts","../src/commands/update.ts","../src/commands/unpublish.ts","../src/commands/init.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { run, subcommands } from \"cmd-ts\";\nimport { PoweredFileSystem } from \"pwd-fs\";\nimport { loadConfig } from \"./lib/deps\";\nimport { makeNewCommand } from \"./commands/new\";\nimport { makePublishCommand } from \"./commands/publish\";\nimport { makeUpdateCommand } from \"./commands/update\";\nimport { makeUnPublishCommand } from \"./commands/unpublish\";\nimport { makeInitCommand } from \"./commands/init\";\n\nasync function main() {\n const pfs = new PoweredFileSystem();\n const config = await loadConfig(pfs);\n const deps = { config, pfs };\n\n const app = subcommands({\n name: \"mkd\",\n cmds: {\n new: makeNewCommand(deps),\n publish: makePublishCommand(deps),\n update: makeUpdateCommand(deps),\n unpublish: makeUnPublishCommand(deps),\n init: makeInitCommand(deps),\n },\n });\n\n await run(app, process.argv.slice(2));\n}\n\nmain().catch((error) => {\n console.error(error);\n process.exit(1);\n});\n","import type { PoweredFileSystem } from \"pwd-fs\";\n\nexport type Config = {\n blogDir: string;\n titleKey: string;\n author: string;\n publishedAtKey: string;\n modifiedAtKey: string;\n authorKey: string;\n draftKey: string;\n descriptionKey: string;\n tagsKey: string;\n};\n\nexport type Deps = {\n config: Config;\n pfs: PoweredFileSystem;\n};\n\nconst defaultConfig: Config = {\n blogDir: \"./src/blog\",\n titleKey: \"title\",\n author: \"\",\n publishedAtKey: \"publishedAt\",\n modifiedAtKey: \"updatedAt\",\n authorKey: \"author\",\n draftKey: \"draft\",\n descriptionKey: \"description\",\n tagsKey: \"tags\",\n};\n\nexport async function loadConfig(pfs: PoweredFileSystem): Promise<Config> {\n try {\n const raw = await pfs.read(\"./mkd.json\");\n\n if (!raw.trim()) {\n return defaultConfig;\n }\n\n const parsed = JSON.parse(raw);\n\n if (!isRecord(parsed)) {\n return defaultConfig;\n }\n\n const { $schema: _schema, ...config } = parsed;\n\n return {\n ...defaultConfig,\n ...config,\n };\n } catch {\n return defaultConfig;\n }\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { command, restPositionals, string } from \"cmd-ts\";\nimport path from \"node:path\";\nimport slugify from \"@sindresorhus/slugify\";\nimport filenamify from \"filenamify\";\nimport matter from \"gray-matter\";\nimport { isCancel, text, intro, outro } from \"@clack/prompts\";\nimport type { Config, Deps } from \"../lib/deps\";\n\nexport function makeNewCommand({ config, pfs }: Deps) {\n return command({\n name: \"new\",\n description: \"Create a new post\",\n args: {\n new: restPositionals({\n type: string,\n displayName: \"file\",\n description: \"name of the new post\",\n }),\n },\n handler: async ({ new: titleArray }) => {\n intro(\"Create a new post\");\n let title: string;\n if (titleArray.length === 0) {\n title = await generateTitle();\n if (title === \"\") {\n return;\n }\n } else {\n title = titleArray.join(\" \");\n }\n const slug = slugify(title);\n const fileName = filenamify(slug);\n const frontmatter = await generateFrontmatter(title, config);\n const filePath = path.join(config.blogDir, `${fileName}.md`);\n\n await pfs.write(filePath, frontmatter);\n },\n });\n}\n\nasync function generateFrontmatter(\n title: string,\n config: Config,\n): Promise<string> {\n const description = await makeDescription(title);\n const now = new Date();\n\n const data = {\n [config.titleKey]: title,\n [config.publishedAtKey]: now,\n [config.authorKey]: config.author,\n [config.draftKey]: true,\n [config.descriptionKey]: description,\n [config.tagsKey]: [],\n };\n\n return matter.stringify(\"\", data);\n}\n\nasync function makeDescription(title: string): Promise<string> {\n const description = await text({\n message: \"Enter a description for the post:\",\n defaultValue: title,\n });\n\n if (isCancel(description)) {\n return \"\";\n }\n\n return description;\n}\n\nasync function generateTitle(): Promise<string> {\n const title = await text({\n message: \"Enter a title for the post:\",\n validate: (value) => {\n if (!value) {\n return \"Title required\";\n }\n return undefined;\n },\n });\n\n if (isCancel(title)) {\n return \"\";\n }\n\n return title;\n}\n","import { command } from \"cmd-ts\";\nimport {\n autocompleteMultiselect,\n isCancel,\n intro,\n outro,\n} from \"@clack/prompts\";\nimport matter from \"gray-matter\";\nimport type { Config, Deps } from \"../lib/deps\";\nimport {\n readPosts,\n parseFrontmatter,\n postsToOptions,\n selectedValuesToPosts,\n Post,\n} from \"../lib/commands\";\n\nexport function makePublishCommand({ config, pfs }: Deps) {\n return command({\n name: \"publish\",\n description: \"Undraft a post\",\n args: {},\n handler: async () => {\n const posts = await readPosts(pfs, config);\n const drafts = posts.filter(\n (post) => parseFrontmatter(post)[config.draftKey] === true,\n );\n const selected = await getPostsToPublish(drafts, config);\n\n for (const draft of selected) {\n await updateDraftFrontMatter(draft, { config, pfs });\n }\n },\n });\n}\n\nasync function getPostsToPublish(\n drafts: Post[],\n config: Config,\n): Promise<Post[]> {\n const options = postsToOptions(drafts, config);\n intro(\"Publishing posts\");\n\n const selected = await autocompleteMultiselect({\n message: \"Select posts to publish\",\n options,\n });\n\n if (isCancel(selected)) {\n outro(\"Publishing cancelled.\");\n return [];\n }\n\n outro(\"Posts undrafted...\");\n\n return selectedValuesToPosts(selected, drafts);\n}\n\nasync function updateDraftFrontMatter(draft: Post, deps: Deps) {\n const parsed = matter(draft.content);\n const fm = parsed.data as Record<string, unknown>;\n fm[deps.config.draftKey] = false;\n const updatedContent = matter.stringify(parsed.content, fm);\n await deps.pfs.write(`${deps.config.blogDir}/${draft.file}`, updatedContent);\n return { ...draft, content: updatedContent };\n}\n","import matter from \"gray-matter\";\nimport type { Config, Deps } from \"./deps\";\n\nexport type Post = {\n file: string;\n content: string;\n};\n\nexport type Frontmatter = Record<string, unknown>;\n\n/** Read all files from the blog directory and return them as Post objects */\nexport async function readPosts(pfs: Deps[\"pfs\"], config: Config): Promise<Post[]> {\n const files = (await pfs.readdir(config.blogDir)) as string[];\n const posts: Post[] = [];\n\n for (const file of files) {\n const content = await pfs.read(`${config.blogDir}/${file}`);\n posts.push({ file, content });\n }\n\n return posts;\n}\n\n/** Parse frontmatter from a Post */\nexport function parseFrontmatter(post: Post): Frontmatter {\n const { data } = matter(post.content);\n return data as Frontmatter;\n}\n\n/** Convert Posts to prompt option objects (value/label/hint) */\nexport function postsToOptions(posts: Post[], config: Config) {\n return posts.map((post) => {\n const fm = parseFrontmatter(post);\n const title = String(fm[config.titleKey] ?? post.file);\n\n return {\n value: post.file,\n label: title,\n hint: post.file,\n };\n });\n}\n\n/** Take the raw selected values returned by the prompt and return matching Post[] */\nexport function selectedValuesToPosts(selected: string[] | symbol, posts: Post[]): Post[] {\n if (typeof selected === \"symbol\") return [];\n return posts.filter((p) => selected.includes(p.file));\n}\n\nexport function findPostByFile(posts: Post[], fileName: string): Post | undefined {\n return posts.find((p) => p.file === fileName);\n}\n","import { command } from \"cmd-ts\";\nimport { autocomplete, isCancel, intro, outro } from \"@clack/prompts\";\nimport matter from \"gray-matter\";\nimport type { Config, Deps } from \"../lib/deps\";\nimport {\n readPosts,\n postsToOptions,\n findPostByFile,\n Post,\n} from \"../lib/commands\";\n\ntype Frontmatter = Record<string, unknown>;\n\nexport function makeUpdateCommand({ config, pfs }: Deps) {\n return command({\n name: \"update\",\n description: \"Update a post's modified date\",\n args: {},\n handler: async () => {\n const posts = await readPosts(pfs, config);\n const post = await getPostToUpdate(posts, config);\n if (!post) return;\n\n await updatePostDate(post, { config, pfs });\n },\n });\n}\n\nasync function getPostToUpdate(\n posts: Post[],\n config: Config,\n): Promise<Post | null> {\n const options = postsToOptions(posts, config);\n\n intro(\"Update a post\");\n\n const selected = await autocomplete({\n message: \"Select post to update\",\n options,\n });\n\n if (isCancel(selected)) {\n outro(\"Update cancelled.\");\n return null;\n }\n outro(\"Post updated.\");\n\n const found = findPostByFile(posts, selected as string);\n return found ?? null;\n}\n\nasync function updatePostDate(post: Post, deps: Deps) {\n const parsed = matter(post.content);\n const fm = parsed.data as Record<string, unknown>;\n fm[deps.config.modifiedAtKey] = new Date();\n const updatedContent = matter.stringify(parsed.content, fm);\n await deps.pfs.write(`${deps.config.blogDir}/${post.file}`, updatedContent);\n return { ...post, content: updatedContent };\n}\n","import { command } from \"cmd-ts\";\nimport { autocomplete, isCancel, intro, outro } from \"@clack/prompts\";\nimport matter from \"gray-matter\";\nimport type { Config, Deps } from \"../lib/deps\";\nimport {\n readPosts,\n postsToOptions,\n findPostByFile,\n Post,\n} from \"../lib/commands\";\n\ntype Frontmatter = Record<string, unknown>;\n\nexport function makeUnPublishCommand({ config, pfs }: Deps) {\n return command({\n name: \"unpublish\",\n description: \"Unpublish a post\",\n args: {},\n handler: async () => {\n const posts = await readPosts(pfs, config);\n const post = await getPostToUnpub(posts, config);\n if (!post) return;\n\n await unpubPost(post, { config, pfs });\n },\n });\n}\n\nasync function getPostToUnpub(\n posts: Post[],\n config: Config,\n): Promise<Post | null> {\n const options = postsToOptions(posts, config);\n\n intro(\"Unpublish a post\");\n\n const selected = await autocomplete({\n message: \"Select post to unpublish\",\n options,\n });\n\n if (isCancel(selected)) {\n outro(\"Unpublish cancelled.\");\n return null;\n }\n outro(\"Post unpublished.\");\n\n const found = findPostByFile(posts, selected as string);\n return found ?? null;\n}\n\nasync function unpubPost(post: Post, deps: Deps) {\n const parsed = matter(post.content);\n const fm = parsed.data as Record<string, unknown>;\n fm[deps.config.draftKey] = true;\n const updatedContent = matter.stringify(parsed.content, fm);\n await deps.pfs.write(`${deps.config.blogDir}/${post.file}`, updatedContent);\n return { ...post, content: updatedContent };\n}\n","import { command } from \"cmd-ts\";\nimport { text, isCancel, intro, outro } from \"@clack/prompts\";\nimport type { Deps } from \"../lib/deps\";\n\nexport function makeInitCommand({ config, pfs }: Deps) {\n return command({\n name: \"init\",\n description: \"Create or update mkd.json configuration\",\n args: {},\n handler: async () => {\n intro(\"Initialize mkd configuration\");\n\n const blogDir = await text({\n message: \"Directory where generated posts are written\",\n defaultValue: String(config.blogDir ?? \"./src/blog\"),\n });\n if (isCancel(blogDir)) {\n outro(\"Init cancelled\");\n return;\n }\n\n const author = await text({\n message: \"Default author\",\n defaultValue: String(config.author ?? \"\"),\n });\n if (isCancel(author)) {\n outro(\"Init cancelled\");\n return;\n }\n\n const titleKey = await text({\n message: \"Title frontmatter key\",\n defaultValue: String(config.titleKey ?? \"title\"),\n });\n if (isCancel(titleKey)) {\n outro(\"Init cancelled\");\n return;\n }\n\n const publishedAtKey = await text({\n message: \"Published date frontmatter key\",\n defaultValue: String(config.publishedAtKey ?? \"publishedAt\"),\n });\n if (isCancel(publishedAtKey)) {\n outro(\"Init cancelled\");\n return;\n }\n\n const modifiedAtKey = await text({\n message: \"Modified date frontmatter key\",\n defaultValue: String(config.modifiedAtKey ?? \"updatedAt\"),\n });\n if (isCancel(modifiedAtKey)) {\n outro(\"Init cancelled\");\n return;\n }\n\n const authorKey = await text({\n message: \"Author frontmatter key\",\n defaultValue: String(config.authorKey ?? \"author\"),\n });\n if (isCancel(authorKey)) {\n outro(\"Init cancelled\");\n return;\n }\n\n const draftKey = await text({\n message: \"Draft frontmatter key\",\n defaultValue: String(config.draftKey ?? \"draft\"),\n });\n if (isCancel(draftKey)) {\n outro(\"Init cancelled\");\n return;\n }\n\n const descriptionKey = await text({\n message: \"Description frontmatter key\",\n defaultValue: String(config.descriptionKey ?? \"description\"),\n });\n if (isCancel(descriptionKey)) {\n outro(\"Init cancelled\");\n return;\n }\n\n const tagsKey = await text({\n message: \"Tags frontmatter key\",\n defaultValue: String(config.tagsKey ?? \"tags\"),\n });\n if (isCancel(tagsKey)) {\n outro(\"Init cancelled\");\n return;\n }\n\n const newConfig = {\n blogDir: String(blogDir),\n author: String(author),\n publishedAtKey: String(publishedAtKey),\n modifiedAtKey: String(modifiedAtKey),\n authorKey: String(authorKey),\n draftKey: String(draftKey),\n descriptionKey: String(descriptionKey),\n tagsKey: String(tagsKey),\n titleKey: String(titleKey),\n };\n\n await pfs.write(\"./mkd.json\", JSON.stringify(newConfig, null, 2) + \"\\n\");\n\n outro(\"Configuration saved to mkd.json\");\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,iBAAiC;AACjC,oBAAkC;;;ACiBlC,IAAM,gBAAwB;AAAA,EAC5B,SAAS;AAAA,EACT,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,WAAW;AAAA,EACX,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,SAAS;AACX;AAEA,eAAsB,WAAW,KAAyC;AACxE,MAAI;AACF,UAAM,MAAM,MAAM,IAAI,KAAK,YAAY;AAEvC,QAAI,CAAC,IAAI,KAAK,GAAG;AACf,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK,MAAM,GAAG;AAE7B,QAAI,CAAC,SAAS,MAAM,GAAG;AACrB,aAAO;AAAA,IACT;AAEA,UAAM,EAAE,SAAS,SAAS,GAAG,OAAO,IAAI;AAExC,WAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,SAAS,OAAkD;AAClE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;;;AC1DA,oBAAiD;AACjD,uBAAiB;AACjB,qBAAoB;AACpB,wBAAuB;AACvB,yBAAmB;AACnB,qBAA6C;AAGtC,SAAS,eAAe,EAAE,QAAQ,IAAI,GAAS;AACpD,aAAO,uBAAQ;AAAA,IACb,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM;AAAA,MACJ,SAAK,+BAAgB;AAAA,QACnB,MAAM;AAAA,QACN,aAAa;AAAA,QACb,a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MAC/C,CAAC;AACD,cAAI,0BAAS,OAAO,GAAG;AACrB,mCAAM,gBAAgB;AACtB;AAAA,MACF;AAEA,YAAM,YAAY;AAAA,QAChB,SAAS,OAAO,OAAO;AAAA,QACvB,QAAQ,OAAO,MAAM;AAAA,QACrB,gBAAgB,OAAO,cAAc;AAAA,QACrC,eAAe,OAAO,aAAa;AAAA,QACnC,WAAW,OAAO,SAAS;AAAA,QAC3B,UAAU,OAAO,QAAQ;AAAA,QACzB,gBAAgB,OAAO,cAAc;AAAA,QACrC,SAAS,OAAO,OAAO;AAAA,QACvB,UAAU,OAAO,QAAQ;AAAA,MAC3B;AAEA,YAAM,IAAI,MAAM,cAAc,KAAK,UAAU,WAAW,MAAM,CAAC,IAAI,IAAI;AAEvE,iCAAM,iCAAiC;AAAA,IACzC;AAAA,EACF,CAAC;AACH;;;APpGA,eAAe,OAAO;AACpB,QAAM,MAAM,IAAI,gCAAkB;AAClC,QAAM,SAAS,MAAM,WAAW,GAAG;AACnC,QAAM,OAAO,EAAE,QAAQ,IAAI;AAE3B,QAAM,UAAM,4BAAY;AAAA,IACtB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,KAAK,eAAe,IAAI;AAAA,MACxB,SAAS,mBAAmB,IAAI;AAAA,MAChC,QAAQ,kBAAkB,IAAI;AAAA,MAC9B,WAAW,qBAAqB,IAAI;AAAA,MACpC,MAAM,gBAAgB,IAAI;AAAA,IAC5B;AAAA,EACF,CAAC;AAED,YAAM,oBAAI,KAAK,QAAQ,KAAK,MAAM,CAAC,CAAC;AACtC;AAEA,KAAK,EAAE,MAAM,CAAC,UAAU;AACtB,UAAQ,MAAM,KAAK;AACnB,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["import_cmd_ts","slugify","filenamify","path","matter","import_cmd_ts","import_prompts","import_gray_matter","import_gray_matter","matter","matter","import_cmd_ts","import_prompts","import_gray_matter","matter","import_cmd_ts","import_prompts","import_gray_matter","matter","import_cmd_ts","import_prompts"]}
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/index.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  #!/usr/bin/env node
2
- export {};