Skip to content

Commit

Permalink
Improve package layout (#3148)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored Feb 5, 2024
1 parent e640765 commit 2e701f6
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
8 changes: 6 additions & 2 deletions packages/toolpad-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
"default": "./dist/index.js"
},
"./Button": {
"types": "./dist/Button.d.ts",
"default": "./dist/Button.js"
},
"./*": {
"types": "./dist/*.d.ts",
"import": "./dist/*.js"
"default": "./dist/*.js"
}
},
"files": [
Expand Down
7 changes: 4 additions & 3 deletions packages/toolpad-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
"default": "./dist/index.js"
},
"./*": {
"types": "./dist/*.d.ts",
"import": "./dist/*.js"
"default": "./dist/*.js"
},
"./server": {
"types": "./dist/server.d.ts",
"import": "./dist/server.js"
"default": "./dist/server.js"
}
},
"files": [
"dist",
"public",
"server",
"browser"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/toolpad-core/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="./serverModules.d.ts" />
/// <reference path="../public/serverModules.d.ts" />

import { TOOLPAD_FUNCTION } from './constants';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/toolpad-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"pretty": true,
"preserveWatchOutput": true
},
"include": ["src/**/*.ts", "src/**/*.tsx"]
"include": ["src/**/*.ts", "src/**/*.tsx", "public/serverModules.d.ts"]
}
21 changes: 13 additions & 8 deletions packages/toolpad-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,25 @@
"type": "module",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
"./events": {
"types": "./dist/events.d.ts",
"require": "./dist/events.cjs",
"default": "./dist/events.js"
},
"./*": {
"types": "./dist/*.d.ts",
"import": "./dist/*.js",
"require": "./dist/*.cjs"
"require": "./dist/*.cjs",
"default": "./dist/*.js"
},
"./hooks/useBoolean": {
"types": "./dist/hooks/useBoolean.d.ts",
"require": "./dist/hooks/useBoolean.cjs",
"default": "./dist/hooks/useBoolean.js"
},
"./hooks/*": {
"types": "./dist/hooks/*.d.ts",
"import": "./dist/hooks/*.js",
"require": "./dist/hooks/*.cjs"
"require": "./dist/hooks/*.cjs",
"default": "./dist/hooks/*.js"
}
},
"files": [
Expand Down

0 comments on commit 2e701f6

Please sign in to comment.