Update exports again

This commit is contained in:
Raunak Bhagat
2025-09-15 17:18:28 -07:00
parent bca3c89c97
commit c7d02bf483
4 changed files with 47 additions and 2 deletions
+1
View File
@@ -1,6 +1,7 @@
# dependencies (bun install)
node_modules
bun.lock
dist
# dotenv environment variable files
.env
+25
View File
@@ -2,6 +2,29 @@
"name": "onyx-ui",
"version": "1.0.0",
"description": "The unified Onyx UI Component library",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./icons": {
"types": "./dist/icons.d.ts",
"import": "./dist/icons.mjs",
"require": "./dist/icons.js"
},
"./text": {
"types": "./dist/text.d.ts",
"import": "./dist/text.mjs",
"require": "./dist/text.js"
}
},
"files": [
"dist"
],
"devDependencies": {
"@svgr/webpack": "^8.1.0",
"@types/bun": "latest",
@@ -23,6 +46,8 @@
"react": "^19.1.1"
},
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"prepare": "husky",
"lint": "eslint . --ext .ts,.tsx,.js,.jsx",
"lint:fix": "eslint . --ext .ts,.tsx,.js,.jsx --fix",
+2 -2
View File
@@ -1,6 +1,6 @@
// Export all icon components
// Export all icon components and types
export * from "./icons";
// Export Text component
// Export Text component and types
export { default as Text } from "./Text";
export type { TextProps } from "./Text";
+19
View File
@@ -0,0 +1,19 @@
import { defineConfig } from "tsup";
export default defineConfig({
entry: {
index: "src/index.ts",
icons: "src/icons.tsx",
text: "src/Text/index.tsx",
},
format: ["cjs", "esm"],
dts: true,
splitting: false,
sourcemap: true,
clean: true,
external: ["react"],
treeshake: true,
esbuildOptions(options) {
options.jsx = "automatic";
},
});