dk-frontend-skills 1.1.1 → 1.1.2

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.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "dk-engineer - 幽默沉稳靠谱的前端开发助手 Claude Skills 配置包,一键注入 .claude/ 技能目录和 CLAUDE.md 人设配置",
5
5
  "author": "XiaoMa",
6
6
  "license": "MIT",
@@ -282,38 +282,24 @@ if (fs.existsSync(logFile)) {
282
282
  }
283
283
 
284
284
  // 自动卸载
285
+ // 用 detached 子进程延迟卸载,避免在 npm 生命周期中自卸导致冲突
285
286
  console.log("🧹 自动卸载安装包...");
286
287
 
287
- try {
288
- // 同步卸载更可靠,不依赖 detached 子进程的 race condition
288
+ const uninstallCmd = `
289
+ const { execSync } = require("child_process");
290
+ setTimeout(() => {
289
291
  execSync("npm uninstall dk-frontend-skills", {
290
- cwd: projectRoot,
292
+ cwd: ${JSON.stringify(projectRoot)},
291
293
  windowsHide: true,
292
294
  stdio: "ignore",
293
295
  });
294
- console.log(" ✅ dk-frontend-skills 已卸载");
295
- } catch {
296
- // 有时 npm install 流程还没完全释放锁,延迟重试一次
297
- const child = spawn(
298
- process.execPath,
299
- [
300
- "-e",
301
- `
302
- const { execSync } = require("child_process");
303
- setTimeout(() => {
304
- execSync("npm uninstall dk-frontend-skills", {
305
- cwd: ${JSON.stringify(projectRoot)},
306
- windowsHide: true,
307
- stdio: "ignore",
308
- });
309
- }, 1000);
310
- `,
311
- ],
312
- {
313
- detached: true,
314
- stdio: "ignore",
315
- windowsHide: process.platform === "win32",
316
- },
317
- );
318
- child.unref();
319
- }
296
+ }, 500);
297
+ `;
298
+
299
+ const child = spawn(process.execPath, ["-e", uninstallCmd], {
300
+ cwd: projectRoot,
301
+ detached: true,
302
+ stdio: "ignore",
303
+ windowsHide: process.platform === "win32",
304
+ });
305
+ child.unref();