Skip to content

Commit

Permalink
feat(exports)!: ♻️ 🔧 simplify package exports using path patterns. sl…
Browse files Browse the repository at this point in the history
…ot and co are now under ./common/* pattern

feat(components): ✨ export all components from root entry point
  • Loading branch information
Ryan-Zayne committed Jan 11, 2025
1 parent 4ec778d commit 88b9957
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .changeset/ten-shirts-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@zayne-labs/ui-react": minor
---

feat(exports)!: ♻️ 🔧 simplify package exports using path patterns. slot and co are now under ./common/\* pattern

feat(components): ✨ export all components from root entry point
2 changes: 1 addition & 1 deletion dev/src/client/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Slot } from "@zayne-labs/ui-react/slot";
import { Slot } from "@zayne-labs/ui-react/common/slot";

function AnotherApp() {
return <Slot />;
Expand Down
12 changes: 2 additions & 10 deletions packages/ui-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,8 @@
"sideEffects": false,
"exports": {
".": null,
"./form": "./dist/esm/ui/form/index.js",
"./card": "./dist/esm/ui/card/index.js",
"./carousel": "./dist/esm/ui/carousel/index.js",
"./drop-zone": "./dist/esm/ui/drop-zone/index.js",
"./drag-scroll": "./dist/esm/ui/drag-scroll/index.js",
"./for": "./dist/esm/common/for/index.js",
"./show": "./dist/esm/common/show/index.js",
"./slot": "./dist/esm/common/slot/index.js",
"./switch": "./dist/esm/common/switch/index.js",
"./teleport": "./dist/esm/common/teleport/index.js"
"./*": "./dist/esm/ui/*/index.js",
"./common/*": "./dist/esm/common/*/index.js"
},
"main": "./dist/esm/index.js",
"module": "./dist/esm/index.js",
Expand Down
5 changes: 5 additions & 0 deletions packages/ui-react/src/components/common/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from "./for";
export * from "./show";
export * from "./slot";
export * from "./switch";
export * from "./teleport";
3 changes: 2 additions & 1 deletion packages/ui-react/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// eslint-disable-next-line unicorn/no-empty-file -- Empty entry file for the sake of main field in package.json
export * from "./ui";
export * from "./common";
5 changes: 5 additions & 0 deletions packages/ui-react/src/components/ui/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from "./card";
export * from "./carousel";
export * from "./drag-scroll";
export * from "./drop-zone";
export * from "./form";
1 change: 1 addition & 0 deletions packages/ui-react/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const sharedOptions = {
dts: true, // generate d.ts
entry: [
"src/components/index.ts",

"src/components/ui/card/index.ts",
"src/components/ui/carousel/index.ts",
"src/components/ui/drop-zone/index.ts",
Expand Down

0 comments on commit 88b9957

Please sign in to comment.