@leanmcp/cli 0.2.13 → 0.2.14
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/bin/leanmcp.js +1 -1
- package/dist/index.js +28 -4
- package/package.json +1 -1
package/bin/leanmcp.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -218,6 +218,17 @@ module.exports = {
|
|
|
218
218
|
plugins: [],
|
|
219
219
|
}
|
|
220
220
|
`);
|
|
221
|
+
const tsconfigPath = path2.join(tempDir, "tsconfig.json");
|
|
222
|
+
await fs2.writeFile(tsconfigPath, JSON.stringify({
|
|
223
|
+
compilerOptions: {
|
|
224
|
+
target: "ES2020",
|
|
225
|
+
jsx: "react-jsx",
|
|
226
|
+
module: "ESNext",
|
|
227
|
+
moduleResolution: "bundler",
|
|
228
|
+
skipLibCheck: true,
|
|
229
|
+
esModuleInterop: true
|
|
230
|
+
}
|
|
231
|
+
}, null, 2));
|
|
221
232
|
const stylesCss = path2.join(tempDir, "styles.css");
|
|
222
233
|
await fs2.writeFile(stylesCss, `
|
|
223
234
|
@tailwind base;
|
|
@@ -313,6 +324,15 @@ createRoot(document.getElementById('root')!).render(
|
|
|
313
324
|
react(),
|
|
314
325
|
viteSingleFile()
|
|
315
326
|
],
|
|
327
|
+
resolve: {
|
|
328
|
+
alias: {
|
|
329
|
+
// Resolve React from user's project node_modules
|
|
330
|
+
"react": path2.join(projectDir, "node_modules", "react"),
|
|
331
|
+
"react-dom": path2.join(projectDir, "node_modules", "react-dom"),
|
|
332
|
+
"react/jsx-runtime": path2.join(projectDir, "node_modules", "react", "jsx-runtime"),
|
|
333
|
+
"react/jsx-dev-runtime": path2.join(projectDir, "node_modules", "react", "jsx-dev-runtime")
|
|
334
|
+
}
|
|
335
|
+
},
|
|
316
336
|
css: {
|
|
317
337
|
postcss: {
|
|
318
338
|
plugins: [
|
|
@@ -439,11 +459,13 @@ async function devCommand() {
|
|
|
439
459
|
}
|
|
440
460
|
});
|
|
441
461
|
}
|
|
462
|
+
let isCleaningUp = false;
|
|
442
463
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
464
|
+
if (isCleaningUp) return;
|
|
465
|
+
isCleaningUp = true;
|
|
443
466
|
console.log(chalk.gray("\nShutting down..."));
|
|
444
467
|
if (watcher) watcher.close();
|
|
445
|
-
devServer.kill();
|
|
446
|
-
process.exit(0);
|
|
468
|
+
devServer.kill("SIGTERM");
|
|
447
469
|
}, "cleanup");
|
|
448
470
|
process.on("SIGINT", cleanup);
|
|
449
471
|
process.on("SIGTERM", cleanup);
|
|
@@ -531,10 +553,12 @@ async function startCommand() {
|
|
|
531
553
|
stdio: "inherit",
|
|
532
554
|
shell: true
|
|
533
555
|
});
|
|
556
|
+
let isCleaningUp = false;
|
|
534
557
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
558
|
+
if (isCleaningUp) return;
|
|
559
|
+
isCleaningUp = true;
|
|
535
560
|
console.log(chalk2.gray("\nShutting down..."));
|
|
536
|
-
server.kill();
|
|
537
|
-
process.exit(0);
|
|
561
|
+
server.kill("SIGTERM");
|
|
538
562
|
}, "cleanup");
|
|
539
563
|
process.on("SIGINT", cleanup);
|
|
540
564
|
process.on("SIGTERM", cleanup);
|