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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dk-frontend-skills",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "dk-engineer - 幽默沉稳靠谱的前端开发助手 Claude Skills 配置包,一键注入 .claude/ 技能目录和 CLAUDE.md 人设配置",
5
5
  "author": "XiaoMa",
6
6
  "license": "MIT",
@@ -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
- execSync("npm uninstall dk-frontend-skills", { cwd: projectRoot, stdio: "inherit" });
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();