snow-ai 0.6.19 → 0.6.21

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-ai",
3
- "version": "0.6.19",
3
+ "version": "0.6.21",
4
4
  "description": "Agentic coding in your terminal",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "npm": ">=8.3.0"
29
29
  },
30
30
  "scripts": {
31
- "build": "tsc && node build.mjs",
31
+ "build": "node scripts/clean-build.cjs && tsc && node build.mjs",
32
32
  "build:ts": "tsc",
33
33
  "build:bundle": "node build.mjs",
34
34
  "dev": "tsc --watch",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-ai",
3
- "version": "0.6.19",
3
+ "version": "0.6.21",
4
4
  "description": "Agentic coding in your terminal",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "npm": ">=8.3.0"
29
29
  },
30
30
  "scripts": {
31
- "build": "tsc && node build.mjs",
31
+ "build": "node scripts/clean-build.cjs && tsc && node build.mjs",
32
32
  "build:ts": "tsc",
33
33
  "build:bundle": "node build.mjs",
34
34
  "dev": "tsc --watch",
@@ -0,0 +1,20 @@
1
+ /* eslint-disable unicorn/prefer-module */
2
+
3
+ /**
4
+ * 清理构建产物目录,避免 tsc 残留旧输出导致 bundle 与 source 不一致。
5
+ *
6
+ * 说明:
7
+ * - tsc 默认不会删除已不存在源文件对应的 dist 输出文件
8
+ * - build.mjs 依赖 dist/ 作为入口进行打包
9
+ * - 因此在 build 前清理 dist/ 与 bundle/ 可显著降低“幽灵文件”带来的回归风险
10
+ */
11
+
12
+ const fs = require('fs');
13
+
14
+ for (const dir of ['dist', 'bundle']) {
15
+ try {
16
+ fs.rmSync(dir, {recursive: true, force: true});
17
+ } catch {
18
+ // 清理失败不应阻断构建流程
19
+ }
20
+ }