starter-cleaner

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Starter Cleaner

Starter Cleaner

使用随技能提供的确定性脚本清理
wot-starter
v2,保留基础页面、Wot UI、
uni-echarts
和
echarts
能力。
Use the deterministic script provided with the skill to clean
wot-starter
v2 while retaining basic pages, Wot UI,
uni-echarts
, and
echarts
capabilities.

执行流程

Execution Workflow

  1. 在项目根目录运行
    git status --short
    ,确认并告知用户未提交改动会被保留,但待清理目录中的改动会随目录一起删除。
  2. 如果用户尚未明确要求执行清理,先说明这是破坏性操作并取得确认。
  3. 先预览清理计划:
    sh
    node .agents/skills/starter-cleaner/scripts/clean.js --dry-run
  4. 确认目标是
    wot-starter
    v2 后执行。脚本会删除旧的
    src/pages.json
    ,然后受控运行
    pnpm dev:h5
    ,等新的最小
    src/pages.json
    生成后退出 dev server:
    sh
    node .agents/skills/starter-cleaner/scripts/clean.js
  5. 执行
    pnpm install --lockfile-only
    更新锁文件,再运行
    pnpm type-check
    和
    pnpm lint
    。如果依赖不可用,至少检查
    git diff --check
    和清理后的 diff,并将未运行的验证明确告知用户。
  1. Run
    git status --short
    in the project root, then confirm with the user that uncommitted changes will be preserved, although changes within the directories scheduled for cleanup will be deleted along with those directories.
  2. If the user has not explicitly requested the cleanup, first explain that this is a destructive operation and obtain confirmation.
  3. Preview the cleanup plan:
    sh
    node .agents/skills/starter-cleaner/scripts/clean.js --dry-run
  4. After confirming that the target is
    wot-starter
    v2, execute the cleanup. The script deletes the old
    src/pages.json
    , then runs
    pnpm dev:h5
    in a controlled manner and exits the dev server after the new minimal
    src/pages.json
    is generated:
    sh
    node .agents/skills/starter-cleaner/scripts/clean.js
  5. Run
    pnpm install --lockfile-only
    to update the lock file, then run
    pnpm type-check
    and
    pnpm lint
    . If the dependencies are unavailable, at least inspect
    git diff --check
    and the cleaned diff, and explicitly inform the user which validation steps were not run.

清理范围

Cleanup Scope

脚本执行以下操作,且支持重复运行:
  • 删除
    docs/
    、
    src/subPages/
    、
    src/subEcharts/
    、
    src/subAsyncEcharts/
    。
  • 删除旧的
    src/pages.json
    ,再通过
    pnpm dev:h5
    触发
    vite-plugin-uni-pages
    重新生成最小页面配置。
  • 删除
    pnpm-workspace.yaml
    ,将项目从文档 workspace 恢复为单包项目。
  • 从
    vite.config.ts
    的
    UniHelperPages
    配置中移除上述三个示例分包入口。
  • 从
    package.json
    中移除
    docs:*
    与
    lint:docs
    脚本。
  • 保留
    uni-echarts
    、
    echarts
    依赖和相关 Vite 配置,方便业务继续使用图表。
The script performs the following operations and supports repeated execution:
  • Deletes
    docs/
    ,
    src/subPages/
    ,
    src/subEcharts/
    , and
    src/subAsyncEcharts/
    .
  • Deletes the old
    src/pages.json
    , then triggers
    vite-plugin-uni-pages
    through
    pnpm dev:h5
    to regenerate a minimal page configuration.
  • Deletes
    pnpm-workspace.yaml
    , restoring the project from a documentation workspace to a single-package project.
  • Removes the three example subpackage entry points above from the
    UniHelperPages
    configuration in
    vite.config.ts
    .
  • Removes the
    docs:*
    and
    lint:docs
    scripts from
    package.json
    .
  • Retains the
    uni-echarts
    and
    echarts
    dependencies and their related Vite configurations so that charts remain available for business use.

安全约束

Safety Constraints

  • 不直接拼接或扩展删除路径;仅使用脚本内的固定清单。
  • 不在非
    wot-starter
    v2 项目中运行。仅在用户明确确认目标项目后使用
    --force
    跳过项目身份检查。
  • 不用
    --force
    绕过未提交改动提示;该参数只用于项目身份检查。
  • Do not directly concatenate or expand deletion paths; use only the fixed list in the script.
  • Do not run in projects other than
    wot-starter
    v2. Use
    --force
    to skip the project identity check only after the user has explicitly confirmed the target project.
  • Do not use
    --force
    to bypass the uncommitted changes warning; this parameter is intended only for the project identity check.