feat!: upgrade minimum react, react-dom, @types/react and @types/react-dom versions to match exactly what Next.js is using, various dependency cleanup (#7106)

**BREAKING:**
- Upgrades minimum supported @types/react version from
npm:types-react@19.0.0-beta.2 to npm:types-react@19.0.0-rc.0
- Upgrades minimum supported @types/react-dom version from
npm:types-react-dom@19.0.0-beta.2 to npm:types-react-dom@19.0.0-rc.0
- Upgrades minimum supported react and react-dom version from
19.0.0-rc-f994737d14-20240522 to 19.0.0-rc-6230622a1a-20240610
This commit is contained in:
Alessio Gravili
2024-07-11 14:33:45 -04:00
committed by GitHub
parent e4eb5eb37e
commit f86e0edf9e
30 changed files with 8712 additions and 7206 deletions

View File

@@ -1,7 +1,7 @@
import { promises as fs, existsSync } from 'fs'
import path, { join } from 'path'
import glob from 'glob'
import process from 'process'
import globby from 'globby'
import process from 'node:process'
import chalk from 'chalk'
// Helper function to format size appropriately in KB or MB
@@ -73,35 +73,18 @@ async function cleanDirectories(patterns) {
if (pattern === '@node_modules') {
pattern = '**/node_modules'
fulleDelete = true
files = await new Promise((resolve, reject) => {
glob(pattern, { nodir: false }, (err, files) => {
if (err) {
reject(err)
} else {
// Filter out node_modules within other node_modules
const topNodeModules = files.filter((file) => {
const parentDir = path.dirname(file)
return !parentDir.includes('node_modules')
})
resolve(topNodeModules)
}
})
files = await globby(pattern, {
onlyDirectories: true,
ignore: ['**/node_modules/**/node_modules'],
})
} else {
const options = {
ignore: ignoreNodeModules ? '**/node_modules/**' : '',
nodir: false,
onlyDirectories: pattern.endsWith('/') ? true : false,
}
fulleDelete = options.onlyDirectories
files = await new Promise((resolve, reject) => {
glob(pattern, options, (err, files) => {
if (err) {
reject(err)
} else {
resolve(files)
}
})
})
files = await globby(pattern, options)
}
let count = 0