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.