Skip to content

chore: npm 包不再打入 examples/jeepay 语料 - #25

Merged
supermax92 merged 1 commit into
mainfrom
chore/20261008-exclude-examples-from-package
Oct 8, 2026
Merged

supermax92 merged 1 commit into
mainfrom
chore/20261008-exclude-examples-from-package

Conversation

@supermax92

Copy link
Copy Markdown
Owner

功能:插件运行时(CLI、生成与校验脚本、viewer)都不读取 examples/,它只是仓库内的测试与演示语料。本 PR 从 package.json 的 files 中移除 examples/jeepay/,包内文件 102 → 88,tgz 1018 KB → 997 KB,解压 3.45 MB → 3.28 MB。仓库里的 examples/jeepay/ 保持不变。

修改 3 个文件

  • package.json:files 删去 "examples/jeepay/" 一项。
  • skills/q-flow/references/graph-schema.md:时序示例指针由“仓库和包内”改为指向 GitHub main 上 examples/jeepay/sequence.graph.json 的链接,安装后的技能仍可查到示例。
  • tests/plugin-package.test.mjs:包内必需文件列表去掉 examples/jeepay/flowchart.graph.json,改为断言包内不含任何 examples/ 文件;对已安装包跑 validate / generate 的三处示例输入改为从仓库根读取。

验证:node --test tests/plugin-package.test.mjs 5/5 通过;npm pack --dry-run 改前 102 文件 / 1,018,403 B / 解压 3,451,800 B,改后 88 文件 / 997,258 B / 解压 3,277,126 B。未跑全量 Node 测试与浏览器矩阵。

注意:

  • 发布工作流 publish-github-npm.yml 的 npx 核对步骤本来就从 checkout 复制 flowchart.graph.json,不依赖包内示例,无需改动。
  • 包内的 README.md 与 docs/readme/ 6 份译文仍有指向 examples/jeepay 的相对链接和命令示例,在 npmjs / GitHub 页面上能正常解析,但在本地 node_modules 里打开会失效。这些内容本来就是写给克隆仓库的用户的,所以没有改。
  • 已发布的 0.0.7 不受影响,下一个版本发布后才生效。
  • 0.0.7 的 tgz 比 0.0.6 大约 177 KB,主要来自 viewer-dist/index.html 内联布局 Worker 时重复打包的排版代码。这一块不在本 PR 范围内。

插件运行时(CLI、生成与校验脚本、viewer)不读取 examples/,它只是仓库内的
测试与演示语料。从 package.json 的 files 中移除,包内文件 102 → 88,
解压体积 3.45 MB → 3.28 MB。

- graph-schema.md 的时序示例指针改为 GitHub 链接,安装后仍可查阅
- 打包测试改为断言包内不含 examples/,示例输入改从仓库读取
@supermax92
supermax92 merged commit 0ab127e into main Oct 8, 2026
2 checks passed
@supermax92
supermax92 deleted the chore/20261008-exclude-examples-from-package branch October 8, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant