@san-siva/blogkit-md-cli 0.1.18 → 0.1.19
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +1 -0
- package/.next/build-manifest.json +6 -6
- package/.next/cache/.previewinfo +1 -1
- package/.next/cache/.rscinfo +1 -1
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/diagnostics/route-bundle-stats.json +27 -11
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +10 -1
- package/.next/server/app/[...slug]/page/app-paths-manifest.json +3 -0
- package/.next/server/app/[...slug]/page/build-manifest.json +17 -0
- package/.next/server/app/[...slug]/page/next-font-manifest.json +15 -0
- package/.next/server/app/[...slug]/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/[...slug]/page/server-reference-manifest.json +4 -0
- package/.next/server/app/[...slug]/page.js +15 -0
- package/.next/server/app/[...slug]/page.js.map +5 -0
- package/.next/server/app/[...slug]/page.js.nft.json +1 -0
- package/.next/server/app/[...slug]/page_client-reference-manifest.js +3 -0
- package/.next/server/app/_global-error/page/build-manifest.json +3 -3
- package/.next/server/app/_global-error/page.js +1 -1
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +7 -7
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/build-manifest.json +3 -3
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +7 -7
- package/.next/server/app/_not-found.segments/_full.segment.rsc +7 -7
- package/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/page/build-manifest.json +3 -3
- package/.next/server/app/page.js +3 -3
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__03je6ay._.js +29 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__03je6ay._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0d.jros._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__10tnqw0._.js.map → [root-of-the-server]__0d.jros._.js.map} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__09pq_q1._.js → [root-of-the-server]__0pxchyf._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0pxchyf._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0x9.wg7._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0x9.wg7._.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__0k-44~h._.js → [root-of-the-server]__0zel6gl._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0zel6gl._.js.map +1 -0
- package/.next/server/chunks/ssr/_0snb9u6._.js +6 -0
- package/.next/server/chunks/ssr/_0snb9u6._.js.map +1 -0
- package/.next/server/chunks/ssr/_0z4n825._.js +6 -0
- package/.next/server/chunks/ssr/_0z4n825._.js.map +1 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_[___slug]_page_actions_08-lz2w.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_[___slug]_page_actions_08-lz2w.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0-ca471._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0-ca471._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0.dkr44._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0.dkr44._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_04octt_._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_04octt_._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0c078.q._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0c078.q._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0cdd-yr._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0cdd-yr._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0db~o89._.js +5 -0
- package/.next/server/chunks/ssr/node_modules_0db~o89._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0e_79zm._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0e_79zm._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0ivb19g._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0ivb19g._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0kjv604._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0kjv604._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0m92vm.._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0m92vm.._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0o3pkfu._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0o3pkfu._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0p2z0dy._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0p2z0dy._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0r4wa9n._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0r4wa9n._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0t-k8i4._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0t-k8i4._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0x0lxgc._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0x0lxgc._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_0yngs2q._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0yngs2q._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_@san-siva_blogkit_dist_esm_025fiap._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_@san-siva_blogkit_dist_esm_025fiap._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_0h9llsw._.js +6 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_0h9llsw._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_0t-hj0x._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_0t-hj0x._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0wzs~wd.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0wzs~wd.js.map +1 -0
- package/.next/server/middleware-build-manifest.js +6 -6
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +8 -0
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/01xlw8hd842-c.js +1 -0
- package/.next/static/chunks/{0k~u_jyibvj9b.js → 061qfr813n13i.js} +1 -1
- package/.next/static/chunks/0mr~5~notxy69.js +1 -0
- package/.next/static/chunks/0n4z.7yu76je-.js +1 -0
- package/.next/static/chunks/0s_h50.6-5q6r.js +2 -0
- package/.next/static/chunks/{05qq.74x1z748.js → 15yu-awv-.t~z.js} +1 -1
- package/.next/static/chunks/{turbopack-0zo4i.ozxnr.3.js → turbopack-067_~051wvak1.js} +1 -1
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/.next/types/routes.d.ts +2 -1
- package/.next/types/validator.ts +9 -0
- package/README.md +10 -7
- package/bin/blogkit-md.js +31 -12
- package/package.json +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__00t_org._.js +0 -29
- package/.next/server/chunks/ssr/[root-of-the-server]__00t_org._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__09pq_q1._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0k-44~h._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__10tnqw0._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_0xdsm99._.js +0 -6
- package/.next/server/chunks/ssr/node_modules_next_dist_0xdsm99._.js.map +0 -1
- package/.next/static/chunks/0ikfpgi8w0w~0.js +0 -2
- package/.next/static/chunks/0o~269zocnb95.js +0 -1
- /package/.next/static/{uzoLd8gNNmlXzuoRQ0-T2 → m7wm4BjeEBuAMzrKArK94}/_buildManifest.js +0 -0
- /package/.next/static/{uzoLd8gNNmlXzuoRQ0-T2 → m7wm4BjeEBuAMzrKArK94}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{uzoLd8gNNmlXzuoRQ0-T2 → m7wm4BjeEBuAMzrKArK94}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -16,27 +16,30 @@ npm install -g @san-siva/blogkit-md-cli
|
|
|
16
16
|
## Usage
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
blogkit-md <path-to-markdown-file> [--port=<port>]
|
|
19
|
+
blogkit-md <path-to-markdown-file-or-directory> [--port=<port>]
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
### Arguments
|
|
23
23
|
|
|
24
|
-
| Argument
|
|
25
|
-
|
|
|
26
|
-
| `<path
|
|
27
|
-
| `--port=<port>`
|
|
24
|
+
| Argument | Description |
|
|
25
|
+
| --------------- | ------------------------------------------------------------------------------------------ |
|
|
26
|
+
| `<path>` | Path to a markdown file, or a directory containing markdown files (scanned recursively) |
|
|
27
|
+
| `--port=<port>` | Port to run the preview server on (default: random free port) |
|
|
28
28
|
|
|
29
29
|
### Examples
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
# Preview a markdown file
|
|
32
|
+
# Preview a single markdown file
|
|
33
33
|
blogkit-md ./posts/my-post.md
|
|
34
34
|
|
|
35
|
+
# Preview a directory — lists all .md files recursively; click any to render
|
|
36
|
+
blogkit-md ./posts
|
|
37
|
+
|
|
35
38
|
# Preview on a specific port
|
|
36
39
|
blogkit-md ./posts/my-post.md --port=3001
|
|
37
40
|
```
|
|
38
41
|
|
|
39
|
-
The browser will open automatically once the server is ready. The preview reloads whenever you save changes to the markdown file.
|
|
42
|
+
The browser will open automatically once the server is ready. The preview reloads whenever you save changes to the markdown file (or any markdown file under the directory).
|
|
40
43
|
|
|
41
44
|
## Requirements
|
|
42
45
|
|
package/bin/blogkit-md.js
CHANGED
|
@@ -28,16 +28,24 @@ var import_node_child_process = require("child_process");
|
|
|
28
28
|
var import_node_fs = require("fs");
|
|
29
29
|
var import_node_path = __toESM(require("path"));
|
|
30
30
|
var args = process.argv.slice(2);
|
|
31
|
-
var
|
|
31
|
+
var inputArg = args.find((a) => !a.startsWith("--"));
|
|
32
32
|
var portArg = args.find((a) => a.startsWith("--port="));
|
|
33
33
|
var requestedPort = portArg ? parseInt(portArg.split("=")[1]) : 0;
|
|
34
|
-
if (!
|
|
35
|
-
console.error("Usage: blogkit-md <path-to-markdown-file> [--port=3001]");
|
|
34
|
+
if (!inputArg) {
|
|
35
|
+
console.error("Usage: blogkit-md <path-to-markdown-file-or-directory> [--port=3001]");
|
|
36
36
|
process.exit(1);
|
|
37
37
|
}
|
|
38
38
|
var packageRoot = import_node_path.default.dirname(import_node_path.default.dirname(process.argv[1]));
|
|
39
|
-
var
|
|
39
|
+
var inputPath = import_node_path.default.resolve(process.cwd(), inputArg);
|
|
40
40
|
var nextBin = import_node_path.default.join(packageRoot, "node_modules/.bin/next");
|
|
41
|
+
var inputStat;
|
|
42
|
+
try {
|
|
43
|
+
inputStat = (0, import_node_fs.statSync)(inputPath);
|
|
44
|
+
} catch {
|
|
45
|
+
console.error(`Path does not exist: ${inputPath}`);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
var isDirectory = inputStat.isDirectory();
|
|
41
49
|
var clients = /* @__PURE__ */ new Set();
|
|
42
50
|
function getFreePort() {
|
|
43
51
|
return new Promise((resolve, reject) => {
|
|
@@ -63,15 +71,26 @@ var sseServer = (0, import_node_http.createServer)((req, res) => {
|
|
|
63
71
|
sseServer.listen(0, async () => {
|
|
64
72
|
const ssePort = sseServer.address().port;
|
|
65
73
|
const nextPort = requestedPort || await getFreePort();
|
|
66
|
-
const nextEnv = {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
const nextEnv = {
|
|
75
|
+
...process.env,
|
|
76
|
+
...isDirectory ? { MARKDOWN_DIR: inputPath } : { MARKDOWN_FILE: inputPath },
|
|
77
|
+
SSE_PORT: String(ssePort)
|
|
78
|
+
};
|
|
79
|
+
const broadcastReload = () => {
|
|
80
|
+
for (const client of clients) {
|
|
81
|
+
client.write("data: reload\n\n");
|
|
73
82
|
}
|
|
74
|
-
}
|
|
83
|
+
};
|
|
84
|
+
if (isDirectory) {
|
|
85
|
+
(0, import_node_fs.watch)(inputPath, { recursive: true }, (_, filename) => {
|
|
86
|
+
if (filename && filename.endsWith(".md")) broadcastReload();
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
const markdownFilename = import_node_path.default.basename(inputPath);
|
|
90
|
+
(0, import_node_fs.watch)(import_node_path.default.dirname(inputPath), (_, filename) => {
|
|
91
|
+
if (filename === markdownFilename) broadcastReload();
|
|
92
|
+
});
|
|
93
|
+
}
|
|
75
94
|
const child = (0, import_node_child_process.spawn)(nextBin, ["start", "--port", String(nextPort)], {
|
|
76
95
|
cwd: packageRoot,
|
|
77
96
|
env: nextEnv,
|