figma-cache-toolchain 1.4.0 → 1.4.1

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.
Files changed (2) hide show
  1. package/README.md +39 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -46,6 +46,45 @@ npm run figma:cache:init
46
46
 
47
47
  ---
48
48
 
49
+ ## 升级 npm 包后推荐流程(业务项目)
50
+
51
+ 已在用本包时,**每升一次版本**建议在业务仓库根按下面做一遍,避免模板与配置长期落后。
52
+
53
+ ### 1. 升级依赖
54
+
55
+ ```bash
56
+ npm i -D figma-cache-toolchain@latest
57
+ ```
58
+
59
+ (或锁定具体版本号。)
60
+
61
+ ### 2. 刷新 Cursor 模板与说明文件
62
+
63
+ ```bash
64
+ npx figma-cache cursor init
65
+ ```
66
+
67
+ - 会刷新项目根 **`AGENT-SETUP-PROMPT.md`**、**`FIGMA_CACHE_DIR/colleague-guide-zh.md`**,并更新(或跳过)**`.cursor/`** 与根目录 **`figma-cache.config.example.js`**。
68
+ - 若需**强制覆盖**已存在的 `.cursor` 模板,使用 **`npx figma-cache cursor init --force`**(会覆盖已有规则文件,慎用)。
69
+
70
+ ### 3. 对齐 `figma-cache.config.js`(吃进新能力)
71
+
72
+ - **若正式配置是 `require` 包内示例**:一般**不必改文件**,升级后重新 `require` 即加载新逻辑。
73
+ - **若正式配置是当初复制/自写的**:根目录的 **`figma-cache.config.example.js`** 已是**最新对照**,请**合并**进 **`figma-cache.config.js`**(例如 1.4+ 的 **`docs/figma-flow-readme.md`**、`postEnsure` 的 **`ctx`** 扩展等),**勿整文件覆盖**导致丢失自定义钩子。
74
+ - 可在 Cursor 里 **`@figma-cache.config.example.js`** + **`@figma-cache.config.js`** + **`@AGENT-SETUP-PROMPT.md`**,让 Agent「按任务书检查补缺 + 合并示例新增部分」;大批量链接与业务流程文档写法见 **`figma-cache/colleague-guide-zh.md` §5.9~§5.10**。
75
+
76
+ ### 4. 索引与校验
77
+
78
+ - **已有** **`figma-cache/index.json`**:通常**不必**再跑 **`figma:cache:init`**。
79
+ - 执行 **`npm run figma-cache:validate`**(或 **`npx figma-cache validate`**)。
80
+ - 阅读 **`CHANGELOG.md`**(npm 包内或 GitHub)了解破坏性变更(若有)。
81
+
82
+ ### 5. 提交与协作
83
+
84
+ 将本次升级涉及的 **`package.json` / lock**、若合并过则 **`figma-cache.config.js`**、以及刷新后的 **`AGENT-SETUP-PROMPT.md` / `.cursor/` / `figma-cache/colleague-guide-zh.md`** 等按团队规范提交;**`figma-cache/files/`** 是否入库仍按原团队约定。
85
+
86
+ ---
87
+
49
88
  ## 更完整的说明在哪
50
89
 
51
90
  | 需求 | 文档(随包在 `node_modules/figma-cache-toolchain/figma-cache/`) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "figma-cache-toolchain",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Figma link normalization, local cache index, validation, and Node CLI (framework-agnostic core).",
5
5
  "homepage": "https://www.npmjs.com/package/figma-cache-toolchain",
6
6
  "keywords": [