Compare commits
171 Commits
v3.0.0-alp
...
v3.0.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba2702cfca | ||
|
|
eba1f6327d | ||
|
|
1ba0b4037c | ||
|
|
49daa75bc4 | ||
|
|
fea1eb1149 | ||
|
|
9a58f6c454 | ||
|
|
66cefe6bb5 | ||
|
|
23510acf40 | ||
|
|
faa49f36e7 | ||
|
|
a5fb8b20a1 | ||
|
|
e14b303609 | ||
|
|
2ec3df6680 | ||
|
|
1f4b6001ef | ||
|
|
6e7c9cc6a3 | ||
|
|
2db385c6a5 | ||
|
|
bd27f48eae | ||
|
|
98a33250f6 | ||
|
|
8f9729a928 | ||
|
|
1a8564bc35 | ||
|
|
76c9632417 | ||
|
|
2370361b43 | ||
|
|
cb63095d3f | ||
|
|
601f2fb450 | ||
|
|
e746f17167 | ||
|
|
5f76097562 | ||
|
|
03756c4210 | ||
|
|
5e1e158414 | ||
|
|
76d2525fd2 | ||
|
|
ec8c7e5c2c | ||
|
|
0a4cbe1a08 | ||
|
|
c228421a38 | ||
|
|
a742f82370 | ||
|
|
213678ca3e | ||
|
|
e1b7ad6a71 | ||
|
|
8b9985a92c | ||
|
|
f276826b09 | ||
|
|
8c1df551ef | ||
|
|
b62cb157e1 | ||
|
|
045c74ce67 | ||
|
|
911e902da4 | ||
|
|
4e0d90d720 | ||
|
|
7b62705cc0 | ||
|
|
bdf02bebaa | ||
|
|
94aa309910 | ||
|
|
499a0a782a | ||
|
|
1e5a531a83 | ||
|
|
3e6a4073c4 | ||
|
|
e7cb6abd1f | ||
|
|
abfd8841a5 | ||
|
|
5e385fa33b | ||
|
|
95688c7e30 | ||
|
|
b041d3e70e | ||
|
|
0e91cddab9 | ||
|
|
d3856693ce | ||
|
|
40f36104f3 | ||
|
|
7215edb784 | ||
|
|
be015320de | ||
|
|
a37d53b2e7 | ||
|
|
f43de11121 | ||
|
|
4c1129188b | ||
|
|
34e04f5251 | ||
|
|
b613d65b36 | ||
|
|
66aec63f6b | ||
|
|
5b0d18bb3b | ||
|
|
1c5b43c218 | ||
|
|
c78cfb9fcf | ||
|
|
927d4dd06f | ||
|
|
afb75ef75a | ||
|
|
92181866a4 | ||
|
|
c97805c7f1 | ||
|
|
c20a139e58 | ||
|
|
4287d1032f | ||
|
|
8b784d7c10 | ||
|
|
8895f6420f | ||
|
|
bb10ed5b7d | ||
|
|
9dc315dbf3 | ||
|
|
677531531f | ||
|
|
70c89b14a9 | ||
|
|
7f7c94e0d5 | ||
|
|
e6f09e42a1 | ||
|
|
f0419b7502 | ||
|
|
f01072eb11 | ||
|
|
c88102d6cc | ||
|
|
847a2994f9 | ||
|
|
ab186c0608 | ||
|
|
349ae8ed27 | ||
|
|
0066b858d6 | ||
|
|
e12e720a99 | ||
|
|
c17f2e2560 | ||
|
|
d75bf235bb | ||
|
|
881d1e9594 | ||
|
|
45a443989a | ||
|
|
7880fb402a | ||
|
|
ac2f8c9141 | ||
|
|
e36e774382 | ||
|
|
b1be2dfbf4 | ||
|
|
32f3a11bf7 | ||
|
|
7d0c72f92e | ||
|
|
27e0e12595 | ||
|
|
f6ae6b3658 | ||
|
|
9e1d633244 | ||
|
|
6b28e72686 | ||
|
|
dfd3a06600 | ||
|
|
2c35a6f0e1 | ||
|
|
f956558656 | ||
|
|
32fa7006ff | ||
|
|
95acf71dbf | ||
|
|
5640c27cec | ||
|
|
a7c5e4f317 | ||
|
|
274682e736 | ||
|
|
b4b6ab2667 | ||
|
|
bbe9dd6760 | ||
|
|
2aa7adb3bd | ||
|
|
fb7e671c26 | ||
|
|
7420dba0c9 | ||
|
|
9a059bdce4 | ||
|
|
50c7269315 | ||
|
|
b4434a369b | ||
|
|
1c945ebfbf | ||
|
|
20d0915a03 | ||
|
|
21ee94739b | ||
|
|
9ebb894694 | ||
|
|
483db08057 | ||
|
|
3a557998d0 | ||
|
|
c8322349a0 | ||
|
|
75b993bc6b | ||
|
|
b9db83a741 | ||
|
|
5bbb65b569 | ||
|
|
974eedc4dd | ||
|
|
c38c95dab5 | ||
|
|
c3a3446baa | ||
|
|
443413c03e | ||
|
|
0c56f420d5 | ||
|
|
f66bcb22c4 | ||
|
|
b44d59a303 | ||
|
|
dbe382f91e | ||
|
|
1d4ec9cd71 | ||
|
|
36f88b198c | ||
|
|
e2ca80a33f | ||
|
|
c08f981224 | ||
|
|
846f59974c | ||
|
|
5e368f486a | ||
|
|
42eed07dfd | ||
|
|
fcd647832c | ||
|
|
06d30f0182 | ||
|
|
c6c5b2e682 | ||
|
|
5431a84f37 | ||
|
|
764c6f0086 | ||
|
|
7f48c5c0e5 | ||
|
|
bd66cda0ee | ||
|
|
030ddbe12f | ||
|
|
60e3b21596 | ||
|
|
647e0236bb | ||
|
|
83c0b8b96e | ||
|
|
4d2f1ca10e | ||
|
|
678a617b0b | ||
|
|
b88d78a7e5 | ||
|
|
3d4092ee3e | ||
|
|
0306a79a37 | ||
|
|
539503f766 | ||
|
|
e06022e4d4 | ||
|
|
afb93eda2c | ||
|
|
6d2f5fcb60 | ||
|
|
1fb37aec25 | ||
|
|
5174662fe8 | ||
|
|
e47bafce29 | ||
|
|
7cf68a4b68 | ||
|
|
694d5d92b7 | ||
|
|
83d9d98ba3 | ||
|
|
cf3d0fe78d | ||
|
|
56aaf52430 |
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
@@ -4,7 +4,7 @@ on:
|
||||
pull_request:
|
||||
types: [ opened, reopened, synchronize ]
|
||||
push:
|
||||
branches: ['main', 'feat/next-poc']
|
||||
branches: ['main', 'alpha']
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
@@ -196,9 +196,6 @@ jobs:
|
||||
echo "POSTGRES_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres" >> $GITHUB_ENV
|
||||
if: matrix.database == 'supabase'
|
||||
|
||||
- name: Component Tests
|
||||
run: pnpm test:components
|
||||
|
||||
- name: Integration Tests
|
||||
run: pnpm test:int
|
||||
env:
|
||||
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -8,12 +8,15 @@ test-results
|
||||
.devcontainer
|
||||
.localstack
|
||||
/migrations
|
||||
/media
|
||||
.localstack
|
||||
.turbo
|
||||
|
||||
.turbo
|
||||
|
||||
# Ignore test directory media folder/files
|
||||
/media
|
||||
/versions
|
||||
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/node,macos,windows,webstorm,sublimetext,visualstudiocode
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos,windows,webstorm,sublimetext,visualstudiocode
|
||||
|
||||
@@ -285,3 +288,4 @@ $RECYCLE.BIN/
|
||||
# End of https://www.toptal.com/developers/gitignore/api/node,macos,windows,webstorm,sublimetext,visualstudiocode
|
||||
|
||||
/build
|
||||
.swc
|
||||
15
.idea/runConfigurations/Playwright_test.xml
generated
Normal file
15
.idea/runConfigurations/Playwright_test.xml
generated
Normal file
@@ -0,0 +1,15 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Playwright test" type="JavaScriptTestRunnerPlaywright">
|
||||
<node-interpreter value="project" />
|
||||
<playwright-package value="$PROJECT_DIR$/node_modules/playwright" />
|
||||
<working-dir value="$PROJECT_DIR$" />
|
||||
<envs />
|
||||
<scope-kind value="TEST" />
|
||||
<test-file value="$PROJECT_DIR$/test/_community/e2e.spec.ts" />
|
||||
<test-names>
|
||||
<test-name value="Admin Panel" />
|
||||
<test-name value="example test" />
|
||||
</test-names>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
15
.swcrc
Normal file
15
.swcrc
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/swcrc",
|
||||
"sourceMaps": "inline",
|
||||
"jsc": {
|
||||
"target": "esnext",
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": true,
|
||||
"dts": true
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"type": "es6"
|
||||
}
|
||||
}
|
||||
18
.vscode/launch.json
vendored
18
.vscode/launch.json
vendored
@@ -2,6 +2,13 @@
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
"configurations": [
|
||||
{
|
||||
"command": "pnpm generate:types",
|
||||
"name": "Generate Types CLI",
|
||||
"request": "launch",
|
||||
"type": "node-terminal",
|
||||
"cwd": "${workspaceFolder}"
|
||||
},
|
||||
{
|
||||
"command": "pnpm run dev _community -- --no-turbo",
|
||||
"cwd": "${workspaceFolder}",
|
||||
@@ -102,17 +109,6 @@
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
},
|
||||
{
|
||||
"command": "ts-node ./packages/payload/src/bin/index.ts generate:types",
|
||||
"env": {
|
||||
"PAYLOAD_CONFIG_PATH": "test/_community/config.ts",
|
||||
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
|
||||
},
|
||||
"name": "Generate Types CLI",
|
||||
"outputCapture": "std",
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
},
|
||||
{
|
||||
"command": "ts-node ./packages/payload/src/bin/index.ts migrate:status",
|
||||
"env": {
|
||||
|
||||
22
.vscode/settings.json
vendored
22
.vscode/settings.json
vendored
@@ -40,25 +40,5 @@
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit"
|
||||
}
|
||||
},
|
||||
"workbench.colorCustomizations": {
|
||||
"activityBar.activeBackground": "#8cb5b6",
|
||||
"activityBar.background": "#8cb5b6",
|
||||
"activityBar.foreground": "#15202b",
|
||||
"activityBar.inactiveForeground": "#15202b99",
|
||||
"activityBarBadge.background": "#9c639b",
|
||||
"activityBarBadge.foreground": "#e7e7e7",
|
||||
"commandCenter.border": "#15202b99",
|
||||
"sash.hoverBorder": "#8cb5b6",
|
||||
"statusBar.background": "#6da1a2",
|
||||
"statusBar.foreground": "#15202b",
|
||||
"statusBarItem.hoverBackground": "#568586",
|
||||
"statusBarItem.remoteBackground": "#6da1a2",
|
||||
"statusBarItem.remoteForeground": "#15202b",
|
||||
"titleBar.activeBackground": "#6da1a2",
|
||||
"titleBar.activeForeground": "#15202b",
|
||||
"titleBar.inactiveBackground": "#6da1a299",
|
||||
"titleBar.inactiveForeground": "#15202b99"
|
||||
},
|
||||
"peacock.color": "#6da1a2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
|
||||
/* DO NOT MODIFY it because it could be re-written at any time. */
|
||||
import config from '@payload-config'
|
||||
import { GET_STATIC_FILE } from '@payloadcms/next/routes/index.js'
|
||||
|
||||
export const GET = GET_STATIC_FILE(config)
|
||||
@@ -292,13 +292,11 @@ For auth-enabled Collections, this hook runs after successful `forgotPassword` o
|
||||
```ts
|
||||
import { CollectionAfterForgotPasswordHook } from 'payload/types'
|
||||
|
||||
const afterLoginHook: CollectionAfterForgotPasswordHook = async ({
|
||||
req, // full express request
|
||||
user, // user being logged in
|
||||
token, // user token
|
||||
}) => {
|
||||
return user
|
||||
}
|
||||
const afterForgotPasswordHook: CollectionAfterForgotPasswordHook = async ({
|
||||
args, // arguments passed into the operation
|
||||
context,
|
||||
collection, // The collection which this hook is being run on
|
||||
}) => {...}
|
||||
```
|
||||
|
||||
## TypeScript
|
||||
|
||||
@@ -290,5 +290,5 @@ If you've configured tests for your package, integrate them into your workf
|
||||
The best way to share and allow others to use your plugin once it is complete is to publish an NPM package. This process is straightforward and well documented, find out more about [creating and publishing a NPM package here](https://docs.npmjs.com/creating-and-publishing-scoped-public-packages/).
|
||||
##### Add payload-plugin topic tag:
|
||||
Apply the tag **payload-plugin** to your GitHub repository. This will boost the visibility of your plugin and ensure it gets listed with [existing payload plugins](https://github.com/topics/payload-plugin).
|
||||
##### Use [Semantic Versioning](https://semver.org/) (SemVar):
|
||||
With the SemVar system you release version numbers that reflect the nature of changes (major, minor, patch). Ensure all major versions reference their Payload compatibility.
|
||||
##### Use [Semantic Versioning](https://semver.org/) (SemVer):
|
||||
With the SemVer system you release version numbers that reflect the nature of changes (major, minor, patch). Ensure all major versions reference their Payload compatibility.
|
||||
|
||||
1
emptyModule.js
Normal file
1
emptyModule.js
Normal file
@@ -0,0 +1 @@
|
||||
export default {}
|
||||
@@ -1,16 +0,0 @@
|
||||
module.exports = {
|
||||
moduleNameMapper: {
|
||||
'\\.(css|scss)$': '<rootDir>/packages/payload/src/bundlers/mocks/emptyModule.js',
|
||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
||||
'<rootDir>/packages/payload/src/bundlers/mocks/fileMock.js',
|
||||
},
|
||||
setupFilesAfterEnv: ['./test/componentsSetup.js'],
|
||||
testEnvironment: 'jsdom',
|
||||
testPathIgnorePatterns: ['node_modules', 'dist'],
|
||||
testRegex: '(/src/admin/.*\\.(test|spec))\\.[jt]sx?$',
|
||||
testTimeout: 15000,
|
||||
transform: {
|
||||
'^.+\\.(t|j)sx?$': ['@swc/jest'],
|
||||
},
|
||||
verbose: true,
|
||||
}
|
||||
@@ -6,11 +6,13 @@
|
||||
// })
|
||||
|
||||
const customJestConfig = {
|
||||
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
||||
globalSetup: './test/jest.setup.ts',
|
||||
moduleNameMapper: {
|
||||
'\\.(css|scss)$': '<rootDir>/packages/payload/src/bundlers/mocks/emptyModule.js',
|
||||
'\\.(css|scss)$': '<rootDir>/test/helpers/mocks/emptyModule.js',
|
||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
||||
'<rootDir>/packages/payload/src/bundlers/mocks/fileMock.js',
|
||||
'<rootDir>/test/helpers/mocks/fileMock.js',
|
||||
'^(\\.{1,2}/.*)\\.js$': '$1',
|
||||
},
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['<rootDir>/packages/payload/src/**/*.spec.ts', '<rootDir>/test/**/*int.spec.ts'],
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import withPayload from './packages/next/src/withPayload.js'
|
||||
import bundleAnalyzer from '@next/bundle-analyzer'
|
||||
|
||||
import withPayload from './packages/next/src/withPayload.js'
|
||||
|
||||
const withBundleAnalyzer = bundleAnalyzer({
|
||||
enabled: process.env.ANALYZE === 'true',
|
||||
})
|
||||
@@ -8,14 +9,6 @@ const withBundleAnalyzer = bundleAnalyzer({
|
||||
export default withBundleAnalyzer(
|
||||
withPayload({
|
||||
reactStrictMode: false,
|
||||
webpack: (webpackConfig) => {
|
||||
webpackConfig.resolve.extensionAlias = {
|
||||
'.js': ['.ts', '.tsx', '.js', '.jsx'],
|
||||
'.mjs': ['.mts', '.mjs'],
|
||||
'.cjs': ['.cts', '.cjs'],
|
||||
}
|
||||
return webpackConfig
|
||||
},
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
@@ -25,5 +18,13 @@ export default withBundleAnalyzer(
|
||||
},
|
||||
]
|
||||
},
|
||||
webpack: (webpackConfig) => {
|
||||
webpackConfig.resolve.extensionAlias = {
|
||||
'.cjs': ['.cts', '.cjs'],
|
||||
'.js': ['.ts', '.tsx', '.js', '.jsx'],
|
||||
'.mjs': ['.mts', '.mjs'],
|
||||
}
|
||||
return webpackConfig
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
43
package.json
43
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "payload-monorepo",
|
||||
"version": "3.0.0-alpha.29",
|
||||
"version": "3.0.0-alpha.45",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"workspaces:": [
|
||||
@@ -8,10 +8,12 @@
|
||||
],
|
||||
"scripts": {
|
||||
"build": "pnpm run build:core",
|
||||
"obliterate-playwright-cache": "rm -rf ~/Library/Caches/ms-playwright && find /System/Volumes/Data/private/var/folders -type d -name 'playwright*' -exec rm -rf {} ++ && npx playwright install",
|
||||
"build:all": "turbo build",
|
||||
"build:core": "turbo build --filter \"!@payloadcms/plugin-*\"",
|
||||
"build:plugins": "turbo build --filter \"@payloadcms/plugin-*\" --filter \"!@payloadcms/plugin-search\" --filter \"!@payloadcms/plugin-redirects\" --filter \"!@payloadcms/plugin-nested-docs\"",
|
||||
"build:plugins": "turbo build --filter \"@payloadcms/plugin-*\"",
|
||||
"build:app": "next build",
|
||||
"build:app:analyze": "cross-env ANALYZE=true next build",
|
||||
"build:create-payload-app": "turbo build --filter create-payload-app",
|
||||
"build:db-mongodb": "turbo build --filter db-mongodb",
|
||||
"build:db-postgres": "turbo build --filter db-postgres",
|
||||
@@ -36,15 +38,18 @@
|
||||
"build:ui": "turbo build --filter ui",
|
||||
"clean": "turbo clean",
|
||||
"clean:cache": "rimraf node_modules/.cache && rimraf packages/payload/node_modules/.cache && rimraf .next",
|
||||
"clean:all": "find . \\( -type d \\( -name node_modules -o -name dist -o -name .cache \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} +",
|
||||
"clean:build": "find . \\( -type d \\( -name dist -o -name .cache -o -name .next -o -name .turbo \\) -o -type f -name tsconfig.tsbuildinfo \\) -not -path '*/node_modules/*' -exec rm -rf {} +",
|
||||
"clean:all": "find . \\( -type d \\( -name node_modules -o -name dist -o -name .cache -o -name .next -o -name .turbo \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} +",
|
||||
"dev": "cross-env node --no-deprecation ./test/dev.js",
|
||||
"dev:generate-graphql-schema": "NODE_OPTIONS=--no-deprecation ts-node -T ./test/generateGraphQLSchema.ts",
|
||||
"dev:generate-types": "NODE_OPTIONS=--no-deprecation ts-node -T ./test/generateTypes.ts",
|
||||
"devsafe": "rm -rf .next && cross-env node --no-deprecation ./test/dev.js",
|
||||
"dev:generate-graphql-schema": "cross-env NODE_OPTIONS=--no-deprecation tsx ./test/generateGraphQLSchema.ts",
|
||||
"dev:generate-types": "cross-env NODE_OPTIONS=--no-deprecation tsx ./test/generateTypes.ts",
|
||||
"dev:postgres": "pnpm --filter payload run dev:postgres",
|
||||
"docker:restart": "pnpm docker:stop --remove-orphans && pnpm docker:start",
|
||||
"docker:start": "docker-compose -f packages/plugin-cloud-storage/docker-compose.yml up -d",
|
||||
"docker:stop": "docker-compose -f packages/plugin-cloud-storage/docker-compose.yml down",
|
||||
"fix": "eslint \"packages/**/*.ts\" --fix",
|
||||
"generate:types": "PAYLOAD_CONFIG_PATH=./test/_community/config.ts node --no-deprecation ./packages/payload/bin.js generate:types",
|
||||
"lint": "eslint \"packages/**/*.ts\"",
|
||||
"lint-staged": "lint-staged",
|
||||
"prepare": "husky install",
|
||||
@@ -55,7 +60,7 @@
|
||||
"release:beta": "tsx ./scripts/release.ts --bump prerelease --tag beta",
|
||||
"test": "pnpm test:int && pnpm test:components && pnpm test:e2e",
|
||||
"test:components": "cross-env NODE_OPTIONS=--no-deprecation jest --config=jest.components.config.js",
|
||||
"test:e2e": "NODE_OPTIONS=--no-deprecation npx playwright install --with-deps chromium && NODE_OPTIONS=--no-deprecation ts-node -T ./test/runE2E.ts",
|
||||
"test:e2e": "NODE_OPTIONS=--no-deprecation npx playwright install --with-deps chromium && NODE_OPTIONS=--no-deprecation tsx ./test/runE2E.ts",
|
||||
"test:e2e:debug": "cross-env NODE_OPTIONS=--no-deprecation PWDEBUG=1 DISABLE_LOGGING=true playwright test",
|
||||
"test:e2e:headed": "cross-env NODE_OPTIONS=--no-deprecation DISABLE_LOGGING=true playwright test --headed",
|
||||
"test:int:postgres": "cross-env NODE_OPTIONS=--no-deprecation PAYLOAD_DATABASE=postgres DISABLE_LOGGING=true jest --forceExit --detectOpenHandles",
|
||||
@@ -67,19 +72,18 @@
|
||||
"@next/bundle-analyzer": "^14.1.0",
|
||||
"@octokit/core": "^5.1.0",
|
||||
"@payloadcms/eslint-config": "workspace:*",
|
||||
"@playwright/test": "1.40.1",
|
||||
"@playwright/test": "^1.42.1",
|
||||
"@swc/cli": "^0.1.62",
|
||||
"@swc/jest": "0.2.29",
|
||||
"@swc/register": "0.1.10",
|
||||
"@testing-library/jest-dom": "5.17.0",
|
||||
"@testing-library/react": "13.4.0",
|
||||
"@swc/jest": "0.2.36",
|
||||
"@testing-library/jest-dom": "6.4.2",
|
||||
"@testing-library/react": "14.2.1",
|
||||
"@types/concat-stream": "^2.0.1",
|
||||
"@types/conventional-changelog": "^3.1.4",
|
||||
"@types/conventional-changelog-core": "^4.2.5",
|
||||
"@types/conventional-changelog-preset-loader": "^2.3.4",
|
||||
"@types/conventional-changelog-writer": "^4.0.10",
|
||||
"@types/fs-extra": "^11.0.2",
|
||||
"@types/jest": "29.5.7",
|
||||
"@types/jest": "29.5.12",
|
||||
"@types/minimist": "1.2.2",
|
||||
"@types/node": "20.5.7",
|
||||
"@types/prompts": "^2.4.5",
|
||||
@@ -87,7 +91,6 @@
|
||||
"@types/react": "18.2.15",
|
||||
"@types/semver": "^7.5.3",
|
||||
"@types/shelljs": "0.8.12",
|
||||
"@types/testing-library__jest-dom": "5.14.8",
|
||||
"add-stream": "^1.0.0",
|
||||
"chalk": "^4.1.2",
|
||||
"comment-json": "^4.2.3",
|
||||
@@ -102,7 +105,6 @@
|
||||
"dotenv": "8.6.0",
|
||||
"drizzle-orm": "0.29.4",
|
||||
"execa": "5.1.1",
|
||||
"express": "4.18.2",
|
||||
"form-data": "3.0.1",
|
||||
"fs-extra": "10.1.0",
|
||||
"get-port": "5.1.1",
|
||||
@@ -122,6 +124,8 @@
|
||||
"nodemon": "3.0.3",
|
||||
"pino": "8.15.0",
|
||||
"pino-pretty": "10.2.0",
|
||||
"playwright": "^1.42.1",
|
||||
"playwright-core": "^1.42.1",
|
||||
"prettier": "^3.0.3",
|
||||
"prompts": "2.4.2",
|
||||
"qs": "6.11.2",
|
||||
@@ -136,9 +140,9 @@
|
||||
"slash": "3.0.0",
|
||||
"slate": "0.91.4",
|
||||
"tempfile": "^3.0.0",
|
||||
"ts-node": "10.9.2",
|
||||
"ts-node": "10.9.1",
|
||||
"tsx": "^4.7.1",
|
||||
"turbo": "^1.12.4",
|
||||
"turbo": "^1.12.5",
|
||||
"typescript": "5.2.2",
|
||||
"uuid": "^9.0.1",
|
||||
"yocto-queue": "^1.0.0"
|
||||
@@ -153,7 +157,8 @@
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,jsx,ts,tsx}": [
|
||||
"prettier --write"
|
||||
"prettier --write",
|
||||
"eslint --cache --fix"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -169,7 +174,6 @@
|
||||
"graphql": "^16.8.1",
|
||||
"react": "$react",
|
||||
"react-dom": "$react-dom",
|
||||
"ts-node": "$ts-node",
|
||||
"typescript": "$typescript"
|
||||
},
|
||||
"allowedDeprecatedVersions": {
|
||||
@@ -177,5 +181,6 @@
|
||||
"abab": "2",
|
||||
"domexception": "4"
|
||||
}
|
||||
}
|
||||
},
|
||||
"packageManager": "pnpm@8.15.4+sha256.cea6d0bdf2de3a0549582da3983c70c92ffc577ff4410cbf190817ddc35137c2"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/swcrc",
|
||||
"sourceMaps": "inline",
|
||||
"sourceMaps": true,
|
||||
"jsc": {
|
||||
"target": "esnext",
|
||||
"parser": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/swcrc",
|
||||
"sourceMaps": "inline",
|
||||
"sourceMaps": true,
|
||||
"jsc": {
|
||||
"target": "esnext",
|
||||
"parser": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@payloadcms/db-mongodb",
|
||||
"version": "3.0.0-alpha.29",
|
||||
"version": "3.0.0-alpha.45",
|
||||
"description": "The officially supported MongoDB database adapter for Payload - Update 2",
|
||||
"repository": "https://github.com/payloadcms/payload",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { Connect } from 'payload/database'
|
||||
|
||||
import mongoose from 'mongoose'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
export const connect: Connect = async function connect(
|
||||
this: MongooseAdapter,
|
||||
@@ -23,7 +23,6 @@ export const connect: Connect = async function connect(
|
||||
}
|
||||
|
||||
const urlToConnect = this.url
|
||||
const successfulConnectionMessage = 'Connected to MongoDB server successfully!'
|
||||
|
||||
const connectionOptions: ConnectOptions & { useFacet: undefined } = {
|
||||
autoIndex: true,
|
||||
@@ -49,8 +48,6 @@ export const connect: Connect = async function connect(
|
||||
await mongoose.connection.dropDatabase()
|
||||
this.payload.logger.info('---- DROPPED DATABASE ----')
|
||||
}
|
||||
|
||||
this.payload.logger.info(successfulConnectionMessage)
|
||||
}
|
||||
} catch (err) {
|
||||
this.payload.logger.error(`Error: cannot connect to MongoDB. Details: ${err.message}`, err)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Create } from 'payload/database'
|
||||
import type { Document, PayloadRequest } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import handleError from './utilities/handleError.js'
|
||||
import { withSession } from './withSession.js'
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import type { CreateGlobal } from 'payload/database'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
|
||||
import { withSession } from './withSession.js'
|
||||
|
||||
export const createGlobal: CreateGlobal = async function createGlobal(
|
||||
this: MongooseAdapter,
|
||||
{ data, req = {} as PayloadRequest, slug },
|
||||
{ slug, data, req = {} as PayloadRequest },
|
||||
) {
|
||||
const Model = this.globals
|
||||
const global = {
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { CreateGlobalVersion } from 'payload/database'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
import type { Document } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import { withSession } from './withSession.js'
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { CreateMigration } from 'payload/database'
|
||||
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
const migrationTemplate = (upSQL?: string, downSQL?: string) => `import {
|
||||
MigrateUpArgs,
|
||||
@@ -23,6 +24,9 @@ export const createMigration: CreateMigration = async function createMigration({
|
||||
migrationName,
|
||||
payload,
|
||||
}) {
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
const dirname = path.dirname(filename)
|
||||
|
||||
const dir = payload.db.migrationDir
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir)
|
||||
@@ -37,11 +41,11 @@ export const createMigration: CreateMigration = async function createMigration({
|
||||
|
||||
const predefinedMigrationName = file.replace('@payloadcms/db-mongodb/', '')
|
||||
migrationName = predefinedMigrationName
|
||||
const cleanPath = path.join(__dirname, `../predefinedMigrations/${predefinedMigrationName}.js`)
|
||||
const cleanPath = path.join(dirname, `../predefinedMigrations/${predefinedMigrationName}.js`)
|
||||
|
||||
// Check if predefined migration exists
|
||||
if (fs.existsSync(cleanPath)) {
|
||||
const { down, up } = eval(`require(${cleanPath})`)
|
||||
const { down, up } = await eval(`import(${cleanPath})`)
|
||||
migrationFileContent = migrationTemplate(up, down)
|
||||
} else {
|
||||
payload.logger.error({
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { CreateVersion } from 'payload/database'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
import type { Document } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import { withSession } from './withSession.js'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { DeleteMany } from 'payload/database'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import { withSession } from './withSession.js'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { DeleteOne } from 'payload/database'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
import type { Document } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
|
||||
import { withSession } from './withSession.js'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { DeleteVersions } from 'payload/database'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import { withSession } from './withSession.js'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { Destroy } from 'payload/database'
|
||||
|
||||
import mongoose from 'mongoose'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
export const destroy: Destroy = async function destroy(this: MongooseAdapter) {
|
||||
if (this.mongoMemoryServer) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import { flattenWhereToOperators } from 'payload/database'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import { buildSortParam } from './queries/buildSortParam.js'
|
||||
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import { combineQueries } from 'payload/database'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
|
||||
import { withSession } from './withSession.js'
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { PayloadRequest } from 'payload/types'
|
||||
import { flattenWhereToOperators } from 'payload/database'
|
||||
import { buildVersionGlobalFields } from 'payload/versions'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import { buildSortParam } from './queries/buildSortParam.js'
|
||||
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { FindOne } from 'payload/database'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
import type { Document } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
|
||||
import { withSession } from './withSession.js'
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import { flattenWhereToOperators } from 'payload/database'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import { buildSortParam } from './queries/buildSortParam.js'
|
||||
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
|
||||
|
||||
@@ -8,7 +8,7 @@ import mongoose from 'mongoose'
|
||||
import path from 'path'
|
||||
import { createDatabaseAdapter } from 'payload/database'
|
||||
|
||||
import type { CollectionModel, GlobalModel } from './types.d.ts'
|
||||
import type { CollectionModel, GlobalModel } from './types.js'
|
||||
|
||||
import { connect } from './connect.js'
|
||||
import { create } from './create.js'
|
||||
@@ -36,7 +36,7 @@ import { updateGlobalVersion } from './updateGlobalVersion.js'
|
||||
import { updateOne } from './updateOne.js'
|
||||
import { updateVersion } from './updateVersion.js'
|
||||
|
||||
export type { MigrateDownArgs, MigrateUpArgs } from './types.d.ts'
|
||||
export type { MigrateDownArgs, MigrateUpArgs } from './types.js'
|
||||
import type { DatabaseAdapterObj } from 'payload/database'
|
||||
|
||||
export interface Args {
|
||||
|
||||
@@ -11,8 +11,8 @@ import {
|
||||
getVersionsModelName,
|
||||
} from 'payload/versions'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { CollectionModel } from './types.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
import type { CollectionModel } from './types.js'
|
||||
|
||||
import buildCollectionSchema from './models/buildCollectionSchema.js'
|
||||
import { buildGlobalModel } from './models/buildGlobalModel.js'
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from 'payload/database'
|
||||
import prompts from 'prompts'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
/**
|
||||
* Drop the current database and run all migrate up functions
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { SanitizedConfig } from 'payload/config'
|
||||
|
||||
import mongoose from 'mongoose'
|
||||
|
||||
import type { GlobalModel } from '../types.d.ts'
|
||||
import type { GlobalModel } from '../types.js'
|
||||
|
||||
import getBuildQueryPlugin from '../queries/buildQuery.js'
|
||||
import buildSchema from './buildSchema.js'
|
||||
|
||||
@@ -3,17 +3,20 @@ import type { PathToQuery } from 'payload/database'
|
||||
import type { Field } from 'payload/types'
|
||||
import type { Operator } from 'payload/types'
|
||||
|
||||
import ObjectId from 'bson-objectid'
|
||||
import ObjectIdImport from 'bson-objectid'
|
||||
import mongoose from 'mongoose'
|
||||
import { getLocalizedPaths } from 'payload/database'
|
||||
import { fieldAffectsData } from 'payload/types'
|
||||
import { validOperators } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from '../index.d.ts'
|
||||
import type { MongooseAdapter } from '../index.js'
|
||||
|
||||
import { operatorMap } from './operatorMap.js'
|
||||
import { sanitizeQueryValue } from './sanitizeQueryValue.js'
|
||||
|
||||
const ObjectId = (ObjectIdImport.default ||
|
||||
ObjectIdImport) as unknown as typeof ObjectIdImport.default
|
||||
|
||||
type SearchParam = {
|
||||
path?: string
|
||||
rawQuery?: unknown
|
||||
@@ -205,7 +208,7 @@ export async function buildSearchParam({
|
||||
if (typeof formattedValue === 'string') {
|
||||
if (mongoose.Types.ObjectId.isValid(formattedValue)) {
|
||||
result.value.$or.push({
|
||||
[path]: { [operatorKey]: new ObjectId.default(formattedValue) },
|
||||
[path]: { [operatorKey]: new ObjectId(formattedValue) },
|
||||
})
|
||||
} else {
|
||||
;(Array.isArray(field.relationTo) ? field.relationTo : [field.relationTo]).forEach(
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import { combineQueries, flattenWhereToOperators } from 'payload/database'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import { buildSortParam } from './queries/buildSortParam.js'
|
||||
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { BeginTransaction } from 'payload/database'
|
||||
import { APIError } from 'payload/errors'
|
||||
import { v4 as uuid } from 'uuid'
|
||||
|
||||
import type { MongooseAdapter } from '../index.d.ts'
|
||||
import type { MongooseAdapter } from '../index.js'
|
||||
|
||||
export const beginTransaction: BeginTransaction = async function beginTransaction(
|
||||
this: MongooseAdapter,
|
||||
|
||||
@@ -25,7 +25,7 @@ import type {
|
||||
UploadField,
|
||||
} from 'payload/types'
|
||||
|
||||
import type { BuildQueryArgs } from './queries/buildQuery.d.ts'
|
||||
import type { BuildQueryArgs } from './queries/buildQuery.js'
|
||||
|
||||
export interface CollectionModel extends Model<any>, PaginateModel<any> {
|
||||
/** buildQuery is used to transform payload's where operator into what can be used by mongoose (e.g. id => _id) */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { UpdateGlobal } from 'payload/database'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
|
||||
import { withSession } from './withSession.js'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { UpdateGlobalVersionArgs } from 'payload/database'
|
||||
import type { PayloadRequest, TypeWithID } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import { withSession } from './withSession.js'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { UpdateOne } from 'payload/database'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import handleError from './utilities/handleError.js'
|
||||
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { UpdateVersion } from 'payload/database'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
import { withSession } from './withSession.js'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ClientSession } from 'mongoose'
|
||||
|
||||
import type { MongooseAdapter } from './index.d.ts'
|
||||
import type { MongooseAdapter } from './index.js'
|
||||
|
||||
/**
|
||||
* returns the session belonging to the transaction of the req.session if exists
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/swcrc",
|
||||
"sourceMaps": "inline",
|
||||
"sourceMaps": true,
|
||||
"jsc": {
|
||||
"target": "esnext",
|
||||
"parser": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@payloadcms/db-postgres",
|
||||
"version": "3.0.0-alpha.29",
|
||||
"version": "3.0.0-alpha.45",
|
||||
"description": "The officially supported Postgres database adapter for Payload",
|
||||
"repository": "https://github.com/payloadcms/payload",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import type { Payload } from 'payload'
|
||||
import type { Connect } from 'payload/database'
|
||||
|
||||
import { eq, sql } from 'drizzle-orm'
|
||||
import { sql } from 'drizzle-orm'
|
||||
import { drizzle } from 'drizzle-orm/node-postgres'
|
||||
import { numeric, timestamp, varchar } from 'drizzle-orm/pg-core'
|
||||
import { Pool } from 'pg'
|
||||
import prompts from 'prompts'
|
||||
import pg from 'pg'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { pushDevSchema } from './utilities/pushDevSchema.js'
|
||||
|
||||
const connectWithReconnect = async function ({
|
||||
adapter,
|
||||
@@ -61,7 +61,7 @@ export const connect: Connect = async function connect(
|
||||
}
|
||||
|
||||
try {
|
||||
this.pool = new Pool(this.poolOptions)
|
||||
this.pool = new pg.Pool(this.poolOptions)
|
||||
await connectWithReconnect({ adapter: this, payload: this.payload })
|
||||
|
||||
const logger = this.logger || false
|
||||
@@ -93,70 +93,5 @@ export const connect: Connect = async function connect(
|
||||
)
|
||||
return
|
||||
|
||||
const { pushSchema } = require('drizzle-kit/payload')
|
||||
|
||||
// This will prompt if clarifications are needed for Drizzle to push new schema
|
||||
const { apply, hasDataLoss, statementsToExecute, warnings } = await pushSchema(
|
||||
this.schema,
|
||||
this.drizzle,
|
||||
)
|
||||
|
||||
if (warnings.length) {
|
||||
let message = `Warnings detected during schema push: \n\n${warnings.join('\n')}\n\n`
|
||||
|
||||
if (hasDataLoss) {
|
||||
message += `DATA LOSS WARNING: Possible data loss detected if schema is pushed.\n\n`
|
||||
}
|
||||
|
||||
message += `Accept warnings and push schema to database?`
|
||||
|
||||
const { confirm: acceptWarnings } = await prompts(
|
||||
{
|
||||
name: 'confirm',
|
||||
type: 'confirm',
|
||||
initial: false,
|
||||
message,
|
||||
},
|
||||
{
|
||||
onCancel: () => {
|
||||
process.exit(0)
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
// Exit if user does not accept warnings.
|
||||
// Q: Is this the right type of exit for this interaction?
|
||||
if (!acceptWarnings) {
|
||||
process.exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
await apply()
|
||||
|
||||
// Migration table def in order to use query using drizzle
|
||||
const migrationsSchema = this.pgSchema.table('payload_migrations', {
|
||||
name: varchar('name'),
|
||||
batch: numeric('batch'),
|
||||
created_at: timestamp('created_at'),
|
||||
updated_at: timestamp('updated_at'),
|
||||
})
|
||||
|
||||
const devPush = await this.drizzle
|
||||
.select()
|
||||
.from(migrationsSchema)
|
||||
.where(eq(migrationsSchema.batch, '-1'))
|
||||
|
||||
if (!devPush.length) {
|
||||
await this.drizzle.insert(migrationsSchema).values({
|
||||
name: 'dev',
|
||||
batch: '-1',
|
||||
})
|
||||
} else {
|
||||
await this.drizzle
|
||||
.update(migrationsSchema)
|
||||
.set({
|
||||
updated_at: new Date(),
|
||||
})
|
||||
.where(eq(migrationsSchema.batch, '-1'))
|
||||
}
|
||||
await pushDevSchema(this)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { Create } from 'payload/database'
|
||||
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { upsertRow } from './upsertRow/index.js'
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { PayloadRequest, TypeWithID } from 'payload/types'
|
||||
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { upsertRow } from './upsertRow/index.js'
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { sql } from 'drizzle-orm'
|
||||
import { buildVersionGlobalFields } from 'payload/versions'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { upsertRow } from './upsertRow/index.js'
|
||||
|
||||
|
||||
@@ -3,9 +3,12 @@ import type { DrizzleSnapshotJSON } from 'drizzle-kit/payload'
|
||||
import type { CreateMigration } from 'payload/database'
|
||||
|
||||
import fs from 'fs'
|
||||
import { createRequire } from 'module'
|
||||
import prompts from 'prompts'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
const require = createRequire(import.meta.url)
|
||||
|
||||
const migrationTemplate = (
|
||||
upSQL?: string,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { sql } from 'drizzle-orm'
|
||||
import { buildVersionCollectionFields } from 'payload/versions'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { upsertRow } from './upsertRow/index.js'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { PayloadRequest } from 'payload/types'
|
||||
import { inArray } from 'drizzle-orm'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { findMany } from './find/findMany.js'
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { buildFindManyArgs } from './find/buildFindManyArgs.js'
|
||||
import buildQuery from './queries/buildQuery.js'
|
||||
|
||||
@@ -5,7 +5,7 @@ import { inArray } from 'drizzle-orm'
|
||||
import { buildVersionCollectionFields } from 'payload/versions'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { findMany } from './find/findMany.js'
|
||||
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
import type { Destroy } from 'payload/database'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { pushDevSchema } from './utilities/pushDevSchema.js'
|
||||
|
||||
export const destroy: Destroy = async function destroy(this: PostgresAdapter) {
|
||||
// TODO: this hangs test suite for some reason
|
||||
// await this.pool.end()
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
await pushDevSchema(this)
|
||||
} else {
|
||||
// TODO: this hangs test suite for some reason
|
||||
// await this.pool.end()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { PayloadRequest, SanitizedCollectionConfig } from 'payload/types'
|
||||
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { findMany } from './find/findMany.js'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { DBQueryConfig } from 'drizzle-orm'
|
||||
import type { Field } from 'payload/types'
|
||||
|
||||
import type { PostgresAdapter } from '../types.d.ts'
|
||||
import type { PostgresAdapter } from '../types.js'
|
||||
|
||||
import { traverseFields } from './traverseFields.js'
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import type { Field, PayloadRequest, TypeWithID } from 'payload/types'
|
||||
|
||||
import { inArray, sql } from 'drizzle-orm'
|
||||
|
||||
import type { PostgresAdapter } from '../types.d.ts'
|
||||
import type { ChainedMethods } from './chainMethods.d.ts'
|
||||
import type { PostgresAdapter } from '../types.js'
|
||||
import type { ChainedMethods } from './chainMethods.js'
|
||||
|
||||
import buildQuery from '../queries/buildQuery.js'
|
||||
import { transform } from '../transform/read/index.js'
|
||||
|
||||
@@ -4,8 +4,8 @@ import type { Field } from 'payload/types'
|
||||
import { fieldAffectsData, tabHasName } from 'payload/types'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from '../types.d.ts'
|
||||
import type { Result } from './buildFindManyArgs.d.ts'
|
||||
import type { PostgresAdapter } from '../types.js'
|
||||
import type { Result } from './buildFindManyArgs.js'
|
||||
|
||||
type TraverseFieldArgs = {
|
||||
_locales: Record<string, unknown>
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { FindGlobal } from 'payload/database'
|
||||
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { findMany } from './find/findMany.js'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { PayloadRequest, SanitizedGlobalConfig } from 'payload/types'
|
||||
import { buildVersionGlobalFields } from 'payload/versions'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { findMany } from './find/findMany.js'
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { PayloadRequest, SanitizedCollectionConfig, TypeWithID } from 'payl
|
||||
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { findMany } from './find/findMany.js'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { PayloadRequest, SanitizedCollectionConfig } from 'payload/types'
|
||||
import { buildVersionCollectionFields } from 'payload/versions'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { findMany } from './find/findMany.js'
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { createDatabaseAdapter } from 'payload/database'
|
||||
|
||||
import type { Args, PostgresAdapter } from './types.d.ts'
|
||||
import type { Args, PostgresAdapter } from './types.js'
|
||||
|
||||
import { connect } from './connect.js'
|
||||
import { create } from './create.js'
|
||||
@@ -38,7 +38,7 @@ import { updateGlobal } from './updateGlobal.js'
|
||||
import { updateGlobalVersion } from './updateGlobalVersion.js'
|
||||
import { updateVersion } from './updateVersion.js'
|
||||
|
||||
export type { MigrateDownArgs, MigrateUpArgs } from './types.d.ts'
|
||||
export type { MigrateDownArgs, MigrateUpArgs } from './types.js'
|
||||
|
||||
export function postgresAdapter(args: Args): DatabaseAdapterObj<PostgresAdapter> {
|
||||
function adapter({ payload }: { payload: Payload }) {
|
||||
|
||||
@@ -6,11 +6,11 @@ import { pgEnum, pgSchema, pgTable } from 'drizzle-orm/pg-core'
|
||||
import { buildVersionCollectionFields, buildVersionGlobalFields } from 'payload/versions'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { buildTable } from './schema/build.js'
|
||||
|
||||
export const init: Init = async function init(this: PostgresAdapter) {
|
||||
export const init: Init = function init(this: PostgresAdapter) {
|
||||
if (this.schemaName) {
|
||||
this.pgSchema = pgSchema(this.schemaName)
|
||||
} else {
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { Payload } from 'payload'
|
||||
import type { Migration } from 'payload/database'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import { createRequire } from 'module'
|
||||
import {
|
||||
commitTransaction,
|
||||
initTransaction,
|
||||
@@ -11,12 +12,14 @@ import {
|
||||
} from 'payload/database'
|
||||
import prompts from 'prompts'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { createMigrationTable } from './utilities/createMigrationTable.js'
|
||||
import { migrationTableExists } from './utilities/migrationTableExists.js'
|
||||
import { parseError } from './utilities/parseError.js'
|
||||
|
||||
const require = createRequire(import.meta.url)
|
||||
|
||||
export async function migrate(this: PostgresAdapter): Promise<void> {
|
||||
const { payload } = this
|
||||
const migrationFiles = await readMigrationFiles({ payload })
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
readMigrationFiles,
|
||||
} from 'payload/database'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { migrationTableExists } from './utilities/migrationTableExists.js'
|
||||
import { parseError } from './utilities/parseError.js'
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from 'payload/database'
|
||||
import prompts from 'prompts'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { parseError } from './utilities/parseError.js'
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
readMigrationFiles,
|
||||
} from 'payload/database'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { migrationTableExists } from './utilities/migrationTableExists.js'
|
||||
import { parseError } from './utilities/parseError.js'
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
readMigrationFiles,
|
||||
} from 'payload/database'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { migrationTableExists } from './utilities/migrationTableExists.js'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Table } from 'console-table-printer'
|
||||
import { getMigrations, readMigrationFiles } from 'payload/database'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { migrationTableExists } from './utilities/migrationTableExists.js'
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { SQL } from 'drizzle-orm'
|
||||
import type { Field, Where } from 'payload/types'
|
||||
|
||||
import type { GenericColumn, PostgresAdapter } from '../types.d.ts'
|
||||
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery.d.ts'
|
||||
import type { GenericColumn, PostgresAdapter } from '../types.js'
|
||||
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery.js'
|
||||
|
||||
import { parseParams } from './parseParams.js'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { Field, Where } from 'payload/types'
|
||||
|
||||
import { asc, desc } from 'drizzle-orm'
|
||||
|
||||
import type { GenericColumn, GenericTable, PostgresAdapter } from '../types.d.ts'
|
||||
import type { GenericColumn, GenericTable, PostgresAdapter } from '../types.js'
|
||||
|
||||
import { getTableColumnFromPath } from './getTableColumnFromPath.js'
|
||||
import { parseParams } from './parseParams.js'
|
||||
|
||||
@@ -11,8 +11,8 @@ import { flattenTopLevelFields } from 'payload/utilities'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
import { v4 as uuid } from 'uuid'
|
||||
|
||||
import type { GenericColumn, GenericTable, PostgresAdapter } from '../types.d.ts'
|
||||
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery.d.ts'
|
||||
import type { GenericColumn, GenericTable, PostgresAdapter } from '../types.js'
|
||||
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery.js'
|
||||
|
||||
type Constraint = {
|
||||
columnName: string
|
||||
|
||||
@@ -6,8 +6,8 @@ import { and, ilike, isNotNull, isNull, ne, notInArray, or, sql } from 'drizzle-
|
||||
import { QueryError } from 'payload/errors'
|
||||
import { validOperators } from 'payload/types'
|
||||
|
||||
import type { GenericColumn, PostgresAdapter } from '../types.d.ts'
|
||||
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery.d.ts'
|
||||
import type { GenericColumn, PostgresAdapter } from '../types.js'
|
||||
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery.js'
|
||||
|
||||
import { buildAndOrConditions } from './buildAndOrConditions.js'
|
||||
import { createJSONQuery } from './createJSONQuery/index.js'
|
||||
|
||||
@@ -2,7 +2,7 @@ import { APIError } from 'payload/errors'
|
||||
import { type Field, type TabAsField, fieldAffectsData } from 'payload/types'
|
||||
import { createArrayFromCommaDelineated } from 'payload/utilities'
|
||||
|
||||
import type { PostgresAdapter } from '../types.d.ts'
|
||||
import type { PostgresAdapter } from '../types.js'
|
||||
|
||||
type SanitizeQueryValueArgs = {
|
||||
adapter: PostgresAdapter
|
||||
|
||||
@@ -13,7 +13,7 @@ import { index, integer, numeric, serial, timestamp, unique, varchar } from 'dri
|
||||
import { fieldAffectsData } from 'payload/types'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { GenericColumns, GenericTable, IDType, PostgresAdapter } from '../types.d.ts'
|
||||
import type { GenericColumns, GenericTable, IDType, PostgresAdapter } from '../types.js'
|
||||
|
||||
import { parentIDColumnMap } from './parentIDColumnMap.js'
|
||||
import { setColumnID } from './setColumnID.js'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
import { index, uniqueIndex } from 'drizzle-orm/pg-core'
|
||||
|
||||
import type { GenericColumn } from '../types.d.ts'
|
||||
import type { GenericColumn } from '../types.js'
|
||||
|
||||
type CreateIndexArgs = {
|
||||
columnName: string
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { integer, numeric, uuid, varchar } from 'drizzle-orm/pg-core'
|
||||
|
||||
import type { IDType } from '../types.d.ts'
|
||||
import type { IDType } from '../types.js'
|
||||
|
||||
export const parentIDColumnMap: Record<
|
||||
IDType,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { numeric, serial, uuid, varchar } from 'drizzle-orm/pg-core'
|
||||
import { type Field, fieldAffectsData } from 'payload/types'
|
||||
import { flattenTopLevelFields } from 'payload/utilities'
|
||||
|
||||
import type { IDType, PostgresAdapter } from '../types.d.ts'
|
||||
import type { IDType, PostgresAdapter } from '../types.js'
|
||||
|
||||
type Args = { adapter: PostgresAdapter; columns: Record<string, PgColumnBuilder>; fields: Field[] }
|
||||
export const setColumnID = ({ adapter, columns, fields }: Args): IDType => {
|
||||
|
||||
@@ -22,7 +22,7 @@ import { InvalidConfiguration } from 'payload/errors'
|
||||
import { fieldAffectsData, optionIsObject } from 'payload/types'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { GenericColumns, IDType, PostgresAdapter } from '../types.d.ts'
|
||||
import type { GenericColumns, IDType, PostgresAdapter } from '../types.js'
|
||||
|
||||
import { hasLocalesTable } from '../utilities/hasLocalesTable.js'
|
||||
import { buildTable } from './build.js'
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { Block, Field } from 'payload/types'
|
||||
import { InvalidConfiguration } from 'payload/errors'
|
||||
import { fieldAffectsData, fieldHasSubFields, tabHasName } from 'payload/types'
|
||||
|
||||
import type { GenericTable } from '../types.d.ts'
|
||||
import type { GenericTable } from '../types.js'
|
||||
|
||||
type Args = {
|
||||
block: Block
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { BeginTransaction } from 'payload/database'
|
||||
|
||||
import { v4 as uuid } from 'uuid'
|
||||
|
||||
import type { DrizzleTransaction, PostgresAdapter } from '../types.d.ts'
|
||||
import type { DrizzleTransaction, PostgresAdapter } from '../types.js'
|
||||
|
||||
export const beginTransaction: BeginTransaction = async function beginTransaction(
|
||||
this: PostgresAdapter,
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { Field, TabAsField } from 'payload/types'
|
||||
|
||||
import { fieldAffectsData } from 'payload/types'
|
||||
|
||||
import type { BlocksMap } from '../../utilities/createBlocksMap.d.ts'
|
||||
import type { BlocksMap } from '../../utilities/createBlocksMap.js'
|
||||
|
||||
import { transformHasManyNumber } from './hasManyNumber.js'
|
||||
import { transformHasManyText } from './hasManyText.js'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
import type { ArrayField } from 'payload/types'
|
||||
|
||||
import type { PostgresAdapter } from '../../types.d.ts'
|
||||
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types.d.ts'
|
||||
import type { PostgresAdapter } from '../../types.js'
|
||||
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types.js'
|
||||
|
||||
import { isArrayOfRows } from '../../utilities/isArrayOfRows.js'
|
||||
import { traverseFields } from './traverseFields.js'
|
||||
|
||||
@@ -3,8 +3,8 @@ import type { BlockField } from 'payload/types'
|
||||
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from '../../types.d.ts'
|
||||
import type { BlockRowToInsert, RelationshipToDelete } from './types.d.ts'
|
||||
import type { PostgresAdapter } from '../../types.js'
|
||||
import type { BlockRowToInsert, RelationshipToDelete } from './types.js'
|
||||
|
||||
import { traverseFields } from './traverseFields.js'
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
import type { Field } from 'payload/types'
|
||||
|
||||
import type { PostgresAdapter } from '../../types.d.ts'
|
||||
import type { RowToInsert } from './types.d.ts'
|
||||
import type { PostgresAdapter } from '../../types.js'
|
||||
import type { RowToInsert } from './types.js'
|
||||
|
||||
import { traverseFields } from './traverseFields.js'
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import type { Field } from 'payload/types'
|
||||
import { fieldAffectsData } from 'payload/types'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from '../../types.d.ts'
|
||||
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types.d.ts'
|
||||
import type { PostgresAdapter } from '../../types.js'
|
||||
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types.js'
|
||||
|
||||
import { isArrayOfRows } from '../../utilities/isArrayOfRows.js'
|
||||
import { transformArray } from './array.js'
|
||||
|
||||
@@ -2,8 +2,8 @@ import type { UpdateOne } from 'payload/database'
|
||||
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { ChainedMethods } from './find/chainMethods.d.ts'
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { ChainedMethods } from './find/chainMethods.js'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
import { chainMethods } from './find/chainMethods.js'
|
||||
import buildQuery from './queries/buildQuery.js'
|
||||
import { upsertRow } from './upsertRow/index.js'
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { PayloadRequest, TypeWithID } from 'payload/types'
|
||||
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import { upsertRow } from './upsertRow/index.js'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { PayloadRequest, SanitizedGlobalConfig, TypeWithID } from 'payload/
|
||||
import { buildVersionGlobalFields } from 'payload/versions'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import buildQuery from './queries/buildQuery.js'
|
||||
import { upsertRow } from './upsertRow/index.js'
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { PayloadRequest, SanitizedCollectionConfig, TypeWithID } from 'payl
|
||||
import { buildVersionCollectionFields } from 'payload/versions'
|
||||
import toSnakeCase from 'to-snake-case'
|
||||
|
||||
import type { PostgresAdapter } from './types.d.ts'
|
||||
import type { PostgresAdapter } from './types.js'
|
||||
|
||||
import buildQuery from './queries/buildQuery.js'
|
||||
import { upsertRow } from './upsertRow/index.js'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { and, eq } from 'drizzle-orm'
|
||||
|
||||
import type { DrizzleDB, PostgresAdapter } from '../types.d.ts'
|
||||
import type { DrizzleDB, PostgresAdapter } from '../types.js'
|
||||
|
||||
type Args = {
|
||||
adapter: PostgresAdapter
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { and, eq, inArray } from 'drizzle-orm'
|
||||
|
||||
import type { DrizzleDB, PostgresAdapter } from '../types.d.ts'
|
||||
import type { DrizzleDB, PostgresAdapter } from '../types.js'
|
||||
|
||||
type Args = {
|
||||
adapter: PostgresAdapter
|
||||
|
||||
@@ -4,8 +4,8 @@ import type { TypeWithID } from 'payload/types'
|
||||
import { eq } from 'drizzle-orm'
|
||||
import { ValidationError } from 'payload/errors'
|
||||
|
||||
import type { BlockRowToInsert } from '../transform/write/types.d.ts'
|
||||
import type { Args } from './types.d.ts'
|
||||
import type { BlockRowToInsert } from '../transform/write/types.js'
|
||||
import type { Args } from './types.js'
|
||||
|
||||
import { buildFindManyArgs } from '../find/buildFindManyArgs.js'
|
||||
import { transform } from '../transform/read/index.js'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
import type { ArrayRowToInsert } from '../transform/write/types.d.ts'
|
||||
import type { DrizzleDB, PostgresAdapter } from '../types.d.ts'
|
||||
import type { ArrayRowToInsert } from '../transform/write/types.js'
|
||||
import type { DrizzleDB, PostgresAdapter } from '../types.js'
|
||||
|
||||
type Args = {
|
||||
adapter: PostgresAdapter
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { SQL } from 'drizzle-orm'
|
||||
import type { Field, PayloadRequest } from 'payload/types'
|
||||
|
||||
import type { DrizzleDB, GenericColumn, PostgresAdapter } from '../types.d.ts'
|
||||
import type { DrizzleDB, GenericColumn, PostgresAdapter } from '../types.js'
|
||||
|
||||
type BaseArgs = {
|
||||
adapter: PostgresAdapter
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { sql } from 'drizzle-orm'
|
||||
|
||||
import type { PostgresAdapter } from '../types.d.ts'
|
||||
import type { PostgresAdapter } from '../types.js'
|
||||
|
||||
export const createMigrationTable = async (adapter: PostgresAdapter): Promise<void> => {
|
||||
const prependSchema = adapter.schemaName ? `"${adapter.schemaName}".` : ''
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user