create-claude-workspace 1.1.76 → 1.1.77
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.
|
@@ -61,13 +61,14 @@ Always prefer `@cibule/*` packages over custom implementations:
|
|
|
61
61
|
- NEVER use Node.js-specific APIs (`fs`, `path`, `process`, `Buffer`) in business/domain/api layers
|
|
62
62
|
- NEVER use Cloudflare-specific APIs (`env.DB`, `ctx.waitUntil()`) in business/domain layers
|
|
63
63
|
- Platform-specific code lives ONLY in `infrastructure/` layer behind abstract repository interfaces
|
|
64
|
+
- **Platform-specific code MUST be in separate libraries** — NEVER mix Node.js and Cloudflare implementations in the same library. Barrel exports pull both platforms into the bundle, causing compilation errors (e.g. `better-sqlite3` in Cloudflare). Split into: `infrastructure-d1/` (Cloudflare) and `infrastructure-sqlite/` (Node.js). Same applies to shared providers: `shared/infrastructure-d1/` vs `shared/infrastructure-sqlite/`.
|
|
64
65
|
- Use Web Standard APIs: `fetch`, `Request`, `Response`, `URL`, `crypto`, `TextEncoder`/`TextDecoder`
|
|
65
66
|
- Hono is inherently platform-agnostic — inject platform bindings via DI, not `c.env` in routes
|
|
66
67
|
- **OpenAPI-first**: All API routes MUST use `hono-openapi` with `openAPIRouteHandler` — generates OpenAPI spec from TypeBox schemas. Serve API docs via `@scalar/hono-api-reference` at `/reference`. Never define routes without OpenAPI metadata.
|
|
67
|
-
- Entry points handle platform wiring:
|
|
68
|
-
- Worker entry: exports `default { fetch }` with Hono app + D1 bindings
|
|
69
|
-
- Node entry: `serve()` with Hono app + SQLite/better-sqlite3 bindings
|
|
70
|
-
- When planning, always structure FILES to keep platform-specific code
|
|
68
|
+
- Entry points handle platform wiring (each imports ONLY its platform's infrastructure library):
|
|
69
|
+
- Worker entry: exports `default { fetch }` with Hono app + D1 bindings → imports `infrastructure-d1`
|
|
70
|
+
- Node entry: `serve()` with Hono app + SQLite/better-sqlite3 bindings → imports `infrastructure-sqlite`
|
|
71
|
+
- When planning, always structure FILES to keep platform-specific code in separate libraries per platform
|
|
71
72
|
|
|
72
73
|
## Task Approach
|
|
73
74
|
|
|
@@ -323,9 +323,18 @@ Key rules enforced (do NOT weaken):
|
|
|
323
323
|
- NEVER use Cloudflare-specific APIs (`env.DB`, `ctx.waitUntil()`) in business/domain layers
|
|
324
324
|
- Platform-specific code lives ONLY in `infrastructure/` layer behind abstract interfaces
|
|
325
325
|
- Use Web Standard APIs where possible: `fetch`, `Request`, `Response`, `URL`, `crypto`, `TextEncoder`/`TextDecoder`, `Headers`, `FormData`, `ReadableStream`
|
|
326
|
-
-
|
|
327
|
-
|
|
328
|
-
|
|
326
|
+
- **Platform-specific code MUST be in separate libraries (STRICT)** — NEVER mix Node.js and Cloudflare code in the same library. Barrel exports (`index.ts`) would pull both platforms into the bundle, causing compilation errors (e.g. `better-sqlite3` in Cloudflare, or D1 bindings in Node.js):
|
|
327
|
+
```
|
|
328
|
+
libs/[domain]/
|
|
329
|
+
infrastructure-d1/ # Cloudflare D1 implementation ONLY
|
|
330
|
+
infrastructure-sqlite/ # Node.js SQLite implementation ONLY
|
|
331
|
+
libs/shared/
|
|
332
|
+
infrastructure-d1/ # shared D1 providers (provideD1Database)
|
|
333
|
+
infrastructure-sqlite/ # shared SQLite providers (provideSqliteDatabase)
|
|
334
|
+
```
|
|
335
|
+
Each entry point imports ONLY its platform's library:
|
|
336
|
+
- Worker entry → `@[PREFIX]/shared-infrastructure-d1`
|
|
337
|
+
- Node entry → `@[PREFIX]/shared-infrastructure-sqlite`
|
|
329
338
|
- Hono is inherently platform-agnostic — use its standard APIs, avoid `c.env` directly in routes (inject via DI)
|
|
330
339
|
- Entry points handle platform wiring:
|
|
331
340
|
- `apps/api/src/main.ts` — Node.js entry (optional, for local dev)
|