test(fixtures): local-draft 샘플을 IndexedDB 소비자 fixture로 옮긴다

src/features/local-draft-feature는 기능이 아니라 IndexedDB recipe의
소비자다. 시험 5개와 recipe가 쓰고, 그래서 생성기에 NOT_A_FEATURE
예외가 있었다(S4 3.1절 S-3).

코드를 tests/fixtures/indexeddb-consumer/로 옮기고 import만 고쳤다.
NOT_A_FEATURE 표식은 이 폴더만 썼고 다운스트림 둘에도 없어 생성기에서
지웠다. 선언 없는 폴더는 밖으로 옮기라는 메시지로 실패한다. 매뉴얼
오류표, README, starter-experience, capability-consumer-experience,
patterns를 고쳤다.

위험: fixture는 기능 폴더 밖이라 기능 계층 규칙(dependency-cruiser)이
걸리지 않는다. recipe가 tests/ 아래 파일을 type import한다.

검증(desktop): test:contract, test:recipes, test:browser-capabilities,
test:unit 통과.
This commit is contained in:
DongHyeonka
2026-11-08 13:51:55 +09:00
parent e7210c71bf
commit b72cd7d4a7
19 changed files with 65 additions and 96 deletions
@@ -53,13 +53,14 @@ The executable consumer probe is:
`tests/contract/consumer-experience/indexeddb-local-draft.test.ts`
It runs and reads the one Local Draft implementation under
`src/features/local-draft-feature`; the isolated fixture copy it used to probe
had drifted from `src` and was removed (09-12).
It runs and reads the one Local Draft implementation, the test fixture
`tests/fixtures/indexeddb-consumer` (the template's former local-draft sample
under `src/features/`, moved there because it is no product feature). An
earlier isolated copy had drifted from it and was removed (09-12).
The feature owns the Local Draft domain/application API and declares the slice
The consumer owns the Local Draft domain/application API and declares the slice
of the repository it calls (`LocalDraftRepository` in
`src/features/local-draft-feature/adapters/local-draft-indexeddb-store.ts`). The
`tests/fixtures/indexeddb-consumer/adapters/local-draft-indexeddb-store.ts`). The
host hands in an `IndexedDbRepositoryPort<LocalDraft, never>` through the
`indexedDb` capability; the port satisfies that slice structurally. The
cross-capability composition contract lives at:
@@ -80,7 +81,7 @@ It runs against native browser IndexedDB. The test creates the platform
save/find/remove through the feature API. The Local Draft feature still does
not import the IndexedDB runtime or native browser API.
Measured on `src/features/local-draft-feature` (09-12):
Measured on the Local Draft consumer, then under `src/features/` (09-12):
| Metric | Result |
| --- | ---: |
+5 -4
View File
@@ -151,9 +151,9 @@ installed catalogs import, the context index the router loads lazily, and the
selected app. Every build and check script runs it first; run it yourself with
`corepack pnpm generate:feature-index`. It fails, naming the file, when:
- a directory under `src/features/` has no `feature-module.ts` and no
`NOT_A_FEATURE` marker file (`src/features/local-draft-feature/NOT_A_FEATURE`
is the one intentional example), or has both;
- a directory under `src/features/` has no `feature-module.ts`. Code that
is no feature (the IndexedDB consumer the tests compose,
`tests/fixtures/indexeddb-consumer`) lives outside `src/features/`;
- a feature names an undeclared context, or a context an undeclared app;
- a context or app exceeds its declared budget;
- `VITE_PRODUCT_FEATURES` names a feature the app does not declare. The
@@ -207,7 +207,8 @@ selected app. Every build and check script runs it first; run it yourself with
that takes over the platform home is the exception ("Product home and
layouts").
5. If the feature has application input, augment `ApplicationFeatureInputs`
from the feature (`src/features/local-draft-feature/application/local-draft-api.ts`).
from the feature (the IndexedDB consumer fixture does it in
`tests/fixtures/indexeddb-consumer/application/local-draft-api.ts`).
6. Run `corepack pnpm check:architecture`, `corepack pnpm check:types`,
`corepack pnpm check:registries` and the tests. `tests/unit/two-feature-install-typecheck.test.ts`
keeps the installed catalogs compiling with more than one feature.
+1 -2
View File
@@ -56,8 +56,7 @@ lint / check:architecture / check:i18n → FE-GATE-002, FE-GATE-010
| `Context <context> belongs to undeclared app <app>` | `CONTEXT_APP_ID` 오타 | `src/contexts/<context>/context-module.ts` |
| `<file> must export a literal <NAME>` | 헤더를 상수 참조나 식으로 썼다. 생성기는 글자로 읽는다 | 그 파일. `export const <NAME> = "<값>";` 꼴 |
| `<file> must export a positive integer <NAME>` | 예산 값이 정수 리터럴이 아니다 | 그 파일 |
| `src/features/<dir> has no feature-module.ts; add one or mark the directory with NOT_A_FEATURE` | 기능 폴더에 선언 파일이 없다 | `feature-module.ts`를 만들거나, 기능이 아닌 샘플 폴더면 `NOT_A_FEATURE` 파일을 둔다 |
| `src/features/<dir> has both feature-module.ts and NOT_A_FEATURE; …` | 기능이 아니라고 표시한 폴더에 선언 파일이 있다 | 기능으로 설치하려면 `NOT_A_FEATURE`를 지운다. 설치하지 않으려면 `feature-module.ts`를 지운다 |
| `src/features/<dir> has no feature-module.ts; add one, or keep code that is no feature outside src/features` | 기능 폴더에 선언 파일이 없다 | `feature-module.ts`를 만든다. 기능이 아닌 코드(시험용 소비자 등)면 `src/features/` 밖으로 옮긴다 |
| `Duplicate generated feature ids: <id>` | 두 폴더가 같은 `FEATURE_MODULE_ID` | 한쪽 `feature-module.ts` |
| `Duplicate context id: <id>` | 두 폴더가 같은 `CONTEXT_MODULE_ID` | 한쪽 `context-module.ts` |
| `Context <context> feature cardinality <n> exceeds budget <max>` | context의 기능 수가 예산을 넘었다 | `CONTEXT_MAX_FEATURES`, 또는 새 context |
+1 -1
View File
@@ -100,7 +100,7 @@ const search = (q: string) =>
| 수정·삭제 명령 | 같은 V3 계약 (`PUT`, `PATCH`, `DELETE`) | 없음 (참조 기능은 생성 명령만 있다) | — |
| 낙관적 갱신 | `useApplicationMutation`의 `optimistic` 옵션 (`application-query.ts`) | 없음 | 런타임 테스트만 |
| 페이지 넘김 | `src/adapters/query-cache/index.ts`의 `createCursorPaginationRuntime` | 없음 (참조 기능은 커서 필터만, 다음 커서 없음) | 런타임 테스트만 |
| 로컬 저장(IndexedDB) | `recipes/frontend-capabilities/indexeddb-feature-capability.ts` + `product-composition.ts` | `src/features/local-draft-feature/` (`NOT_A_FEATURE`, 기능이 아닌 샘플) | 계약 테스트 |
| 로컬 저장(IndexedDB) | `recipes/frontend-capabilities/indexeddb-feature-capability.ts` + `product-composition.ts` | `tests/fixtures/indexeddb-consumer/` (시험이 조립하는 소비자 fixture, 기능 폴더 모양) | 계약 테스트 |
## 화면