@zpress/cli 0.3.3 → 0.3.4
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/145.mjs +774 -0
- package/dist/index.mjs +1 -725
- package/dist/watcher.mjs +8 -11
- package/package.json +7 -5
package/dist/watcher.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import node_path from "node:path";
|
|
|
3
3
|
import { cliLogger } from "@kidd-cli/core/logger";
|
|
4
4
|
import { loadConfig, sync } from "@zpress/core";
|
|
5
5
|
import { debounce } from "es-toolkit";
|
|
6
|
+
import { toError } from "./145.mjs";
|
|
6
7
|
const CONFIG_EXTENSIONS = [
|
|
7
8
|
'.ts',
|
|
8
9
|
'.mts',
|
|
@@ -24,12 +25,6 @@ const IGNORED_DIRS = new Set([
|
|
|
24
25
|
'dist',
|
|
25
26
|
'.turbo'
|
|
26
27
|
]);
|
|
27
|
-
function isMarkdownFile(filePath) {
|
|
28
|
-
return MARKDOWN_EXTENSIONS.some((ext)=>filePath.endsWith(ext));
|
|
29
|
-
}
|
|
30
|
-
function isIgnored(filePath) {
|
|
31
|
-
return filePath.split(node_path.sep).some((segment)=>IGNORED_DIRS.has(segment));
|
|
32
|
-
}
|
|
33
28
|
function createWatcher(initialConfig, paths, onConfigReload) {
|
|
34
29
|
const { repoRoot } = paths;
|
|
35
30
|
const configFileNames = new Set(CONFIG_EXTENSIONS.map((ext)=>`zpress.config${ext}`));
|
|
@@ -68,11 +63,7 @@ function createWatcher(initialConfig, paths, onConfigReload) {
|
|
|
68
63
|
if (didReloadConfig && onConfigReload) await onConfigReload(config);
|
|
69
64
|
} catch (error) {
|
|
70
65
|
consecutiveFailures += 1;
|
|
71
|
-
|
|
72
|
-
if (error instanceof Error) return error.message;
|
|
73
|
-
return String(error);
|
|
74
|
-
})();
|
|
75
|
-
cliLogger.error(`Sync error: ${errorMessage}`);
|
|
66
|
+
cliLogger.error(`Sync error: ${toError(error).message}`);
|
|
76
67
|
} finally{
|
|
77
68
|
syncing = false;
|
|
78
69
|
if (null !== pendingReloadConfig) if (consecutiveFailures >= MAX_CONSECUTIVE_FAILURES) {
|
|
@@ -114,4 +105,10 @@ function createWatcher(initialConfig, paths, onConfigReload) {
|
|
|
114
105
|
}
|
|
115
106
|
};
|
|
116
107
|
}
|
|
108
|
+
function isMarkdownFile(filePath) {
|
|
109
|
+
return MARKDOWN_EXTENSIONS.some((ext)=>filePath.endsWith(ext));
|
|
110
|
+
}
|
|
111
|
+
function isIgnored(filePath) {
|
|
112
|
+
return filePath.split(node_path.sep).some((segment)=>IGNORED_DIRS.has(segment));
|
|
113
|
+
}
|
|
117
114
|
export { createWatcher };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zpress/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "CLI for building and serving zpress documentation sites",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -34,17 +34,19 @@
|
|
|
34
34
|
"provenance": true
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@kidd-cli/core": "^0.
|
|
37
|
+
"@kidd-cli/core": "^0.7.0",
|
|
38
38
|
"@rspress/core": "^2.0.5",
|
|
39
39
|
"es-toolkit": "^1.45.1",
|
|
40
40
|
"ts-pattern": "^5.9.0",
|
|
41
41
|
"zod": "^4.3.6",
|
|
42
|
-
"@zpress/
|
|
43
|
-
"@zpress/
|
|
42
|
+
"@zpress/core": "0.7.0",
|
|
43
|
+
"@zpress/templates": "0.1.1",
|
|
44
|
+
"@zpress/ui": "0.7.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@rslib/core": "^0.20.0",
|
|
47
|
-
"typescript": "^5.9.3"
|
|
48
|
+
"typescript": "^5.9.3",
|
|
49
|
+
"vitest": "^4.1.0"
|
|
48
50
|
},
|
|
49
51
|
"engines": {
|
|
50
52
|
"node": ">=24.0.0"
|