diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1ff8c234..5752a977 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -16,6 +16,7 @@ - [ ] Changeset for shipped changes: a file under `.changeset/` (documentation-only and workflow-only PRs need none) - [ ] Lint, test, typecheck, build: `pnpm lint`, `pnpm test`, `pnpm typecheck`, `pnpm build` - [ ] Browser bundle: `node scripts/check-browser-bundle.mjs` +- [ ] Duplicate code: `pnpm --filter @rivus/estela-schema run duplicates` (any reported clone fails) - [ ] Performance and size budgets, after `pnpm build`: `node scripts/check-budgets.mjs` (a change that outgrows a size budget raises it in `scripts/budgets/budgets.mjs` with the new number and reason) ## Risks diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24eaa4a4..3e2d1a01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,9 @@ jobs: # Both run the vite-plus from apps/cli's devDependencies, so they run after the install. - run: node scripts/format.mjs --check - run: node scripts/lint-scripts.mjs + # Fails on any clone jscpd reports (lint-config's zero-threshold profile). The scan roots and ignores live in the + # script in packages/schema/package.json. + - run: pnpm --filter @rivus/estela-schema run duplicates - run: node scripts/check-browser-bundle.mjs - name: Build Web once before CLI smoke tests run: pnpm --filter @rivus/estela-web run build diff --git a/.gitlab/merge_request_templates/default.md b/.gitlab/merge_request_templates/default.md index a6e4ae94..93d09add 100644 --- a/.gitlab/merge_request_templates/default.md +++ b/.gitlab/merge_request_templates/default.md @@ -16,6 +16,7 @@ - [ ] Changeset for shipped changes: a file under `.changeset/` (documentation-only and workflow-only MRs need none) - [ ] Lint, test, typecheck, build: `pnpm lint`, `pnpm test`, `pnpm typecheck`, `pnpm build` - [ ] Browser bundle: `node scripts/check-browser-bundle.mjs` +- [ ] Duplicate code: `pnpm --filter @rivus/estela-schema run duplicates` (any reported clone fails) - [ ] Performance and size budgets, after `pnpm build`: `node scripts/check-budgets.mjs` (a change that outgrows a size budget raises it in `scripts/budgets/budgets.mjs` with the new number and reason) ## Risks diff --git a/AGENTS.md b/AGENTS.md index 45ee4d76..c8cdb860 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -83,6 +83,7 @@ node scripts/lint-scripts.mjs pnpm lint pnpm test pnpm typecheck +pnpm --filter @rivus/estela-schema run duplicates pnpm build node scripts/check-layers.mjs node scripts/check-browser-bundle.mjs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe30cc3b..dbb48cb4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,6 +30,7 @@ node scripts/lint-scripts.mjs pnpm lint pnpm test pnpm typecheck +pnpm --filter @rivus/estela-schema run duplicates pnpm build cd apps/cli && pnpm run dev ``` @@ -281,6 +282,12 @@ A `vite-plus` upgrade also moves the catalog's `vite` entry (the vite-plus-core `apps/web`'s `rolldown` devDependency to that core's `bundledVersions.rolldown`; the CLI build fails while the `rolldown` pin differs. +The `test` job also runs `pnpm --filter @rivus/estela-schema run duplicates`: jscpd with lint-config's gate profile, +where any reported clone fails the run (the threshold is 0). The scan roots and ignores live in the script in +`packages/schema/package.json`: it skips `*.test.ts` unit tests but scans the e2e and smoke specs. +`pnpm --filter @rivus/estela-schema run duplicates:audit` writes a broader report, which also covers test files and +near-identical code, to the git-ignored `tmp/duplicates-audit/` and fails nothing. + `pnpm/setup@v3` caches the pnpm content-addressed store, keyed by the lockfile's content hash. Every run still executes `pnpm install --frozen-lockfile` and the checks. Installed workspace links, build outputs, credentials and CI results are not cached. Keep cache storage inside the included repository allowance. diff --git a/docs/development/setup.md b/docs/development/setup.md index 543b585d..dfb9b760 100644 --- a/docs/development/setup.md +++ b/docs/development/setup.md @@ -24,6 +24,7 @@ node scripts/format.mjs --check pnpm lint pnpm test pnpm typecheck +pnpm --filter @rivus/estela-schema run duplicates pnpm build node scripts/check-budgets.mjs ``` diff --git a/docs/development/setup.zh-CN.md b/docs/development/setup.zh-CN.md index 3d6e5b01..fba9669d 100644 --- a/docs/development/setup.zh-CN.md +++ b/docs/development/setup.zh-CN.md @@ -1,6 +1,6 @@ > 中文阅读版。以英文原文 docs/development/setup.md 为准。 - + # 开发 @@ -28,6 +28,7 @@ node scripts/format.mjs --check pnpm lint pnpm test pnpm typecheck +pnpm --filter @rivus/estela-schema run duplicates pnpm build node scripts/check-budgets.mjs ```