@uiwwsw/next-test-mode 1.0.2 → 1.0.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.3 — 2026-11-26
4
+
5
+ - README (English and Korean) leads with testing real Next.js pages against any API response, adds how it differs from MSW, Playwright, Requestly and Draft Mode alone, who it fits, and planned work. No code changes.
6
+
3
7
  ## 1.0.2 — 2026-10-19
4
8
 
5
9
  - Move the public demo, localized SEO metadata, sample API, package homepage, documentation and deployment health checks to https://next-test-mode.vercel.app.
package/README.ko.md CHANGED
@@ -4,12 +4,12 @@
4
4
  <img src="https://raw.githubusercontent.com/uiwwsw/next-test-mode/v1.0.2/docs/assets/hero.png" width="100%" alt="Next Test Mode — 콘솔 한 줄로 서버 데이터까지 테스트." />
5
5
  </p>
6
6
  <p align="center">
7
- <strong>콘솔 한 줄로. 서버 데이터까지 테스트.</strong><br />
8
- One console command. Test server data, too.
7
+ <strong>어떤 API 응답으로든 실제 Next.js 페이지를 확인하세요.</strong><br />
8
+ 데브툴에서 API 데이터를 바꾸고, 서버가 그린 실제 화면을 보고, 앱 코드는 그대로 둡니다.
9
9
  </p>
10
10
  <p align="center">
11
11
  <a href="https://www.npmjs.com/package/@uiwwsw/next-test-mode"><img src="https://img.shields.io/npm/v/@uiwwsw/next-test-mode?style=flat-square&amp;color=173c36" alt="npm version" /></a>
12
- <a href="https://github.com/uiwwsw/next-test-mode/actions/workflows/ci.yml"><img src="https://github.com/uiwwsw/next-test-mode/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
12
+ <a href="https://github.com/uiwwsw/next-test-mode/actions/workflows/ci.yml"><img src="https://github.com/uiwwsw/next-test-mode/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI on main" /></a>
13
13
  <img src="https://img.shields.io/badge/Next.js-App_Router-173c36?style=flat-square" alt="Next.js App Router" />
14
14
  <a href="https://github.com/uiwwsw/next-test-mode/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-62796f?style=flat-square" alt="MIT license" /></a>
15
15
  </p>
@@ -48,6 +48,23 @@ test.patch('/api/cart', { total: 9.99 });
48
48
  test.clear();
49
49
  ```
50
50
 
51
+ ## 다른 도구와 다른 점
52
+
53
+ 이미 쓰고 있는 도구를 대체하지 않고 함께 씁니다. 더하는 것은 작업 방식입니다. 콘솔에서 응답을 바꾸고, 서버 HTML까지 포함한 실제 페이지를 내 세션에서 바로 확인합니다.
54
+
55
+ - **데브툴에서 서버 렌더링 화면까지.** [MSW](https://github.com/mswjs/msw)는 코드로 작성한 핸들러로 브라우저와 Node 요청을 가로챕니다. 이 도구는 핸들러를 먼저 쓰지 않고 콘솔에서 실행 중에 데이터를 바꾸며, 그 값이 서버 fetch까지 전달돼 새 HTML이 그려집니다.
56
+ - **SSG·ISR 페이지도, 다른 방문자에게 영향 없이.** 콘솔 변경은 내 세션에만 [Next.js Draft Mode](https://nextjs.org/docs/app/guides/draft-mode) 미리보기를 열어, 정적·재검증 페이지를 테스트 데이터로 그리고 공용 정적 결과는 그대로 둡니다.
57
+ - **상태 하나 보려고 테스트 코드를 쓰지 않습니다.** [Playwright](https://playwright.dev/docs/network)는 테스트 스크립트에서 브라우저 네트워크를 바꾸고, [Requestly](https://requestly.com)는 브라우저 트래픽을 고칩니다. 둘 다 브라우저가 보내는 요청에 작용하는데, Next.js의 서버 fetch는 그보다 먼저 렌더링됩니다. 이 도구는 테스트 스크립트도 브라우저 확장도 필요 없습니다.
58
+ - **한 번 해 보는 실험에서 재사용 시나리오까지.** `test.mock()`·`test.patch()`로 바로 시험하고, 반복하는 경우는 브라우저와 서버가 함께 쓰는 `test-mode/catalog.ts`에 남기며, 여러 API에 걸친 시나리오를 `test.story()`로 한 번에 켭니다.
59
+ - **지금 켜진 것을 볼 수 있습니다.** `test.active()`, `test.overrides()`, `test.search()`가 현재 덮어쓴 응답과 저장된 시나리오를 보여 주고, `test.cache.status()`가 미리보기 상태를 알려 줍니다.
60
+ - **운영 빌드는 깨끗합니다.** 생성된 연결 코드는 일반 운영 번들에서 테스트 카탈로그를 빼고, CI가 실제 클라이언트·서버 번들을 검사합니다.
61
+
62
+ ## 이런 팀에 맞습니다
63
+
64
+ - 서버 렌더링 화면에서 빈 목록, 특이한 가격, 품절, 500 오류를 재현해야 하는 Next.js App Router 팀
65
+ - 백엔드가 데이터를 만들어 주기 전에 화면 상태부터 확인해야 하는 프론트엔드 개발자
66
+ - 개발·QA 배포에서 화면 상태를 직접 확인하는 QA. 자동 검증은 Playwright·Vitest와 함께 씁니다.
67
+
51
68
  ## Quick start
52
69
 
53
70
  Next.js **16 App Router / Node.js 20.9+** 프로젝트 루트에서:
@@ -179,6 +196,14 @@ export const catalog = {
179
196
  - 테스트 쿠키는 로그인 자격이 아닙니다. QA 환경의 접근 권한은 앱이 관리합니다. 들어온 인증 쿠키를 외부 API에 자동 전달하지 않습니다.
180
197
  - 이 패키지는 **화면 상태를 재현하는 도구**입니다. 자동 assertion·합격 판정은 Playwright나 Vitest가 담당합니다.
181
198
 
199
+ ## 진행 예정
200
+
201
+ - **Next.js 지원 범위 확대:** Next.js 15 지원을 검토하고, 캐시 범위 안에서 쿠키를 읽는 연결부를 버전별로 확인하는 어댑터 뒤로 옮깁니다.
202
+ - **버전별 회귀 테스트:** 지원하는 Next.js 버전마다 운영 빌드 테스트를 자동으로 돌립니다.
203
+ - **더 큰 테스트 데이터:** 3,500바이트 쿠키 한도를 넘는 데이터를 파일 시나리오 없이 전달합니다.
204
+ - **시나리오 내보내기·가져오기:** 콘솔에서 만든 실험을 팀원과 공유합니다.
205
+ - **Playwright·CI 연동:** 자동 테스트에서 저장된 시나리오를 골라 켜고, 그 상태로 페이지를 검사합니다.
206
+
182
207
  ## Framework-independent APIs
183
208
 
184
209
  기존 범용 core·browser·Node API도 새 이름 아래 유지합니다. Next.js는 선택적 peer이며, 범용 API는 Next 없이 설치할 수 있습니다. 외부 런타임 의존성은 없습니다.
@@ -207,3 +232,8 @@ npm run build:demo # Vercel 배포용 Next 빌드
207
232
  ```
208
233
 
209
234
  검증된 main의 릴리스 태그를 GitHub Release로 발행하면, CI를 다시 통과한 패키지가 `NPM_TOKEN`을 사용하는 Actions에서 npm provenance와 함께 배포됩니다. [배포 절차](https://github.com/uiwwsw/next-test-mode/blob/main/docs/releasing.md) · [설계](https://github.com/uiwwsw/next-test-mode/blob/main/docs/architecture.md) · [Changelog](https://github.com/uiwwsw/next-test-mode/blob/main/CHANGELOG.md).
235
+
236
+
237
+ ## Search discovery / 검색 노출
238
+
239
+ The Korean and English demo pages have localized titles and descriptions, reciprocal hreflang, canonical URLs, structured data, robots.txt and sitemap.xml. Search content describes actual fetch mocking, response patching and session-scoped Next.js rendering previews. API routes and test responses are not public search documents. See [SEO verification](docs/SEO.md).
package/README.md CHANGED
@@ -3,10 +3,10 @@
3
3
  <p align="center">
4
4
  <img src="https://raw.githubusercontent.com/uiwwsw/next-test-mode/v1.0.2/docs/assets/hero.png" width="100%" alt="Next Test Mode — One console. Server data, too." />
5
5
  </p>
6
- <p align="center"><strong>Test Next.js API data and page states from the console.</strong><br />Keep your fetch calls. Try the data you need. Check the real page.</p>
6
+ <p align="center"><strong>Test real Next.js pages with any API response.</strong><br />Change API data from DevTools. Preview the actual server-rendered page. Keep your application code untouched.</p>
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/@uiwwsw/next-test-mode"><img src="https://img.shields.io/npm/v/@uiwwsw/next-test-mode?style=flat-square&amp;color=173c36" alt="npm version" /></a>
9
- <a href="https://github.com/uiwwsw/next-test-mode/actions/workflows/ci.yml"><img src="https://github.com/uiwwsw/next-test-mode/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
9
+ <a href="https://github.com/uiwwsw/next-test-mode/actions/workflows/ci.yml"><img src="https://github.com/uiwwsw/next-test-mode/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI on main" /></a>
10
10
  <img src="https://img.shields.io/badge/Next.js-App_Router-173c36?style=flat-square" alt="Next.js App Router" />
11
11
  <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-62796f?style=flat-square" alt="MIT license" /></a>
12
12
  </p>
@@ -39,6 +39,23 @@ test.patch('/api/cart', { total: 9.99 });
39
39
  test.clear();
40
40
  ```
41
41
 
42
+ ## How it differs
43
+
44
+ Next Test Mode works alongside the tools you may already use. What it adds is the workflow: change a response in the console and look at the real page, server HTML included, in your own session.
45
+
46
+ - **Server-rendered pages from DevTools.** [MSW](https://github.com/mswjs/msw) mocks requests in the browser and in Node, from handlers you write in code. Here you change data at runtime from the console, and the change reaches server fetch calls and renders new HTML without writing a handler first.
47
+ - **SSG and ISR pages too, without touching other visitors.** Console changes open a [Next.js Draft Mode](https://nextjs.org/docs/app/guides/draft-mode) preview for your session only, so static and revalidated pages render with your test data while the shared static output stays as it is.
48
+ - **No test code to try a state.** [Playwright](https://playwright.dev/docs/network) mocks the browser's network from test scripts, and [Requestly](https://requestly.com) rewrites browser traffic. Both act on what the browser requests; server-side fetch calls in Next.js render before that. Next Test Mode needs neither a test script nor a browser extension.
49
+ - **One-off experiments, then reusable scenarios.** Try `test.mock()` or `test.patch()` once, then keep the cases you repeat in `test-mode/catalog.ts`, shared by browser and server, and switch a whole multi-API scenario with `test.story()`.
50
+ - **See what is active.** `test.active()`, `test.overrides()` and `test.search()` list the current overrides and find saved cases; `test.cache.status()` shows the preview state.
51
+ - **Production builds stay clean.** The generated integration leaves the test catalog out of ordinary production bundles, and CI checks the real client and server bundles.
52
+
53
+ ## Made for
54
+
55
+ - Next.js App Router teams reproducing empty lists, edge-case prices, sold-out items or 500 errors on server-rendered pages
56
+ - Frontend developers who need a UI state before the backend can produce it
57
+ - QA reviewing page states by hand on a development or QA deployment, alongside automated Playwright or Vitest suites
58
+
42
59
  ## Quick start
43
60
 
44
61
  From a **Next.js 16 App Router / Node.js 20.9+** project:
@@ -154,6 +171,14 @@ Running `init` again preserves the edited test folder. `init --migrate` migrates
154
171
  - Test cookies are not authentication. The application controls QA access. Incoming authentication cookies are not automatically forwarded to external APIs.
155
172
  - This tool reproduces page states. Use Playwright or Vitest for automated assertions and pass/fail results.
156
173
 
174
+ ## Planned
175
+
176
+ - **Wider Next.js support:** evaluating Next.js 15, and moving the cookie bridge for cached scopes behind a version-checked adapter.
177
+ - **Per-version regression runs** of the production build tests against each supported Next.js release.
178
+ - **Larger test data** than the 3,500-byte cookie budget, without a file-defined scenario.
179
+ - **Scenario import and export** to share console experiments with teammates.
180
+ - **Playwright and CI hooks** to select a saved scenario in automated runs and check a page against it.
181
+
157
182
  ## Framework-independent APIs
158
183
 
159
184
  The core, browser and Node APIs remain available under the new package name. Next.js is an optional peer; generic APIs work without it. There are no external runtime dependencies.
@@ -182,3 +207,8 @@ npm run build:demo # Vercel production build
182
207
  ```
183
208
 
184
209
  A GitHub Release from a verified main tag triggers CI and npm publishing with provenance. Stable releases use `latest`. Version 1.0 retains the 0.7 public APIs. [Release process](./docs/releasing.md) · [Architecture](./docs/architecture.md) · [Changelog](./CHANGELOG.md).
210
+
211
+
212
+ ## Search discovery / 검색 노출
213
+
214
+ The Korean and English demo pages have localized titles and descriptions, reciprocal hreflang, canonical URLs, structured data, robots.txt and sitemap.xml. Search content describes actual fetch mocking, response patching and session-scoped Next.js rendering previews. API routes and test responses are not public search documents. See [SEO verification](docs/SEO.md).
package/docs/SEO.md ADDED
@@ -0,0 +1,7 @@
1
+ # SEO and localization
2
+
3
+ Public origin: https://next-test-mode.vercel.app. Korean `/` and English `/en` have their own canonical URL and reciprocal ko/en/x-default language alternatives. Rendering compatibility routes consolidate to the same-language homepage. Sitemap includes both canonical homepages. Robots disallows API routes.
4
+
5
+ Search intent: Next.js API mocking, fetch response patching, SSR/SSG/ISR testing, frontend QA; Korean equivalents appear in the visible guide and metadata. No claims of production API mutation or universal framework support. Existing demo controls are localized through demo-components/messages.js.
6
+
7
+ Verify with npm run ci and npm run build:demo, then check public HTML, sitemap, robots and both browser languages. Search Console ownership/submission does not guarantee indexing or ranking.
package/docs/releasing.md CHANGED
@@ -47,7 +47,4 @@ npm [Trusted publishing](https://docs.npmjs.com/trusted-publishers/)을 설정
47
47
 
48
48
  README.md는 영어, README.ko.md는 한국어이며 모두 npm 패키지에 포함됩니다. 공유 이미지는 커밋된 `docs/assets/social-card.png`에서 배포 시 복사합니다. `npm run docs:assets`로 촬영 후 이미지도 함께 커밋하세요. Google Search Console의 sitemap 제출과 색인 현황은 사이트 소유자 계정에서 별도로 확인할 수 있습니다.
49
49
 
50
- 워크스페이스에서는 `devctl doctor next-test-mode`, `devctl deploy next-test-mode`로 계획을 확인한 뒤 `devctl deploy next-test-mode --execute`로 연결된 기존 Vercel 프로젝트에 배포합니다. 공개 URL healthcheck가 모두 통과해야 완료입니다.
51
-
52
-
53
50
  배포 스크립트 `scripts/deploy.mjs`는 완료된 Vercel production 배포 URL에 `next-test-mode.vercel.app` 별칭을 연결합니다. 이전 `test-mode-tau.vercel.app` 별칭도 연결하되, Vercel의 호스트 조건부 308 redirect로 새 도메인의 같은 경로·쿼리로 영구 이동합니다. 도메인을 바꿀 때는 문서·package homepage·SEO 기준 주소·샘플 API·healthcheck·이 별칭 연결을 함께 갱신하세요.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uiwwsw/next-test-mode",
3
- "version": "1.0.2",
4
- "description": "Test fetch data and page states from the console, including session-scoped previews of server-rendered and static Next.js pages.",
3
+ "version": "1.0.3",
4
+ "description": "Test real Next.js pages with any API response: change fetch data from DevTools and preview the actual server-rendered page, SSG and ISR included, in your own session. Your app code stays untouched.",
5
5
  "type": "module",
6
6
  "packageManager": "npm@11.16.0",
7
7
  "license": "MIT",