[deferred] Extract @libreshop/types npm package — only if multi-consumer demand emerges #14

Open
opened 2026-05-04 19:47:20 +02:00 by libretech · 0 comments
Owner

Part of #10

Status: deferred / on-demand

Goal

Only if asked — extract shared TypeScript types + composables into a small npm package @libreshop/types so multiple consumers can share schema definitions without copying types verbatim.

When to action this

  • A second consumer beyond libretech/mp adopts libreshop as a starter
  • That consumer asks for "we want to track type changes upstream"
  • We see drift between consumers' type definitions causing API contract bugs

Until then: don't build this. Forking + copy-and-modify is sufficient for one consumer.

What it would contain (sketch only)

  • Strapi response types (Product, ProductCover, ProductPattern, ProductPages, ProductRuling)
  • CopyText interface
  • API path constants (/api/products, /api/orders, etc.)
  • Shared composables that don't depend on Vue runtime: pure data transforms

What it would NOT contain

  • Vue components (those don't share well across forks)
  • Nuxt-specific composables (auto-import paths differ)
  • Branding utils (those are per-consumer)

Acceptance (when actioned)

  • Published as @libreshop/types on a public npm-compatible registry (Verdaccio at git.librete.ch or npmjs.com)
  • Versioned independently of libreshop/shop main repo
  • At least 2 consumers depend on it
  • Migration guide for libretech/mp to consume it
Part of https://git.librete.ch/libreshop/shop/issues/10 ## Status: deferred / on-demand ## Goal **Only if asked** — extract shared TypeScript types + composables into a small npm package `@libreshop/types` so multiple consumers can share schema definitions without copying types verbatim. ## When to action this - A second consumer beyond `libretech/mp` adopts libreshop as a starter - That consumer asks for "we want to track type changes upstream" - We see drift between consumers' type definitions causing API contract bugs Until then: **don't build this**. Forking + copy-and-modify is sufficient for one consumer. ## What it would contain (sketch only) - Strapi response types (`Product`, `ProductCover`, `ProductPattern`, `ProductPages`, `ProductRuling`) - `CopyText` interface - API path constants (`/api/products`, `/api/orders`, etc.) - Shared composables that don't depend on Vue runtime: pure data transforms ## What it would NOT contain - Vue components (those don't share well across forks) - Nuxt-specific composables (auto-import paths differ) - Branding utils (those are per-consumer) ## Acceptance (when actioned) - [ ] Published as `@libreshop/types` on a public npm-compatible registry (Verdaccio at git.librete.ch or npmjs.com) - [ ] Versioned independently of libreshop/shop main repo - [ ] At least 2 consumers depend on it - [ ] Migration guide for libretech/mp to consume it
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: libreshop/shop#14
No description provided.