figma-cache-toolchain 1.3.1 → 1.3.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/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
通过 **npm** 分发的 Figma 本地缓存工具链:链接标准化、`figma-cache/` 索引与校验、零运行时依赖的 Node CLI。Core **不绑定**具体 UI 框架;表现层由 Agent 按你项目栈生成 **`figma-cache.config.js`** 与 **`.cursor/rules/02-figma-<栈>-adapter.mdc`**(见下方「三步走」)。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 消费方:四步完成适配(仅需 npm,无需克隆其它仓库)
|
|
6
6
|
|
|
7
7
|
以下路径均在**你的业务项目根目录**(已执行 `npm i -D figma-cache-toolchain` 或等价安装)。
|
|
8
8
|
|
|
@@ -22,15 +22,29 @@ npx figma-cache cursor init
|
|
|
22
22
|
|
|
23
23
|
- 会写入 / 更新:`.cursor/rules/`、`.cursor/skills/`、`figma-cache.config.example.js` 等(已存在则默认跳过,除非加 `--force`)。
|
|
24
24
|
- **每次**都会刷新项目根下的 **`AGENT-SETUP-PROMPT.md`**(由包内模板生成,含完整 Agent 指令)。
|
|
25
|
+
- 终端会提示下一步:请 **`@AGENT-SETUP-PROMPT.md`** 交给 Agent;**Agent 完成后再**执行第 4 步。
|
|
25
26
|
|
|
26
|
-
### 3. 交给 Cursor Agent
|
|
27
|
+
### 3. 交给 Cursor Agent(推荐唯一方式)
|
|
27
28
|
|
|
28
|
-
在 Cursor
|
|
29
|
+
在 Cursor 对话中输入 **`@AGENT-SETUP-PROMPT.md`**,并说明「按该文档执行」即可(每次 `cursor init` 都会刷新该文件,一般**不必**再整篇复制粘贴)。
|
|
29
30
|
|
|
30
|
-
-
|
|
31
|
-
- 全选文件内容,粘贴到 Agent。
|
|
31
|
+
Agent 将按文档自动:推断栈、生成/合并 **`figma-cache.config.js`**、生成栈专属 Adapter、**删除占位** `02-figma-stack-adapter.mdc`、按需补全 **`figma:cache:*` scripts** 等。
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
### 4. 初始化本地缓存索引(在 Agent 完成之后)
|
|
34
|
+
|
|
35
|
+
与第 2 步的 **`cursor init` 不同**:本步创建业务仓库根下的 **`figma-cache/index.json`**(空索引)及缓存目录,供后续 `ensure` / `get` 写入节点。
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm run figma:cache:init
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
若 Agent 尚未补全 `figma:cache:*` scripts,请改用:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx figma-cache init
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
然后可按需执行 **`npm run figma:cache:validate`**(或 `npx figma-cache validate`)。
|
|
34
48
|
|
|
35
49
|
更细的约定见随包安装的 **`figma-cache/migration-guide.md`**(在 `node_modules/figma-cache-toolchain/figma-cache/` 内,无需单独仓库)。
|
|
36
50
|
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
6. **收尾**
|
|
29
29
|
- 用简短列表向用户汇报:新建/修改/删除了哪些路径。
|
|
30
|
+
- 若项目根**尚无** `figma-cache/index.json`,提示用户执行:`npm run figma:cache:init`(若已加 script)或 `npx figma-cache init`(与 `cursor init` 不同,用于创建空索引与缓存目录)。
|
|
30
31
|
- 提示用户在本项目根执行:`npm run figma:cache:validate`(若已加 script)或 `npx figma-cache validate`。
|
|
31
32
|
- 说明:后续 Figma 相关对话将主要由 **01 Core + 新 Adapter + Skill** 驱动。
|
|
32
33
|
|
package/figma-cache/README.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
该目录集中管理 Figma 缓存流程(脚本、索引、规范、样例缓存)。
|
|
4
4
|
|
|
5
|
+
## 从 npm 包接入业务项目(顺序一览)
|
|
6
|
+
|
|
7
|
+
若通过 **`figma-cache-toolchain`** 安装(而非整仓拷贝本目录),推荐顺序为:
|
|
8
|
+
|
|
9
|
+
1. `npm i -D figma-cache-toolchain`
|
|
10
|
+
2. `npx figma-cache cursor init`(写入 `.cursor/` 等,并刷新根目录 **`AGENT-SETUP-PROMPT.md`**)
|
|
11
|
+
3. 在 Cursor 中 **`@AGENT-SETUP-PROMPT.md`** 并让 Agent 按文档执行(栈配置、Adapter、`figma:cache:*` scripts 等)
|
|
12
|
+
4. **`npm run figma:cache:init`**(若尚无 script,用 **`npx figma-cache init`**)→ 生成 **`figma-cache/index.json`**
|
|
13
|
+
|
|
14
|
+
说明:**`cursor init`** 与 **`figma-cache init`** 是两件事;后者才是本地缓存数据目录与空索引。仓库根 **`README.md`**(npm 包首页文档)中有与上述一致的「四步」说明。
|
|
15
|
+
|
|
5
16
|
## 使用方式(重要)
|
|
6
17
|
|
|
7
18
|
- 日常只需要把 Figma 链接发给 agent。
|
|
@@ -501,7 +501,7 @@ function copyCursorBootstrap(force) {
|
|
|
501
501
|
: "Done.",
|
|
502
502
|
agentPromptFile: normalizeSlash(agentDest),
|
|
503
503
|
agentPromptNote:
|
|
504
|
-
"AGENT-SETUP-PROMPT.md is refreshed every run
|
|
504
|
+
"AGENT-SETUP-PROMPT.md is refreshed every run. Next: @ it in Cursor; after Agent finishes, run npm run figma:cache:init (or npx figma-cache init if scripts are missing).",
|
|
505
505
|
npmPackageName: npmPkg,
|
|
506
506
|
},
|
|
507
507
|
null,
|
|
@@ -511,9 +511,12 @@ function copyCursorBootstrap(force) {
|
|
|
511
511
|
console.log(
|
|
512
512
|
"\n" +
|
|
513
513
|
"================================================================\n" +
|
|
514
|
-
"
|
|
515
|
-
"
|
|
516
|
-
"
|
|
514
|
+
"下一步(请按顺序):\n" +
|
|
515
|
+
"1) 在 Cursor 对话中输入 @AGENT-SETUP-PROMPT.md,并说明「按该文档执行」\n" +
|
|
516
|
+
" (每次 cursor init 都会刷新该文件;无需再整篇粘贴。)\n" +
|
|
517
|
+
"2) 待 Agent 完成后,在项目根初始化本地缓存索引:\n" +
|
|
518
|
+
" npm run figma:cache:init\n" +
|
|
519
|
+
" 若尚未补全 npm scripts,请改用:npx figma-cache init\n" +
|
|
517
520
|
"================================================================\n"
|
|
518
521
|
);
|
|
519
522
|
}
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
1. `npm i -D figma-cache-toolchain`
|
|
17
17
|
2. 在业务项目根:`npx figma-cache cursor init`(或已配置 script:`npm run figma:cache:cursor:init`)
|
|
18
|
-
3. 在 Cursor
|
|
18
|
+
3. 在 Cursor 对话中 **`@AGENT-SETUP-PROMPT.md`**,并说明「按该文档执行」(**每次** `cursor init` 都会从包内模板刷新该文件;一般不必再整篇粘贴)。Agent **按文档顺序**完成:生成/合并 `figma-cache.config.js`、栈专属 Adapter、**删除** `02-figma-stack-adapter.mdc`、补全 `figma:cache:*` scripts 等。
|
|
19
|
+
4. **Agent 完成后**,在项目根执行 **`npm run figma:cache:init`**(若尚无对应 script,用 **`npx figma-cache init`**),生成 **`figma-cache/index.json`**(空索引)及缓存目录;与第 2 步的 `cursor init` **不是**同一命令。
|
|
19
20
|
|
|
20
21
|
说明:Cursor **不会**在 `npm install` 时自动写入 `.cursor/`;`cursor init` 负责复制模板;**栈适配**由 Agent 执行 `AGENT-SETUP-PROMPT.md` 完成。若模板文件已存在,`cursor init` 默认**跳过**(加 `--force` 可覆盖);**`AGENT-SETUP-PROMPT.md` 不受跳过逻辑影响,每次 init 均刷新**,以便包升级后用户重新 `@` 同一文件即拿到最新指令。
|
|
21
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "figma-cache-toolchain",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
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": [
|