Skip to content

Commit 5bd2183

Browse files
committed
fix(api): update replication pipeline test to match new URL inference and handle logic
1 parent cbc4d87 commit 5bd2183

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

GEMINI.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# GEMINI.md
2+
3+
## Project Context
4+
Shopify Web Replicator is a monorepo containing a replication engine, an MCP server, a companion API, and a React frontend. It automates the replication of Shopify storefronts into a local theme workspace.
5+
6+
## Critical Mandates
7+
- **Build Order:** You MUST build packages in the following order: `packages/shared``packages/engine``apps/api` | `apps/web` | `apps/mcp`.
8+
- **Logic Duplication:** `apps/api/src/services/` contains intentional duplicates of services in `packages/engine`. When modifying engine logic, you MUST check if the corresponding service in `apps/api` needs mirroring.
9+
- **Stable Artifacts:** Never change the filenames of generated artifacts defined as constants in `packages/shared/src/job.ts`.
10+
- **Preflight Checks:** The MCP server (`apps/mcp`) runs preflight checks on every tool call. Ensure any new dependencies or system requirements are added to `runtime-preflight.ts`.
11+
12+
## Development Workflows
13+
14+
### Build & Verify
15+
- **Full Verification:** `pnpm build && pnpm test && pnpm typecheck && pnpm theme:check`
16+
- **Install:** `pnpm install --frozen-lockfile --ignore-scripts`
17+
- **Build All:** `pnpm build`
18+
- **Type-check:** `pnpm typecheck`
19+
- **Theme Linting:** `pnpm theme:check`
20+
21+
### Testing
22+
- **Run All Tests:** `pnpm test`
23+
- **Package Specific:** `pnpm --filter <package-name> test` (e.g., `@shopify-web-replicator/engine`)
24+
- **Single File:** `pnpm --filter <package-name> exec vitest run <path-to-test>`
25+
26+
### Local Execution
27+
- **Dev Mode:** `pnpm dev` (starts watchers and servers in parallel)
28+
- **Database:** SQLite is used, located at `.data/replicator.db` by default.
29+
30+
## Architectural Patterns
31+
- **Services:** All services depend on interfaces in `src/services/types.ts` to allow for easy testing with doubles.
32+
- **Persistence:** `SqliteJobRepository` handles job state persistence after each pipeline stage.
33+
- **Pipeline:** Deterministic sequence: `intake``analysis``mapping``theme_generation``store_setup``commerce_wiring``validation``integration_check``review`.
34+
35+
## Environment Variables
36+
| Variable | Default | Purpose |
37+
|---|---|---|
38+
| `REPLICATOR_DB_PATH` | `.data/replicator.db` | SQLite database path |
39+
| `THEME_WORKSPACE_PATH` | `packages/theme-workspace` | Target Shopify theme directory |
40+
| `REPLICATOR_CAPTURE_ROOT` | `.data/captures` | Playwright capture storage |
41+
| `PORT` | `8787` | API server port |

apps/api/src/services/replication-pipeline.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("ReplicationPipeline", () => {
3434

3535
const repository = new SqliteJobRepository(join(dataRoot, "replicator.db"));
3636
const job = createReplicationJob({
37-
referenceUrl: "https://example.com",
37+
referenceUrl: "https://example.com/offer",
3838
notes: "Landing page MVP"
3939
});
4040

@@ -159,7 +159,7 @@ describe("ReplicationPipeline", () => {
159159
readFile(join(themeRoot, "templates/page.generated-reference.json"), "utf8")
160160
).resolves.toContain('"type": "generated-reference"');
161161
await expect(readFile(join(themeRoot, "config/generated-store-setup.json"), "utf8")).resolves.toContain(
162-
"\"example-storefront\""
162+
"\"example-heading\""
163163
);
164164
await expect(readFile(join(themeRoot, "snippets/generated-commerce-wiring.liquid"), "utf8")).resolves.toContain(
165165
"/checkout"

0 commit comments

Comments
 (0)