-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
When users install a component via npx shadcn@latest add https://www.terrae.dev/map.json, all files land flat in a single components/ui/map/ folder — components, types, hooks, and utilities side by side.
Two problems with this:
- Flat structure — as the library grows, mixing components, hooks, types, and utilities in one folder becomes hard to navigate.
- Generic folder name —
map/can conflict with other libraries. We should use the brand nameterrae/instead. - Wrong location for non-components — hooks, types, and utilities are not UI components and shouldn't live inside
components/ui/.
Current structure
components/ui/map/
├── map.tsx
├── compass.tsx
├── marker.tsx
├── popup.tsx
├── types.ts
├── hooks.ts
├── map-library.ts
└── ...
Proposed structure
components/ui/terrae/
├── map.tsx
├── compass.tsx
├── marker.tsx
└── popup.tsx
hooks/terrae/
└── use-map.ts
lib/terrae/
└── map-library.ts
types/terrae/
└── types.ts
This follows the standard Next.js/shadcn convention:
components/ui/terrae/— only actual React componentshooks/terrae/— aligns with where shadcn projects already put hookslib/terrae/— aligns with the existinglib/utils.tspatterntypes/terrae/— pure type definitions
Each folder is namespaced under terrae/ to avoid conflicts with other libraries.
Impact
This requires updating the target field in every registry JSON file under public/. For example in map.json:
- "target": "components/ui/map/map.tsx"
+ "target": "components/ui/terrae/map.tsx"
- "target": "components/ui/map/types.ts"
+ "target": "types/terrae/types.ts"
- "target": "components/ui/map/hooks.ts"
+ "target": "hooks/terrae/use-map.ts"
- "target": "components/ui/map/map-library.ts"
+ "target": "lib/terrae/map-library.ts"All internal imports within components also need to be updated to reflect the new paths.
Affected Component
All components — this is a cross-cutting structural change to the registry.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request