Skip to content

Commit bc98567

Browse files
authored
feat!: rename @payloadcms/ui/client to @payloadcms/ui, and other auto-suggestion & exports improvements (#6848)
**BREAKING:** All `@payloadcms/ui/client` exports have been renamed to `@payloadcms/ui`. A simple find & replace across your entire project will be enough to migrate. This change greatly improves import auto-completions in IDEs which lack proper support for package.json exports, like Webstorm.
1 parent 317bc07 commit bc98567

File tree

131 files changed

+492
-455
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+492
-455
lines changed

app/(payload)/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
22
import configPromise from '@payload-config'
33
import { RootLayout } from '@payloadcms/next/layouts'
4-
// import '@payloadcms/ui/styles.css' // Uncomment this line if `@payloadcms/ui/client` in `tsconfig.json` points to `/ui/dist` instead of `/ui/src`
4+
// import '@payloadcms/ui/styles.css' // Uncomment this line if `@payloadcms/ui` in `tsconfig.json` points to `/ui/dist` instead of `/ui/src`
55
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
66
import React from 'react'
77

packages/db-mongodb/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"exports": {
1515
".": {
1616
"import": "./src/index.ts",
17-
"require": "./src/index.ts",
18-
"types": "./src/index.ts"
17+
"types": "./src/index.ts",
18+
"default": "./src/index.ts"
1919
}
2020
},
2121
"main": "./src/index.ts",
22-
"types": "./src/types.ts",
22+
"types": "./src/index.ts",
2323
"files": [
2424
"dist",
2525
"mock.js",
@@ -55,8 +55,8 @@
5555
"exports": {
5656
".": {
5757
"import": "./dist/index.js",
58-
"require": "./dist/index.js",
59-
"types": "./dist/index.d.ts"
58+
"types": "./dist/index.d.ts",
59+
"default": "./dist/index.js"
6060
}
6161
},
6262
"main": "./dist/index.js",

packages/db-postgres/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
"exports": {
1515
".": {
1616
"import": "./src/index.ts",
17-
"require": "./src/index.ts",
18-
"types": "./src/index.ts"
17+
"types": "./src/index.ts",
18+
"default": "./src/index.ts"
1919
},
2020
"./types": {
2121
"import": "./src/types.ts",
22-
"require": "./src/types.ts",
23-
"types": "./src/types.ts"
22+
"types": "./src/types.ts",
23+
"default": "./src/types.ts"
2424
},
2525
"./migration-utils": {
2626
"import": "./src/exports/migration-utils.ts",
27-
"require": "./src/exports/migration-utils.ts",
28-
"types": "./src/exports/migration-utils.ts"
27+
"types": "./src/exports/migration-utils.ts",
28+
"default": "./src/exports/migration-utils.ts"
2929
}
3030
},
3131
"main": "./src/index.ts",
@@ -68,18 +68,18 @@
6868
"exports": {
6969
".": {
7070
"import": "./dist/index.js",
71-
"require": "./dist/index.js",
72-
"types": "./dist/index.d.ts"
71+
"types": "./dist/index.d.ts",
72+
"default": "./dist/index.js"
7373
},
7474
"./types": {
7575
"import": "./dist/types.js",
76-
"require": "./dist/types.js",
77-
"types": "./dist/types.d.ts"
76+
"types": "./dist/types.d.ts",
77+
"default": "./dist/types.js"
7878
},
7979
"./migration-utils": {
8080
"import": "./dist/exports/migration-utils.js",
81-
"require": "./dist/exports/migration-utils.js",
82-
"types": "./dist/exports/migration-utils.d.ts"
81+
"types": "./dist/exports/migration-utils.d.ts",
82+
"default": "./dist/exports/migration-utils.js"
8383
}
8484
},
8585
"main": "./dist/index.js",

packages/email-nodemailer/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"exports": {
1515
".": {
1616
"import": "./src/index.ts",
17-
"require": "./src/index.ts",
18-
"types": "./src/index.ts"
17+
"types": "./src/index.ts",
18+
"default": "./src/index.ts"
1919
}
2020
},
2121
"main": "./src/index.ts",
@@ -48,8 +48,8 @@
4848
"exports": {
4949
".": {
5050
"import": "./dist/index.js",
51-
"require": "./dist/index.js",
52-
"types": "./dist/index.d.ts"
51+
"types": "./dist/index.d.ts",
52+
"default": "./dist/index.js"
5353
}
5454
},
5555
"main": "./dist/index.js",

packages/email-resend/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"exports": {
1515
".": {
1616
"import": "./src/index.ts",
17-
"require": "./src/index.ts",
18-
"types": "./src/index.ts"
17+
"types": "./src/index.ts",
18+
"default": "./src/index.ts"
1919
}
2020
},
2121
"main": "./src/index.ts",
@@ -46,8 +46,8 @@
4646
"exports": {
4747
".": {
4848
"import": "./dist/index.js",
49-
"require": "./dist/index.js",
50-
"types": "./dist/index.d.ts"
49+
"types": "./dist/index.d.ts",
50+
"default": "./dist/index.js"
5151
}
5252
},
5353
"main": "./dist/index.js",

packages/graphql/package.json

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,22 @@
1111
"exports": {
1212
".": {
1313
"import": "./src/index.ts",
14-
"require": "./src/index.ts",
15-
"types": "./src/index.ts"
14+
"types": "./src/index.ts",
15+
"default": "./src/index.ts"
1616
},
17-
"./*": {
18-
"import": "./src/exports/*.ts",
19-
"require": "./src/exports/*.ts",
20-
"types": "./src/exports/*.ts"
17+
"./types": {
18+
"import": "./src/exports/types.ts",
19+
"types": "./src/exports/types.ts",
20+
"default": "./src/exports/types.ts"
21+
},
22+
"./utilities": {
23+
"import": "./src/exports/utilities.ts",
24+
"types": "./src/exports/utilities.ts",
25+
"default": "./src/exports/utilities.ts"
2126
}
2227
},
2328
"main": "./src/index.ts",
24-
"types": "./src/index.d.ts",
29+
"types": "./src/index.ts",
2530
"bin": {
2631
"payload-graphql": "bin.js"
2732
},
@@ -54,13 +59,18 @@
5459
"exports": {
5560
".": {
5661
"import": "./dist/index.js",
57-
"require": "./dist/index.js",
58-
"types": "./dist/index.d.ts"
62+
"types": "./dist/index.d.ts",
63+
"default": "./dist/index.js"
64+
},
65+
"./types": {
66+
"import": "./dist/exports/types.js",
67+
"types": "./dist/exports/types.d.ts",
68+
"default": "./dist/exports/types.js"
5969
},
60-
"./*": {
61-
"import": "./dist/exports/*.js",
62-
"require": "./dist/exports/*.js",
63-
"types": "./dist/exports/*.d.ts"
70+
"./utilities": {
71+
"import": "./dist/exports/utilities.js",
72+
"types": "./dist/exports/utilities.d.ts",
73+
"default": "./dist/exports/utilities.js"
6474
}
6575
},
6676
"main": "./dist/index.js",

packages/live-preview-react/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"type": "module",
1414
"exports": {
1515
".": {
16+
"import": "./src/index.ts",
1617
"types": "./src/index.ts",
1718
"default": "./src/index.ts"
1819
}
@@ -47,8 +48,8 @@
4748
"exports": {
4849
".": {
4950
"import": "./dist/index.js",
50-
"require": "./dist/index.js",
51-
"types": "./dist/index.d.ts"
51+
"types": "./dist/index.d.ts",
52+
"default": "./dist/index.js"
5253
}
5354
},
5455
"main": "./dist/index.js",

packages/live-preview-vue/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
"type": "module",
1414
"exports": {
1515
".": {
16-
"default": "./src/index.ts",
17-
"types": "./src/index.ts"
16+
"import": "./src/index.ts",
17+
"types": "./src/index.ts",
18+
"default": "./src/index.ts"
1819
}
1920
},
2021
"main": "./src/index.ts",
@@ -44,9 +45,9 @@
4445
"publishConfig": {
4546
"exports": {
4647
".": {
47-
"import": "./dist/index.js",
48-
"require": "./dist/index.js",
49-
"types": "./dist/index.d.ts"
48+
"default": "./dist/index.js",
49+
"types": "./dist/index.d.ts",
50+
"import": "./dist/index.js"
5051
}
5152
},
5253
"main": "./dist/index.js",

packages/live-preview/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"type": "module",
1414
"exports": {
1515
".": {
16+
"import": "./src/index.ts",
1617
"types": "./src/index.ts",
1718
"default": "./src/index.ts"
1819
}
@@ -38,8 +39,8 @@
3839
"exports": {
3940
".": {
4041
"import": "./dist/index.js",
41-
"require": "./dist/index.js",
42-
"types": "./dist/index.d.ts"
42+
"types": "./dist/index.d.ts",
43+
"default": "./dist/index.js"
4344
}
4445
},
4546
"main": "./dist/index.js",

packages/next/package.json

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,37 @@
1111
"exports": {
1212
".": {
1313
"import": "./src/index.js",
14-
"require": "./src/index.js",
15-
"types": "./src/index.js"
14+
"types": "./src/index.js",
15+
"default": "./src/index.js"
1616
},
1717
"./withPayload": {
1818
"import": "./src/withPayload.js",
19-
"require": "./src/withPayload.js"
19+
"default": "./src/withPayload.js"
2020
},
21-
"./*": {
22-
"import": "./src/exports/*.ts",
23-
"require": "./src/exports/*.ts",
24-
"types": "./src/exports/*.ts"
21+
"./layouts": {
22+
"import": "./src/exports/layouts.ts",
23+
"types": "./src/exports/layouts.ts",
24+
"default": "./src/exports/layouts.ts"
25+
},
26+
"./routes": {
27+
"import": "./src/exports/routes.ts",
28+
"types": "./src/exports/routes.ts",
29+
"default": "./src/exports/routes.ts"
30+
},
31+
"./templates": {
32+
"import": "./src/exports/templates.ts",
33+
"types": "./src/exports/templates.ts",
34+
"default": "./src/exports/templates.ts"
35+
},
36+
"./utilities": {
37+
"import": "./src/exports/utilities.ts",
38+
"types": "./src/exports/utilities.ts",
39+
"default": "./src/exports/utilities.ts"
40+
},
41+
"./views": {
42+
"import": "./src/exports/views.ts",
43+
"types": "./src/exports/views.ts",
44+
"default": "./src/exports/views.ts"
2545
}
2646
},
2747
"main": "./src/index.js",
@@ -90,22 +110,42 @@
90110
"exports": {
91111
"./css": {
92112
"import": "./dist/prod/styles.css",
93-
"require": "./dist/prod/styles.css",
94113
"default": "./dist/prod/styles.css"
95114
},
96115
"./withPayload": {
97116
"import": "./dist/withPayload.js",
98-
"require": "./dist/cjs/withPayload.cjs"
117+
"require": "./dist/cjs/withPayload.cjs",
118+
"default": "./dist/withPayload.js"
119+
},
120+
"./layouts": {
121+
"import": "./dist/exports/layouts.js",
122+
"types": "./dist/exports/layouts.d.ts",
123+
"default": "./dist/exports/layouts.js"
124+
},
125+
"./routes": {
126+
"import": "./dist/exports/routes.js",
127+
"types": "./dist/exports/routes.d.ts",
128+
"default": "./dist/exports/routes.js"
129+
},
130+
"./templates": {
131+
"import": "./dist/exports/templates.js",
132+
"types": "./dist/exports/templates.d.ts",
133+
"default": "./dist/exports/templates.js"
134+
},
135+
"./utilities": {
136+
"import": "./dist/exports/utilities.js",
137+
"types": "./dist/exports/utilities.d.ts",
138+
"default": "./dist/exports/utilities.js"
99139
},
100-
"./*": {
101-
"import": "./dist/exports/*.js",
102-
"require": "./dist/exports/*.js",
103-
"types": "./dist/exports/*.d.ts"
140+
"./views": {
141+
"import": "./dist/exports/views.js",
142+
"types": "./dist/exports/views.d.ts",
143+
"default": "./dist/exports/views.js"
104144
}
105145
},
106146
"main": "./dist/index.js",
107147
"registry": "https://registry.npmjs.org/",
108-
"types": "./dist/index.d.ts"
148+
"types": "./dist/index.js"
109149
},
110150
"overrides": {
111151
"@types/react": "npm:types-react@19.0.0-beta.2",

0 commit comments

Comments
 (0)