prev-cli 0.1.1 → 0.1.3
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/cli.js +19 -2
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -289,8 +289,25 @@ function findCliRoot2() {
|
|
|
289
289
|
}
|
|
290
290
|
return path4.dirname(path4.dirname(fileURLToPath2(import.meta.url)));
|
|
291
291
|
}
|
|
292
|
+
function findNodeModules(cliRoot2) {
|
|
293
|
+
const localNodeModules = path4.join(cliRoot2, "node_modules");
|
|
294
|
+
if (existsSync2(path4.join(localNodeModules, "react"))) {
|
|
295
|
+
return localNodeModules;
|
|
296
|
+
}
|
|
297
|
+
let dir = cliRoot2;
|
|
298
|
+
for (let i = 0;i < 10; i++) {
|
|
299
|
+
const parent = path4.dirname(dir);
|
|
300
|
+
if (parent === dir)
|
|
301
|
+
break;
|
|
302
|
+
if (path4.basename(parent) === "node_modules" && existsSync2(path4.join(parent, "react"))) {
|
|
303
|
+
return parent;
|
|
304
|
+
}
|
|
305
|
+
dir = parent;
|
|
306
|
+
}
|
|
307
|
+
return localNodeModules;
|
|
308
|
+
}
|
|
292
309
|
var cliRoot2 = findCliRoot2();
|
|
293
|
-
var cliNodeModules =
|
|
310
|
+
var cliNodeModules = findNodeModules(cliRoot2);
|
|
294
311
|
var srcRoot2 = path4.join(cliRoot2, "src");
|
|
295
312
|
async function createViteConfig(options) {
|
|
296
313
|
const { rootDir, mode, port } = options;
|
|
@@ -304,7 +321,7 @@ async function createViteConfig(options) {
|
|
|
304
321
|
remarkPlugins: [remarkGfm],
|
|
305
322
|
rehypePlugins: [
|
|
306
323
|
rehypeHighlight,
|
|
307
|
-
[rehypeMermaid, { strategy: "
|
|
324
|
+
[rehypeMermaid, { strategy: "pre-mermaid" }]
|
|
308
325
|
]
|
|
309
326
|
}),
|
|
310
327
|
react(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prev-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Transform MDX directories into beautiful documentation websites",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"clsx": "^2.1.0",
|
|
48
48
|
"fast-glob": "^3.3.0",
|
|
49
49
|
"lucide-react": "^0.460.0",
|
|
50
|
-
"
|
|
50
|
+
"mermaid": "^11.0.0",
|
|
51
51
|
"react": "^19.0.0",
|
|
52
52
|
"react-dom": "^19.0.0",
|
|
53
53
|
"react-router-dom": "^7.0.0",
|