dk-frontend-skills 1.0.4 → 1.0.5
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/package.json +1 -1
- package/scripts/copy-skills.js +19 -2
package/package.json
CHANGED
package/scripts/copy-skills.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const fs = require("fs");
|
|
2
2
|
const path = require("path");
|
|
3
|
-
const { execSync } = require("child_process");
|
|
3
|
+
const { execSync, spawn } = require("child_process");
|
|
4
4
|
|
|
5
5
|
// 获取用户项目根目录
|
|
6
6
|
const projectRoot = path.resolve(__dirname, "..", "..", "..");
|
|
@@ -70,4 +70,21 @@ console.log(" - CLAUDE.md");
|
|
|
70
70
|
|
|
71
71
|
// 拷贝完成,不再需要本包,自动卸载
|
|
72
72
|
console.log("🧹 清理安装包...");
|
|
73
|
-
|
|
73
|
+
// 用 detached 子进程延迟卸载,避免在 npm install 生命周期中自卸导致冲突
|
|
74
|
+
const child = spawn(process.execPath, [
|
|
75
|
+
"-e",
|
|
76
|
+
`
|
|
77
|
+
const { execSync } = require("child_process");
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
execSync("npm uninstall dk-frontend-skills", {
|
|
80
|
+
cwd: ${JSON.stringify(projectRoot)},
|
|
81
|
+
stdio: "inherit"
|
|
82
|
+
});
|
|
83
|
+
}, 1500);
|
|
84
|
+
`
|
|
85
|
+
], {
|
|
86
|
+
detached: true,
|
|
87
|
+
stdio: "ignore",
|
|
88
|
+
windowsHide: true,
|
|
89
|
+
});
|
|
90
|
+
child.unref();
|