chore: implement better tsconfig reset mechanism

This commit is contained in:
Elliot DeNolf
2024-04-29 23:19:06 -04:00
parent d5f7944ac4
commit 45b3f06e1b
8 changed files with 192 additions and 46 deletions

View File

@@ -40,5 +40,6 @@
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit" "source.fixAll.eslint": "explicit"
} }
} },
"files.insertFinalNewline": true
} }

View File

@@ -74,7 +74,8 @@
"*.{js,jsx,ts,tsx}": [ "*.{js,jsx,ts,tsx}": [
"prettier --write", "prettier --write",
"eslint --cache --fix" "eslint --cache --fix"
] ],
"tsconfig.json": "node scripts/reset-tsconfig.js"
}, },
"devDependencies": { "devDependencies": {
"@aws-sdk/client-s3": "^3.525.0", "@aws-sdk/client-s3": "^3.525.0",
@@ -128,7 +129,6 @@
"husky": "^8.0.3", "husky": "^8.0.3",
"jest": "29.7.0", "jest": "29.7.0",
"jest-environment-jsdom": "29.7.0", "jest-environment-jsdom": "29.7.0",
"json5": "^2.2.3",
"jwt-decode": "4.0.0", "jwt-decode": "4.0.0",
"lexical": "0.14.5", "lexical": "0.14.5",
"lint-staged": "^14.0.1", "lint-staged": "^14.0.1",

162
pnpm-lock.yaml generated
View File

@@ -140,7 +140,7 @@ importers:
version: 0.20.14-1f2c838 version: 0.20.14-1f2c838
drizzle-orm: drizzle-orm:
specifier: 0.29.4 specifier: 0.29.4
version: 0.29.4(@libsql/client@0.5.6)(@types/pg@8.10.2)(@types/react@18.2.74)(pg@8.11.3)(react@18.2.0) version: 0.29.4(@types/react@18.2.74)(react@18.2.0)
escape-html: escape-html:
specifier: ^1.0.3 specifier: ^1.0.3
version: 1.0.3 version: 1.0.3
@@ -177,9 +177,6 @@ importers:
jest-environment-jsdom: jest-environment-jsdom:
specifier: 29.7.0 specifier: 29.7.0
version: 29.7.0 version: 29.7.0
json5:
specifier: ^2.2.3
version: 2.2.3
jwt-decode: jwt-decode:
specifier: 4.0.0 specifier: 4.0.0
version: 4.0.0 version: 4.0.0
@@ -197,7 +194,7 @@ importers:
version: 9.1.8 version: 9.1.8
next: next:
specifier: ^14.3.0-canary.7 specifier: ^14.3.0-canary.7
version: 14.3.0-canary.7(@babel/core@7.24.4)(@playwright/test@1.43.0)(react-dom@18.2.0)(react@18.2.0)(sass@1.74.1) version: 14.3.0-canary.7(@babel/core@7.24.4)(@playwright/test@1.43.0)(react-dom@18.2.0)(react@18.2.0)
node-mocks-http: node-mocks-http:
specifier: ^1.14.1 specifier: ^1.14.1
version: 1.14.1 version: 1.14.1
@@ -4491,17 +4488,20 @@ packages:
- bufferutil - bufferutil
- encoding - encoding
- utf-8-validate - utf-8-validate
dev: false
/@libsql/core@0.5.6: /@libsql/core@0.5.6:
resolution: {integrity: sha512-3vicUAydq6jPth410n4AsHHm1n2psTwvkSf94nfJlSXutGSZsl0updn2N/mJBgqUHkbuFoWZtlMifF0SwBj1xQ==} resolution: {integrity: sha512-3vicUAydq6jPth410n4AsHHm1n2psTwvkSf94nfJlSXutGSZsl0updn2N/mJBgqUHkbuFoWZtlMifF0SwBj1xQ==}
dependencies: dependencies:
js-base64: 3.7.7 js-base64: 3.7.7
dev: false
/@libsql/darwin-arm64@0.3.10: /@libsql/darwin-arm64@0.3.10:
resolution: {integrity: sha512-RaexEFfPAFogd6dJlqkpCkTxdr6K14Z0286lodIJ8Ny77mWuWyBkWKxf70OYWXXAMxMJFUW+6al1F3/Osf/pTg==} resolution: {integrity: sha512-RaexEFfPAFogd6dJlqkpCkTxdr6K14Z0286lodIJ8Ny77mWuWyBkWKxf70OYWXXAMxMJFUW+6al1F3/Osf/pTg==}
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
requiresBuild: true requiresBuild: true
dev: false
optional: true optional: true
/@libsql/darwin-x64@0.3.10: /@libsql/darwin-x64@0.3.10:
@@ -4509,6 +4509,7 @@ packages:
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
requiresBuild: true requiresBuild: true
dev: false
optional: true optional: true
/@libsql/hrana-client@0.5.6: /@libsql/hrana-client@0.5.6:
@@ -4522,6 +4523,7 @@ packages:
- bufferutil - bufferutil
- encoding - encoding
- utf-8-validate - utf-8-validate
dev: false
/@libsql/isomorphic-fetch@0.1.12: /@libsql/isomorphic-fetch@0.1.12:
resolution: {integrity: sha512-MRo4UcmjAGAa3ac56LoD5OE13m2p0lu0VEtZC2NZMcogM/jc5fU9YtMQ3qbPjFJ+u2BBjFZgMPkQaLS1dlMhpg==} resolution: {integrity: sha512-MRo4UcmjAGAa3ac56LoD5OE13m2p0lu0VEtZC2NZMcogM/jc5fU9YtMQ3qbPjFJ+u2BBjFZgMPkQaLS1dlMhpg==}
@@ -4530,6 +4532,7 @@ packages:
node-fetch: 2.7.0 node-fetch: 2.7.0
transitivePeerDependencies: transitivePeerDependencies:
- encoding - encoding
dev: false
/@libsql/isomorphic-ws@0.1.5: /@libsql/isomorphic-ws@0.1.5:
resolution: {integrity: sha512-DtLWIH29onUYR00i0GlQ3UdcTRC6EP4u9w/h9LxpUZJWRMARk6dQwZ6Jkd+QdwVpuAOrdxt18v0K2uIYR3fwFg==} resolution: {integrity: sha512-DtLWIH29onUYR00i0GlQ3UdcTRC6EP4u9w/h9LxpUZJWRMARk6dQwZ6Jkd+QdwVpuAOrdxt18v0K2uIYR3fwFg==}
@@ -4539,12 +4542,14 @@ packages:
transitivePeerDependencies: transitivePeerDependencies:
- bufferutil - bufferutil
- utf-8-validate - utf-8-validate
dev: false
/@libsql/linux-arm64-gnu@0.3.10: /@libsql/linux-arm64-gnu@0.3.10:
resolution: {integrity: sha512-2uXpi9d8qtyIOr7pyG4a88j6YXgemyIHEs2Wbp+PPletlCIPsFS+E7IQHbz8VwTohchOzcokGUm1Bc5QC+A7wg==} resolution: {integrity: sha512-2uXpi9d8qtyIOr7pyG4a88j6YXgemyIHEs2Wbp+PPletlCIPsFS+E7IQHbz8VwTohchOzcokGUm1Bc5QC+A7wg==}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: false
optional: true optional: true
/@libsql/linux-arm64-musl@0.3.10: /@libsql/linux-arm64-musl@0.3.10:
@@ -4552,6 +4557,7 @@ packages:
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: false
optional: true optional: true
/@libsql/linux-x64-gnu@0.3.10: /@libsql/linux-x64-gnu@0.3.10:
@@ -4559,6 +4565,7 @@ packages:
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: false
optional: true optional: true
/@libsql/linux-x64-musl@0.3.10: /@libsql/linux-x64-musl@0.3.10:
@@ -4566,6 +4573,7 @@ packages:
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: false
optional: true optional: true
/@libsql/win32-x64-msvc@0.3.10: /@libsql/win32-x64-msvc@0.3.10:
@@ -4573,6 +4581,7 @@ packages:
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
requiresBuild: true requiresBuild: true
dev: false
optional: true optional: true
/@mole-inc/bin-wrapper@8.0.1: /@mole-inc/bin-wrapper@8.0.1:
@@ -4618,6 +4627,7 @@ packages:
/@neon-rs/load@0.0.4: /@neon-rs/load@0.0.4:
resolution: {integrity: sha512-kTPhdZyTQxB+2wpiRcFWrDcejc4JI6tkPuS7UZCG4l6Zvc5kU/gGQ/ozvHTh1XR5tS+UlfAfGuPajjzQjCiHCw==} resolution: {integrity: sha512-kTPhdZyTQxB+2wpiRcFWrDcejc4JI6tkPuS7UZCG4l6Zvc5kU/gGQ/ozvHTh1XR5tS+UlfAfGuPajjzQjCiHCw==}
dev: false
/@next/bundle-analyzer@14.1.4: /@next/bundle-analyzer@14.1.4:
resolution: {integrity: sha512-IpF/18HcAOcfHRr24tqPOUpMmVKIqvkCxIubMeRYWCXs3jm7niPGrt8Mu74yMDzfGlUwgQA6Xd6BUc5+jQxcEg==} resolution: {integrity: sha512-IpF/18HcAOcfHRr24tqPOUpMmVKIqvkCxIubMeRYWCXs3jm7niPGrt8Mu74yMDzfGlUwgQA6Xd6BUc5+jQxcEg==}
@@ -6068,6 +6078,7 @@ packages:
dependencies: dependencies:
'@types/node': 20.12.5 '@types/node': 20.12.5
form-data: 4.0.0 form-data: 4.0.0
dev: false
/@types/node-fetch@2.6.4: /@types/node-fetch@2.6.4:
resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==} resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==}
@@ -7452,6 +7463,7 @@ packages:
/buffer-writer@2.0.0: /buffer-writer@2.0.0:
resolution: {integrity: sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==} resolution: {integrity: sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==}
engines: {node: '>=4'} engines: {node: '>=4'}
dev: false
/buffer@4.9.2: /buffer@4.9.2:
resolution: {integrity: sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==} resolution: {integrity: sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==}
@@ -8370,6 +8382,7 @@ packages:
/data-uri-to-buffer@4.0.1: /data-uri-to-buffer@4.0.1:
resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==}
engines: {node: '>= 12'} engines: {node: '>= 12'}
dev: false
/data-urls@3.0.2: /data-urls@3.0.2:
resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==} resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==}
@@ -8628,6 +8641,7 @@ packages:
/detect-libc@2.0.2: /detect-libc@2.0.2:
resolution: {integrity: sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==} resolution: {integrity: sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==}
engines: {node: '>=8'} engines: {node: '>=8'}
dev: false
/detect-libc@2.0.3: /detect-libc@2.0.3:
resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==}
@@ -8864,6 +8878,82 @@ packages:
'@types/react': 18.2.74 '@types/react': 18.2.74
pg: 8.11.3 pg: 8.11.3
react: 18.2.0 react: 18.2.0
dev: false
/drizzle-orm@0.29.4(@types/react@18.2.74)(react@18.2.0):
resolution: {integrity: sha512-ZnSM8TAxFhzH7p1s3+w3pRE/eKaOeNkH9SKitm717pubDVVcV2I0BCDBPGKV+pe02+wMfw37ntlTcCyo2rA3IA==}
peerDependencies:
'@aws-sdk/client-rds-data': '>=3'
'@cloudflare/workers-types': '>=3'
'@libsql/client': '*'
'@neondatabase/serverless': '>=0.1'
'@opentelemetry/api': ^1.4.1
'@planetscale/database': '>=1'
'@types/better-sqlite3': '*'
'@types/pg': '*'
'@types/react': '>=18'
'@types/sql.js': '*'
'@vercel/postgres': '*'
better-sqlite3: '>=7'
bun-types: '*'
expo-sqlite: '>=13.2.0'
knex: '*'
kysely: '*'
mysql2: '>=2'
pg: '>=8'
postgres: '>=3'
react: ^18.0.0
sql.js: '>=1'
sqlite3: '>=5'
peerDependenciesMeta:
'@aws-sdk/client-rds-data':
optional: true
'@cloudflare/workers-types':
optional: true
'@libsql/client':
optional: true
'@neondatabase/serverless':
optional: true
'@opentelemetry/api':
optional: true
'@planetscale/database':
optional: true
'@types/better-sqlite3':
optional: true
'@types/pg':
optional: true
'@types/react':
optional: true
'@types/sql.js':
optional: true
'@vercel/postgres':
optional: true
better-sqlite3:
optional: true
bun-types:
optional: true
expo-sqlite:
optional: true
knex:
optional: true
kysely:
optional: true
mysql2:
optional: true
pg:
optional: true
postgres:
optional: true
react:
optional: true
sql.js:
optional: true
sqlite3:
optional: true
dependencies:
'@types/react': 18.2.74
react: 18.2.0
dev: true
/duplexer@0.1.2: /duplexer@0.1.2:
resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==}
@@ -9787,6 +9877,7 @@ packages:
dependencies: dependencies:
node-domexception: 1.0.0 node-domexception: 1.0.0
web-streams-polyfill: 3.3.3 web-streams-polyfill: 3.3.3
dev: false
/figures@6.1.0: /figures@6.1.0:
resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==}
@@ -10010,6 +10101,7 @@ packages:
engines: {node: '>=12.20.0'} engines: {node: '>=12.20.0'}
dependencies: dependencies:
fetch-blob: 3.2.0 fetch-blob: 3.2.0
dev: false
/forwarded@0.2.0: /forwarded@0.2.0:
resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==}
@@ -11573,6 +11665,7 @@ packages:
/js-base64@3.7.7: /js-base64@3.7.7:
resolution: {integrity: sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==} resolution: {integrity: sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==}
dev: false
/js-beautify@1.15.1: /js-beautify@1.15.1:
resolution: {integrity: sha512-ESjNzSlt/sWE8sciZH8kBF8BPlwXPwhR6pWKAw8bw4Bwj+iZcnKW6ONWUutJ7eObuBZQpiIb8S7OYspWrKt7rA==} resolution: {integrity: sha512-ESjNzSlt/sWE8sciZH8kBF8BPlwXPwhR6pWKAw8bw4Bwj+iZcnKW6ONWUutJ7eObuBZQpiIb8S7OYspWrKt7rA==}
@@ -11882,6 +11975,7 @@ packages:
'@libsql/linux-x64-gnu': 0.3.10 '@libsql/linux-x64-gnu': 0.3.10
'@libsql/linux-x64-musl': 0.3.10 '@libsql/linux-x64-musl': 0.3.10
'@libsql/win32-x64-msvc': 0.3.10 '@libsql/win32-x64-msvc': 0.3.10
dev: false
/lie@3.1.1: /lie@3.1.1:
resolution: {integrity: sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==} resolution: {integrity: sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==}
@@ -12468,6 +12562,49 @@ packages:
/next-tick@1.1.0: /next-tick@1.1.0:
resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==}
/next@14.3.0-canary.7(@babel/core@7.24.4)(@playwright/test@1.43.0)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-loPrWTCvHvZgOy3rgL9+2WpxNDxlRNt462ihqm/DUuyK8LUZV1F4H920YTAu1wEiYC8RrpNUbpz8K7KRYAkQiA==}
engines: {node: '>=18.17.0'}
hasBin: true
peerDependencies:
'@opentelemetry/api': ^1.1.0
'@playwright/test': ^1.41.2
react: ^18.0.0
react-dom: ^18.0.0
sass: ^1.3.0
peerDependenciesMeta:
'@opentelemetry/api':
optional: true
'@playwright/test':
optional: true
sass:
optional: true
dependencies:
'@next/env': 14.3.0-canary.7
'@playwright/test': 1.43.0
'@swc/helpers': 0.5.5
busboy: 1.6.0
caniuse-lite: 1.0.30001607
graceful-fs: 4.2.11
postcss: 8.4.31
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
styled-jsx: 5.1.1(@babel/core@7.24.4)(react@18.2.0)
optionalDependencies:
'@next/swc-darwin-arm64': 14.3.0-canary.7
'@next/swc-darwin-x64': 14.3.0-canary.7
'@next/swc-linux-arm64-gnu': 14.3.0-canary.7
'@next/swc-linux-arm64-musl': 14.3.0-canary.7
'@next/swc-linux-x64-gnu': 14.3.0-canary.7
'@next/swc-linux-x64-musl': 14.3.0-canary.7
'@next/swc-win32-arm64-msvc': 14.3.0-canary.7
'@next/swc-win32-ia32-msvc': 14.3.0-canary.7
'@next/swc-win32-x64-msvc': 14.3.0-canary.7
transitivePeerDependencies:
- '@babel/core'
- babel-plugin-macros
dev: true
/next@14.3.0-canary.7(@babel/core@7.24.4)(@playwright/test@1.43.0)(react-dom@18.2.0)(react@18.2.0)(sass@1.74.1): /next@14.3.0-canary.7(@babel/core@7.24.4)(@playwright/test@1.43.0)(react-dom@18.2.0)(react@18.2.0)(sass@1.74.1):
resolution: {integrity: sha512-loPrWTCvHvZgOy3rgL9+2WpxNDxlRNt462ihqm/DUuyK8LUZV1F4H920YTAu1wEiYC8RrpNUbpz8K7KRYAkQiA==} resolution: {integrity: sha512-loPrWTCvHvZgOy3rgL9+2WpxNDxlRNt462ihqm/DUuyK8LUZV1F4H920YTAu1wEiYC8RrpNUbpz8K7KRYAkQiA==}
engines: {node: '>=18.17.0'} engines: {node: '>=18.17.0'}
@@ -12510,6 +12647,7 @@ packages:
transitivePeerDependencies: transitivePeerDependencies:
- '@babel/core' - '@babel/core'
- babel-plugin-macros - babel-plugin-macros
dev: false
/node-abi@3.57.0: /node-abi@3.57.0:
resolution: {integrity: sha512-Dp+A9JWxRaKuHP35H77I4kCKesDy5HUDEmScia2FyncMTOXASMyg251F5PhFoDA5uqBrDDffiLpbqnrZmNXW+g==} resolution: {integrity: sha512-Dp+A9JWxRaKuHP35H77I4kCKesDy5HUDEmScia2FyncMTOXASMyg251F5PhFoDA5uqBrDDffiLpbqnrZmNXW+g==}
@@ -12525,6 +12663,7 @@ packages:
/node-domexception@1.0.0: /node-domexception@1.0.0:
resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
engines: {node: '>=10.5.0'} engines: {node: '>=10.5.0'}
dev: false
/node-fetch@2.7.0: /node-fetch@2.7.0:
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
@@ -12544,6 +12683,7 @@ packages:
data-uri-to-buffer: 4.0.1 data-uri-to-buffer: 4.0.1
fetch-blob: 3.2.0 fetch-blob: 3.2.0
formdata-polyfill: 4.0.10 formdata-polyfill: 4.0.10
dev: false
/node-int64@0.4.0: /node-int64@0.4.0:
resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==}
@@ -12893,6 +13033,7 @@ packages:
/packet-reader@1.0.0: /packet-reader@1.0.0:
resolution: {integrity: sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==} resolution: {integrity: sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==}
dev: false
/parent-module@1.0.1: /parent-module@1.0.1:
resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
@@ -13021,10 +13162,12 @@ packages:
/pg-cloudflare@1.1.1: /pg-cloudflare@1.1.1:
resolution: {integrity: sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==} resolution: {integrity: sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==}
requiresBuild: true requiresBuild: true
dev: false
optional: true optional: true
/pg-connection-string@2.6.4: /pg-connection-string@2.6.4:
resolution: {integrity: sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==} resolution: {integrity: sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==}
dev: false
/pg-int8@1.0.1: /pg-int8@1.0.1:
resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==}
@@ -13040,6 +13183,7 @@ packages:
pg: '>=8.0' pg: '>=8.0'
dependencies: dependencies:
pg: 8.11.3 pg: 8.11.3
dev: false
/pg-protocol@1.6.1: /pg-protocol@1.6.1:
resolution: {integrity: sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==} resolution: {integrity: sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==}
@@ -13053,6 +13197,7 @@ packages:
postgres-bytea: 1.0.0 postgres-bytea: 1.0.0
postgres-date: 1.0.7 postgres-date: 1.0.7
postgres-interval: 1.2.0 postgres-interval: 1.2.0
dev: false
/pg-types@4.0.2: /pg-types@4.0.2:
resolution: {integrity: sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng==} resolution: {integrity: sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng==}
@@ -13084,11 +13229,13 @@ packages:
pgpass: 1.0.5 pgpass: 1.0.5
optionalDependencies: optionalDependencies:
pg-cloudflare: 1.1.1 pg-cloudflare: 1.1.1
dev: false
/pgpass@1.0.5: /pgpass@1.0.5:
resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==}
dependencies: dependencies:
split2: 4.2.0 split2: 4.2.0
dev: false
/picocolors@1.0.0: /picocolors@1.0.0:
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
@@ -13912,6 +14059,7 @@ packages:
/postgres-array@2.0.0: /postgres-array@2.0.0:
resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==}
engines: {node: '>=4'} engines: {node: '>=4'}
dev: false
/postgres-array@3.0.2: /postgres-array@3.0.2:
resolution: {integrity: sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==} resolution: {integrity: sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==}
@@ -13920,6 +14068,7 @@ packages:
/postgres-bytea@1.0.0: /postgres-bytea@1.0.0:
resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==} resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
dev: false
/postgres-bytea@3.0.0: /postgres-bytea@3.0.0:
resolution: {integrity: sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==} resolution: {integrity: sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==}
@@ -13930,6 +14079,7 @@ packages:
/postgres-date@1.0.7: /postgres-date@1.0.7:
resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
dev: false
/postgres-date@2.1.0: /postgres-date@2.1.0:
resolution: {integrity: sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA==} resolution: {integrity: sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA==}
@@ -13940,6 +14090,7 @@ packages:
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
dependencies: dependencies:
xtend: 4.0.2 xtend: 4.0.2
dev: false
/postgres-interval@3.0.0: /postgres-interval@3.0.0:
resolution: {integrity: sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==} resolution: {integrity: sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==}
@@ -16233,6 +16384,7 @@ packages:
/web-streams-polyfill@3.3.3: /web-streams-polyfill@3.3.3:
resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==}
engines: {node: '>= 8'} engines: {node: '>= 8'}
dev: false
/webidl-conversions@3.0.1: /webidl-conversions@3.0.1:
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}

25
scripts/reset-tsconfig.js Normal file
View File

@@ -0,0 +1,25 @@
// @ts-check
/**
* Parse tsconfig.json and ensure
* - compilerOptions.paths['@payload-config'] is set to ['./test/_community/config.ts']
* - Ends with a newline
*/
import { parse, stringify } from 'comment-json'
import path from 'path'
import fs from 'fs/promises'
import { fileURLToPath } from 'url'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
const tsConfigPath = path.resolve(dirname, '../tsconfig.json')
const tsConfigContent = await fs.readFile(tsConfigPath, 'utf8')
const tsConfig = parse(tsConfigContent)
// @ts-expect-error
tsConfig.compilerOptions.paths['@payload-config'] = ['./test/_community/config.ts']
const output = stringify(tsConfig, null, 2) + `\n`
await fs.writeFile(tsConfigPath, output)

View File

@@ -30,7 +30,7 @@ if (args.turbo === true) {
process.env.PAYLOAD_DROP_DATABASE = 'true' process.env.PAYLOAD_DROP_DATABASE = 'true'
const { afterTest, beforeTest } = await createTestHooks(testSuiteArg) const { beforeTest } = await createTestHooks(testSuiteArg)
await beforeTest() await beforeTest()
const rootDir = getNextJSRootDir(testSuiteArg) const rootDir = getNextJSRootDir(testSuiteArg)
@@ -43,11 +43,5 @@ if (args.o) {
// @ts-expect-error // @ts-expect-error
await nextDev({ port: process.env.PORT || 3000, dirname: rootDir }, 'default', rootDir) await nextDev({ port: process.env.PORT || 3000, dirname: rootDir }, 'default', rootDir)
// On cmd+c, clean up
process.on('SIGINT', async () => {
await afterTest()
process.exit(0)
})
// fetch the admin url to force a render // fetch the admin url to force a render
fetch(`http://localhost:${process.env.PORT || 3000}/admin`) fetch(`http://localhost:${process.env.PORT || 3000}/admin`)

View File

@@ -1,15 +1,4 @@
import { createTestHooks } from './testHooks.js'
let afterTest: () => Promise<void> | undefined
beforeAll(async () => {
;({ afterTest } = await createTestHooks())
})
process.env.PAYLOAD_DISABLE_ADMIN = 'true' process.env.PAYLOAD_DISABLE_ADMIN = 'true'
process.env.PAYLOAD_DROP_DATABASE = 'true' process.env.PAYLOAD_DROP_DATABASE = 'true'
process.env.PAYLOAD_PUBLIC_CLOUD_STORAGE_ADAPTER = 's3' process.env.PAYLOAD_PUBLIC_CLOUD_STORAGE_ADAPTER = 's3'
afterAll(async () => {
await afterTest()
})

View File

@@ -1,16 +1,14 @@
// @ts-check
import { existsSync, promises } from 'fs' import { existsSync, promises } from 'fs'
import json5 from 'json5'
import path from 'path' import path from 'path'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
const { readFile, writeFile, rm } = promises const { rm } = promises
const filename = fileURLToPath(import.meta.url) const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename) const dirname = path.dirname(filename)
export const createTestHooks = async (testSuiteName = '_community') => { export const createTestHooks = async (testSuiteName = '_community') => {
const tsConfigPath = path.resolve(dirname, '../tsconfig.json')
const tsConfig = await json5.parse(await readFile(tsConfigPath, 'utf8'))
return { return {
/** /**
* Clear next webpack cache and set '@payload-config' path in tsconfig.json * Clear next webpack cache and set '@payload-config' path in tsconfig.json
@@ -22,20 +20,7 @@ export const createTestHooks = async (testSuiteName = '_community') => {
await rm(nextCache, { recursive: true }) await rm(nextCache, { recursive: true })
} }
// Set '@payload-config' in tsconfig.json
tsConfig.compilerOptions.paths['@payload-config'] = [`./test/${testSuiteName}/config.ts`]
await writeFile(tsConfigPath, JSON.stringify(tsConfig, null, 2))
process.env.PAYLOAD_CONFIG_PATH = path.resolve(testSuiteName, 'config') process.env.PAYLOAD_CONFIG_PATH = path.resolve(testSuiteName, 'config')
}, },
/**
* Reset the changes made to tsconfig.json
*/
afterTest: async () => {
// Set original value of '@payload-config' back to default of _community
tsConfig.compilerOptions.paths['@payload-config'] = ['./test/_community/config.ts']
await writeFile(tsConfigPath, JSON.stringify(tsConfig, null, 2) + '\n')
},
} }
} }

View File

@@ -37,7 +37,7 @@
], ],
"paths": { "paths": {
"@payload-config": [ "@payload-config": [
"./test/access-control/config.ts" "./test/_community/config.ts"
], ],
"@payloadcms/live-preview": [ "@payloadcms/live-preview": [
"./packages/live-preview/src" "./packages/live-preview/src"