@karimsa/mdxserve 0.1.0 → 0.3.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/README.md +5 -0
- package/dist/cli.js +19 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -41,6 +41,11 @@ mdxserve setup # optional: installs the writing skill for Claude Code and C
|
|
|
41
41
|
(through `npx skills add`) and removes the MCP registration that older versions created. It is
|
|
42
42
|
safe to re-run; run it again after upgrading so the installed skill matches the CLI.
|
|
43
43
|
|
|
44
|
+
Interactive commands check for updates in the background at most once a day and show
|
|
45
|
+
cached update notices on startup. Updates are never installed automatically. Disable
|
|
46
|
+
checks with `--no-update-notifier` or `NO_UPDATE_NOTIFIER=1`. CI, noninteractive commands,
|
|
47
|
+
and `--json` output stay quiet.
|
|
48
|
+
|
|
44
49
|
## Quick start
|
|
45
50
|
|
|
46
51
|
```bash
|
package/dist/cli.js
CHANGED
|
@@ -4852,10 +4852,27 @@ function zxCommandRunner() {
|
|
|
4852
4852
|
};
|
|
4853
4853
|
}
|
|
4854
4854
|
|
|
4855
|
+
// src/cli/updates.ts
|
|
4856
|
+
async function notifyAboutUpdates() {
|
|
4857
|
+
if (!process.stdout.isTTY || !process.stderr.isTTY || "NO_UPDATE_NOTIFIER" in process.env || process.argv.some(
|
|
4858
|
+
(argument) => ["--json", "--no-update-notifier", "--version", "-V", "--help", "-h"].includes(argument)
|
|
4859
|
+
)) {
|
|
4860
|
+
return;
|
|
4861
|
+
}
|
|
4862
|
+
try {
|
|
4863
|
+
const { default: updateNotifier } = await import("update-notifier");
|
|
4864
|
+
updateNotifier({
|
|
4865
|
+
pkg: { name: "@karimsa/mdxserve", version: readPackageVersion() },
|
|
4866
|
+
updateCheckInterval: 24 * 60 * 60 * 1e3
|
|
4867
|
+
}).notify({ defer: false });
|
|
4868
|
+
} catch {
|
|
4869
|
+
}
|
|
4870
|
+
}
|
|
4871
|
+
|
|
4855
4872
|
// src/index.ts
|
|
4856
4873
|
var program = new Command();
|
|
4857
4874
|
var NOT_RUNNING = `mdxserve: ${NO_SERVER_MESSAGE}`;
|
|
4858
|
-
program.name("mdxserve").description("Serve a directory of Markdown/MDX files, like `serve` but for docs").version(readPackageVersion());
|
|
4875
|
+
program.name("mdxserve").option("--no-update-notifier", "disable update checks and notifications").description("Serve a directory of Markdown/MDX files, like `serve` but for docs").version(readPackageVersion());
|
|
4859
4876
|
program.command("serve", { isDefault: true }).description(
|
|
4860
4877
|
"Start the server; mount folders with -w (repeatable) or later with `mdxserve roots add <dir>`"
|
|
4861
4878
|
).option("-p, --port <n>", "port to listen on", "4040").option("--host <host>", "host to bind to (use 0.0.0.0 to expose on the LAN)", "127.0.0.1").option(
|
|
@@ -5088,4 +5105,5 @@ program.command("setup").description(
|
|
|
5088
5105
|
else console.log(`${cleanup.client} not found, skipping`);
|
|
5089
5106
|
}
|
|
5090
5107
|
});
|
|
5108
|
+
await notifyAboutUpdates();
|
|
5091
5109
|
await program.parseAsync(process.argv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@karimsa/mdxserve",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Serve a directory of Markdown/MDX files, like `serve` but for docs",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,9 +16,7 @@
|
|
|
16
16
|
"cli"
|
|
17
17
|
],
|
|
18
18
|
"type": "module",
|
|
19
|
-
"bin":
|
|
20
|
-
"mdxserve": "dist/cli.js"
|
|
21
|
-
},
|
|
19
|
+
"bin": "dist/cli.js",
|
|
22
20
|
"files": [
|
|
23
21
|
"dist",
|
|
24
22
|
"client",
|
|
@@ -92,6 +90,7 @@
|
|
|
92
90
|
"tailwindcss": "4.3.3",
|
|
93
91
|
"tippy.js": "6.3.7",
|
|
94
92
|
"trash": "10.1.1",
|
|
93
|
+
"update-notifier": "7.3.1",
|
|
95
94
|
"vfile-message": "4.0.3",
|
|
96
95
|
"vite": "8.2.1",
|
|
97
96
|
"zod": "4.4.3",
|
|
@@ -104,6 +103,7 @@
|
|
|
104
103
|
"@types/react": "19.2.18",
|
|
105
104
|
"@types/react-dom": "19.2.4",
|
|
106
105
|
"@types/svg-pan-zoom": "3.4.0",
|
|
106
|
+
"@types/update-notifier": "6.0.8",
|
|
107
107
|
"@yarnpkg/types": "4.0.1",
|
|
108
108
|
"esbuild": "0.28.2",
|
|
109
109
|
"fast-check": "4.9.0",
|