From 445d7d037d770e1fe4ca76d6d681641e87c9ebe4 Mon Sep 17 00:00:00 2001 From: Bori-github Date: Tue, 28 Jul 2026 17:07:33 +0900 Subject: [PATCH] =?UTF-8?q?chore(scripts):=20=EC=97=90=EC=9D=B4=EC=A0=84?= =?UTF-8?q?=ED=8A=B8=EC=9A=A9=20=EA=B2=80=EC=A6=9D=20=EC=BB=A4=EB=A7=A8?= =?UTF-8?q?=EB=93=9C=20=EC=A0=95=EB=B9=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `pnpm test`가 watch 모드라 CI 밖에서 실행하면 종료되지 않았다. CI만 `--run`을 붙여 피해가고 있었고, 로컬·에이전트는 타임아웃까지 매달렸다. - test·test:coverage를 `vitest run`으로 바꾸고 watch는 test:watch로 분리 - 루트 test를 @zpl-kit/tests로 위임. 루트 vitest는 dist를, tests 패키지는 development 조건으로 src를 해석해 같은 테스트가 두 경로로 갈라져 있었다 - build:libs·verify 추가. verify는 build:libs → lint → format:check → type-check → test 순으로, exports가 dist를 가리키는 탓에 생기는 빌드 선행 조건을 스크립트 안에 넣는다 - 워크플로 3개도 같은 스크립트를 쓰도록 정리 Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/ci.yml | 11 +++++------ .github/workflows/publish-npm-react-zpl.yml | 9 +++------ .github/workflows/publish-npm-zpl-core.yml | 9 +++------ package.json | 5 ++++- tests/package.json | 5 +++-- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d61441..bb5d3c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,17 +57,16 @@ jobs: # 두 패키지의 exports가 dist를 가리키므로 type-check·test 모두 빌드가 선행되어야 한다. # react-zpl의 type-check는 zpl-core의 dist 타입을, tests는 react-zpl의 dist 타입을 참조한다. - - name: Build zpl-core - run: pnpm --filter @zpl-kit/zpl-core build - - - name: Build react-zpl - run: pnpm --filter @zpl-kit/react-zpl build + - name: Build libs + run: pnpm build:libs - name: Type check run: pnpm type-check + # 루트 `pnpm test`는 @zpl-kit/tests로 위임한다. 로컬 에이전트가 돌리는 + # `pnpm verify`와 같은 경로를 밟게 해서 CI에서만 재현되는 실패를 막는다. - name: Run tests - run: pnpm --filter @zpl-kit/tests test --run + run: pnpm test # docs는 tsconfig가 없어 `pnpm -r type-check`가 조용히 건너뛴다. # 빌드가 이 패키지의 유일한 검증 수단이고, 없으면 깨진 MDX·설정이 diff --git a/.github/workflows/publish-npm-react-zpl.yml b/.github/workflows/publish-npm-react-zpl.yml index 577858b..8239708 100644 --- a/.github/workflows/publish-npm-react-zpl.yml +++ b/.github/workflows/publish-npm-react-zpl.yml @@ -27,14 +27,11 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Build zpl-core - run: pnpm --filter @zpl-kit/zpl-core build - - - name: Build react-zpl - run: pnpm --filter @zpl-kit/react-zpl build + - name: Build libs + run: pnpm build:libs - name: Run tests - run: pnpm --filter @zpl-kit/tests test --run + run: pnpm test publish: needs: test diff --git a/.github/workflows/publish-npm-zpl-core.yml b/.github/workflows/publish-npm-zpl-core.yml index 7170cd9..7e3177a 100644 --- a/.github/workflows/publish-npm-zpl-core.yml +++ b/.github/workflows/publish-npm-zpl-core.yml @@ -27,14 +27,11 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Build zpl-core - run: pnpm --filter @zpl-kit/zpl-core build - - - name: Build react-zpl - run: pnpm --filter @zpl-kit/react-zpl build + - name: Build libs + run: pnpm build:libs - name: Run tests - run: pnpm --filter @zpl-kit/tests test --run + run: pnpm test publish: needs: test diff --git a/package.json b/package.json index 6702e69..1865fd1 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,10 @@ "demo:web": "pnpm --filter './demos/web' dev", "demo:electron": "pnpm --filter './demos/electron' dev", "build": "pnpm --filter @zpl-kit/zpl-core build && pnpm --filter './apps/*' --filter '!@zpl-kit/zpl-core' build && pnpm --filter './demos/*' build", - "test": "vitest", + "build:libs": "pnpm --filter @zpl-kit/zpl-core build && pnpm --filter @zpl-kit/react-zpl build", + "test": "pnpm --filter @zpl-kit/tests test", + "test:watch": "pnpm --filter @zpl-kit/tests test:watch", + "verify": "pnpm build:libs && pnpm lint && pnpm format:check && pnpm type-check && pnpm test", "type-check": "pnpm -r type-check", "lint": "oxlint --deny-warnings", "format": "prettier --write .", diff --git a/tests/package.json b/tests/package.json index eb8684a..102a108 100644 --- a/tests/package.json +++ b/tests/package.json @@ -4,9 +4,10 @@ "private": true, "type": "module", "scripts": { - "test": "vitest", + "test": "vitest run", + "test:watch": "vitest", "test:ui": "vitest --ui", - "test:coverage": "vitest --coverage", + "test:coverage": "vitest run --coverage", "type-check": "tsc --noEmit" }, "dependencies": {