Extract Shared Registry Schema Package
Track: extract-shared-registry-20260408
Overview
Extract duplicated registry types, Zod schemas, and utility functions from packages/cli and apps/registry into a new shared workspace package packages/registry-schema (@pleaseai/registry-schema).
Currently, RegistryStrategy, RegistryAlias, RegistryEntry interfaces are defined in packages/cli/src/registry.ts, while equivalent Zod schemas exist in apps/registry/content.config.ts. The expandStrategies() function is intentionally duplicated in both packages/cli/src/registry-schema.ts and apps/registry/server/api/registry/[...slug].get.ts because Nitro could not resolve cross-package imports. A dedicated shared package resolves this constraint.
Scope
In Scope
- New package:
packages/registry-schema with @pleaseai/registry-schema as the package name
- Zod schemas: Define canonical Zod schemas for
Strategy, Alias, and RegistryEntry in the shared package
- TypeScript types: Infer TypeScript types from Zod schemas (single source of truth)
- Shared utilities: Move
expandStrategies() to the shared package
- CLI migration: Replace
RegistryStrategy, RegistryAlias, RegistryEntry interfaces in packages/cli/src/registry.ts with re-exports from the shared package
- Registry migration: Replace local Zod schemas in
apps/registry/content.config.ts and local interfaces/functions in apps/registry/server/api/registry/[...slug].get.ts with imports from the shared package
- Workspace config: Add
packages/registry-schema to the bun workspace
Out of Scope
- CLI command logic or behavior changes
- Registry API endpoint behavior changes
- New features or additional schemas beyond what currently exists
- Publishing
@pleaseai/registry-schema to npm (internal workspace package only)
Success Criteria
Constraints
- No special constraints — free to restructure as needed
- External behavior (CLI output, API responses) must remain identical
Technical Notes
- The shared package must be Pure ESM (
"type": "module") with .js import extensions
- Use the same ESLint config (
@pleaseai/eslint-config) as other packages
- Zod is already used in
apps/registry via @nuxt/content — the shared package should use zod directly as a dependency
- TypeScript types should be inferred from Zod schemas using
z.infer<> to maintain a single source of truth
Extract Shared Registry Schema Package
Overview
Extract duplicated registry types, Zod schemas, and utility functions from
packages/cliandapps/registryinto a new shared workspace packagepackages/registry-schema(@pleaseai/registry-schema).Currently,
RegistryStrategy,RegistryAlias,RegistryEntryinterfaces are defined inpackages/cli/src/registry.ts, while equivalent Zod schemas exist inapps/registry/content.config.ts. TheexpandStrategies()function is intentionally duplicated in bothpackages/cli/src/registry-schema.tsandapps/registry/server/api/registry/[...slug].get.tsbecause Nitro could not resolve cross-package imports. A dedicated shared package resolves this constraint.Scope
In Scope
packages/registry-schemawith@pleaseai/registry-schemaas the package nameStrategy,Alias, andRegistryEntryin the shared packageexpandStrategies()to the shared packageRegistryStrategy,RegistryAlias,RegistryEntryinterfaces inpackages/cli/src/registry.tswith re-exports from the shared packageapps/registry/content.config.tsand local interfaces/functions inapps/registry/server/api/registry/[...slug].get.tswith imports from the shared packagepackages/registry-schemato the bun workspaceOut of Scope
@pleaseai/registry-schemato npm (internal workspace package only)Success Criteria
packages/registry-schemapackage exists with Zod schemas, inferred types, andexpandStrategies()packages/cliimports all registry types from@pleaseai/registry-schema— no local type definitions remainapps/registryimports schemas andexpandStrategies()from@pleaseai/registry-schema— no duplicated code remainsbun run buildsucceeds at the monorepo rootbun run lintpasses across all packagesConstraints
Technical Notes
"type": "module") with.jsimport extensions@pleaseai/eslint-config) as other packagesapps/registryvia@nuxt/content— the shared package should usezoddirectly as a dependencyz.infer<>to maintain a single source of truth