Skip to content

Commit 59cde0d

Browse files
authored
feat: match next.js env file loading behavior in bin scripts & importConfig, clean up installed packages & mismatching package versions (#6601)
1 parent 1aece39 commit 59cde0d

File tree

33 files changed

+503
-939
lines changed

33 files changed

+503
-939
lines changed

nodemon.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

package.json

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@
6565
"script:pack": "tsx scripts/pack-all-to-dest.ts",
6666
"pretest": "pnpm build",
6767
"test": "pnpm test:int && pnpm test:components && pnpm test:e2e",
68-
"test:components": "cross-env NODE_OPTIONS=--no-deprecation jest --config=jest.components.config.js",
68+
"test:components": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-deprecation\" jest --config=jest.components.config.js",
6969
"test:e2e": "cross-env NODE_OPTIONS=--no-deprecation NODE_NO_WARNINGS=1 tsx ./test/runE2E.ts",
7070
"test:e2e:debug": "cross-env NODE_OPTIONS=--no-deprecation NODE_NO_WARNINGS=1 PWDEBUG=1 DISABLE_LOGGING=true playwright test",
7171
"test:e2e:headed": "cross-env NODE_OPTIONS=--no-deprecation NODE_NO_WARNINGS=1 DISABLE_LOGGING=true playwright test --headed",
72-
"test:int": "cross-env NODE_OPTIONS=--no-deprecation NODE_NO_WARNINGS=1 DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand",
73-
"test:int:postgres": "cross-env NODE_OPTIONS=--no-deprecation NODE_NO_WARNINGS=1 PAYLOAD_DATABASE=postgres DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand",
74-
"test:unit": "cross-env NODE_OPTIONS=--no-deprecation NODE_NO_WARNINGS=1 DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=jest.config.js --runInBand",
72+
"test:int": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-deprecation\" NODE_NO_WARNINGS=1 DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand",
73+
"test:int:postgres": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-deprecation\" NODE_NO_WARNINGS=1 PAYLOAD_DATABASE=postgres DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand",
74+
"test:unit": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-deprecation\" NODE_NO_WARNINGS=1 DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=jest.config.js --runInBand",
7575
"translateNewKeys": "pnpm --filter payload run translateNewKeys"
7676
},
7777
"lint-staged": {
@@ -84,18 +84,15 @@
8484
"tsconfig.json": "node scripts/reset-tsconfig.js"
8585
},
8686
"devDependencies": {
87-
"@aws-sdk/client-s3": "^3.525.0",
87+
"@jest/globals": "29.7.0",
8888
"@next/bundle-analyzer": "^14.1.0",
89-
"@octokit/core": "^5.1.0",
9089
"@payloadcms/eslint-config": "workspace:*",
9190
"@payloadcms/live-preview-react": "workspace:*",
9291
"@playwright/test": "1.43.0",
93-
"@sentry/react": "^7.77.0",
9492
"@swc/cli": "^0.1.62",
9593
"@swc/jest": "0.2.36",
9694
"@testing-library/jest-dom": "6.4.2",
9795
"@testing-library/react": "14.2.1",
98-
"@types/concat-stream": "^2.0.1",
9996
"@types/fs-extra": "^11.0.2",
10097
"@types/jest": "29.5.12",
10198
"@types/minimist": "1.2.5",
@@ -106,35 +103,28 @@
106103
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2",
107104
"@types/semver": "^7.5.3",
108105
"@types/shelljs": "0.8.15",
109-
"add-stream": "^1.0.0",
110106
"chalk": "^4.1.2",
111107
"changelogen": "^0.5.5",
112108
"comment-json": "^4.2.3",
113-
"concat-stream": "^2.0.0",
114109
"copyfiles": "2.4.1",
115110
"cross-env": "7.0.3",
116-
"dotenv": "8.6.0",
111+
"dotenv": "16.4.5",
117112
"drizzle-kit": "0.20.14-1f2c838",
118113
"drizzle-orm": "0.29.4",
119114
"escape-html": "^1.0.3",
120115
"eslint-plugin-payload": "workspace:*",
121116
"execa": "5.1.1",
122117
"form-data": "3.0.1",
123118
"fs-extra": "10.1.0",
124-
"get-port": "5.1.1",
125-
"get-stream": "6.0.1",
126119
"glob": "8.1.0",
127120
"globby": "11.1.0",
128121
"husky": "^8.0.3",
129122
"jest": "29.7.0",
130123
"jest-environment-jsdom": "29.7.0",
131-
"jwt-decode": "4.0.0",
132124
"lint-staged": "^14.0.1",
133125
"minimist": "1.2.8",
134126
"mongodb-memory-server": "^9.0",
135127
"next": "15.0.0-rc.0",
136-
"node-mocks-http": "^1.14.1",
137-
"nodemon": "3.0.3",
138128
"open": "^10.1.0",
139129
"p-limit": "^5.0.0",
140130
"pino": "8.15.0",
@@ -146,14 +136,11 @@
146136
"qs": "6.11.2",
147137
"react": "^19.0.0-rc-f994737d14-20240522",
148138
"react-dom": "^19.0.0-rc-f994737d14-20240522",
149-
"read-stream": "^2.1.1",
150139
"rimraf": "3.0.2",
151140
"semver": "^7.5.4",
152141
"sharp": "0.32.6",
153142
"shelljs": "0.8.5",
154-
"simple-git": "^3.24.0",
155143
"slash": "3.0.0",
156-
"slate": "0.91.4",
157144
"sort-package-json": "^2.10.0",
158145
"swc-plugin-transform-remove-imports": "^1.12.1",
159146
"tempfile": "^3.0.0",
@@ -162,8 +149,7 @@
162149
"tsx": "^4.7.1",
163150
"turbo": "^1.13.3",
164151
"typescript": "5.4.5",
165-
"uuid": "^9.0.1",
166-
"yocto-queue": "^1.0.0"
152+
"uuid": "^9.0.1"
167153
},
168154
"peerDependencies": {
169155
"react": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",

packages/create-payload-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@types/degit": "^2.8.3",
5252
"@types/esprima": "^4.0.6",
5353
"@types/fs-extra": "^9.0.12",
54-
"@types/jest": "^27.0.3",
54+
"@types/jest": "29.5.12",
5555
"@types/node": "20.12.5",
5656
"temp-dir": "2.0.0"
5757
}

packages/create-payload-app/src/lib/create-project.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { createProject } from './create-project.js'
55
import { dbReplacements } from './packages.js'
66
import { getValidTemplates } from './templates.js'
77
import globby from 'globby'
8+
import { jest } from '@jest/globals'
89

910
import tempDirectory from 'temp-dir'
1011

packages/create-payload-app/src/lib/wrap-next-config.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { parseAndModifyConfigContent, withPayloadStatement } from './wrap-next-config.js'
22
import * as p from '@clack/prompts'
3+
import { jest } from '@jest/globals'
34

45
const esmConfigs = {
56
defaultNextConfig: `/** @type {import('next').NextConfig} */

packages/db-mongodb/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@
3535
"dependencies": {
3636
"bson-objectid": "2.0.4",
3737
"deepmerge": "4.3.1",
38-
"get-port": "5.1.1",
3938
"http-status": "1.6.2",
4039
"mongoose": "6.12.3",
4140
"mongoose-paginate-v2": "1.7.22",
4241
"prompts": "2.4.2",
43-
"uuid": "9.0.0"
42+
"uuid": "^9.0.1"
4443
},
4544
"devDependencies": {
4645
"@payloadcms/eslint-config": "workspace:*",

packages/db-postgres/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"pg": "8.11.3",
5151
"prompts": "2.4.2",
5252
"to-snake-case": "1.0.0",
53-
"uuid": "9.0.0"
53+
"uuid": "^9.0.1"
5454
},
5555
"devDependencies": {
5656
"@payloadcms/eslint-config": "workspace:*",

packages/email-resend/src/email-resend.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { resendAdapter } from './index.js'
22
import { Payload } from 'payload/types'
3+
import { jest } from '@jest/globals'
34

45
describe('email-resend', () => {
56
const defaultFromAddress = 'dev@payloadcms.com'

packages/next/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@
4646
"@payloadcms/graphql": "workspace:*",
4747
"@payloadcms/translations": "workspace:*",
4848
"@payloadcms/ui": "workspace:*",
49-
"@types/busboy": "^1.5.3",
5049
"busboy": "^1.6.0",
51-
"deep-equal": "2.2.2",
5250
"file-type": "19.0.0 || 19.0.0-rc-f994737d14-20240522",
5351
"graphql-http": "^1.22.0",
5452
"graphql-playground-html": "1.6.30",
@@ -57,12 +55,13 @@
5755
"qs": "6.11.2",
5856
"react-diff-viewer-continued": "3.2.6",
5957
"react-toastify": "10.0.5",
60-
"sass": "^1.71.1",
58+
"sass": "1.77.4",
6159
"ws": "^8.16.0"
6260
},
6361
"devDependencies": {
6462
"@next/eslint-plugin-next": "^14.1.0",
6563
"@payloadcms/eslint-config": "workspace:*",
64+
"@types/busboy": "^1.5.3",
6665
"@types/react": "npm:types-react@19.0.0-beta.2",
6766
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2",
6867
"@types/ws": "^8.5.10",
@@ -71,8 +70,8 @@
7170
"mini-css-extract-plugin": "1.6.2",
7271
"payload": "workspace:*",
7372
"postcss-loader": "^8.1.1",
74-
"postcss-preset-env": "^9.5.0",
75-
"sass-loader": "^14.1.1",
73+
"postcss-preset-env": "^9.5.14",
74+
"sass-loader": "14.2.1",
7675
"swc-loader": "^0.2.6",
7776
"swc-plugin-transform-remove-imports": "^1.12.1",
7877
"terser-webpack-plugin": "^5.3.10",

packages/next/src/views/Document/getDocumentData.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { Locale } from 'payload/config'
12
import type {
23
Data,
34
PayloadRequestWithData,

0 commit comments

Comments
 (0)