Skip to content

Commit

Permalink
fix(deps): deprecation warnings due to glob dependency (#7977)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars authored Dec 9, 2024
1 parent 59deb00 commit 5e3b8c1
Show file tree
Hide file tree
Showing 26 changed files with 65 additions and 85 deletions.
2 changes: 1 addition & 1 deletion dev/test-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@turf/points-within-polygon": "^5.1.5",
"@vercel/stega": "0.1.2",
"chokidar": "^3.5.3",
"globby": "^10.0.0",
"globby": "^11.1.0",
"history": "^5.3.0",
"lodash": "^4.17.21",
"qs": "^6.10.2",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
"eslint-plugin-unused-imports": "^3.2.0",
"execa": "^2.0.0",
"glob": "^11.0.0",
"globby": "^10.0.0",
"globby": "^11.1.0",
"husky": "^9.0.11",
"js-yaml": "^4.1.0",
"lerna": "^8.1.9",
Expand All @@ -160,7 +160,7 @@
"ora": "^8.0.1",
"prettier": "^3.3.3",
"read-package-up": "^11.0.0",
"rimraf": "^3.0.2",
"rimraf": "^5.0.10",
"rxjs": "^7.8.1",
"sanity": "workspace:*",
"semver": "^7.3.5",
Expand Down
3 changes: 1 addition & 2 deletions packages/@sanity/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
"@types/lodash": "^4.17.7",
"@types/minimist": "^1.2.5",
"@types/node": "^22.10.0",
"@types/rimraf": "^3.0.2",
"@types/semver": "^7.5.6",
"@types/semver-compare": "^1.0.1",
"@types/tar": "^6.1.3",
Expand Down Expand Up @@ -124,7 +123,7 @@
"promise-props-recursive": "^2.0.2",
"recast": "^0.23.9",
"resolve-from": "^5.0.0",
"rimraf": "^3.0.2",
"rimraf": "^5.0.10",
"semver": "^7.3.5",
"semver-compare": "^1.0.0",
"tar": "^6.1.11",
Expand Down
4 changes: 2 additions & 2 deletions packages/@sanity/cli/src/actions/init-project/git.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {execFileSync, execSync, type ExecSyncOptions} from 'node:child_process'
import path from 'node:path'

import rimraf from 'rimraf'
import {rimrafSync} from 'rimraf'

const defaultCommitMessage = 'feat: bootstrap sanity studio'

Expand Down Expand Up @@ -29,7 +29,7 @@ export function tryGitInit(rootDir: string, commitMessage?: string): boolean {
} catch (e) {
if (didInit) {
try {
rimraf.sync(path.join(rootDir, '.git'))
rimrafSync(path.join(rootDir, '.git'))
} catch (_) {
// intentional noop
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/codegen/.depcheckrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils"]
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils", "rimraf"]
}
4 changes: 2 additions & 2 deletions packages/@sanity/codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@babel/traverse": "^7.23.5",
"@babel/types": "^7.23.9",
"debug": "^4.3.4",
"globby": "^10.0.0",
"globby": "^11.1.0",
"groq": "workspace:*",
"groq-js": "^1.14.1",
"json5": "^2.2.3",
Expand All @@ -74,7 +74,7 @@
"@types/babel__register": "^7.17.3",
"@types/babel__traverse": "^7.20.5",
"@types/debug": "^4.1.12",
"rimraf": "^3.0.2",
"rimraf": "^5.0.10",
"vitest": "^2.1.1"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/diff/.depcheckrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils"]
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils", "rimraf"]
}
2 changes: 1 addition & 1 deletion packages/@sanity/diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"devDependencies": {
"@repo/package.config": "workspace:*",
"rimraf": "^3.0.2"
"rimraf": "^5.0.10"
},
"engines": {
"node": ">=18"
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/migrate/.depcheckrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils"]
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils", "rimraf"]
}
2 changes: 1 addition & 1 deletion packages/@sanity/migrate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@repo/test-config": "workspace:*",
"@types/arrify": "^2.0.1",
"@types/debug": "^4.1.12",
"rimraf": "^3.0.2",
"rimraf": "^5.0.10",
"vitest": "^2.1.1"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/mutator/.depcheckrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils"]
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils", "rimraf"]
}
2 changes: 1 addition & 1 deletion packages/@sanity/mutator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@repo/test-config": "workspace:*",
"@types/debug": "^4.1.5",
"@types/lodash": "^4.17.7",
"rimraf": "^3.0.2",
"rimraf": "^5.0.10",
"vitest": "^2.1.1"
}
}
2 changes: 1 addition & 1 deletion packages/@sanity/schema/.depcheckrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils", "@types/react"]
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils", "@types/react", "rimraf"]
}
2 changes: 1 addition & 1 deletion packages/@sanity/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@types/lodash": "^4.17.7",
"@types/object-inspect": "^1.13.0",
"@types/react": "^18.3.12",
"rimraf": "^3.0.2",
"rimraf": "^5.0.10",
"vitest": "^2.1.1"
}
}
2 changes: 1 addition & 1 deletion packages/@sanity/types/.depcheckrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils", "@sanity/types", "react"]
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils", "@sanity/types", "react", "rimraf"]
}
2 changes: 1 addition & 1 deletion packages/@sanity/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@sanity/insert-menu": "1.0.16",
"@vitejs/plugin-react": "^4.3.3",
"react": "^18.3.1",
"rimraf": "^3.0.2",
"rimraf": "^5.0.10",
"vitest": "^2.1.1"
}
}
2 changes: 1 addition & 1 deletion packages/@sanity/util/.depcheckrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils"]
"ignores": ["@repo/tsconfig", "@sanity/pkg-utils", "rimraf"]
}
2 changes: 1 addition & 1 deletion packages/@sanity/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"devDependencies": {
"@repo/package.config": "workspace:*",
"@repo/test-config": "workspace:*",
"rimraf": "^3.0.2",
"rimraf": "^5.0.10",
"vitest": "^2.1.1"
},
"engines": {
Expand Down
4 changes: 1 addition & 3 deletions packages/sanity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
"refractor": "^3.6.0",
"resolve-from": "^5.0.0",
"resolve.exports": "^2.0.2",
"rimraf": "^3.0.2",
"rimraf": "^5.0.10",
"rxjs": "^7.8.0",
"rxjs-exhaustmap-with-trailing": "^2.1.1",
"sanity-diff-patch": "^4.0.0",
Expand Down Expand Up @@ -295,7 +295,6 @@
"@types/react-dom": "^18.3.1",
"@types/refractor": "^3.0.0",
"@types/resolve-from": "^4.0.0",
"@types/rimraf": "^3.0.2",
"@types/semver": "^6.2.3",
"@types/tar-fs": "^2.0.1",
"@vitejs/plugin-react": "^4.3.3",
Expand All @@ -305,7 +304,6 @@
"date-fns-tz": "2.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rimraf": "^3.0.2",
"rxjs-etc": "^10.6.2",
"styled-components": "^6.1.13",
"swr": "2.2.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import rimraf from 'rimraf'
import {rimraf} from 'rimraf'

import debug from './debug'

function cleanupTmpDir(tmpDir: string): void {
rimraf(tmpDir, (err) => {
if (err) {
debug(`Error cleaning up temporary files: ${err.message}`)
}
})
async function cleanupTmpDir(tmpDir: string): Promise<void> {
try {
await rimraf(tmpDir)
} catch (err) {
debug(`Error cleaning up temporary files: ${err.message}`)
}
}

export default cleanupTmpDir
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import path from 'node:path'
import {promisify} from 'node:util'

import chalk from 'chalk'
import {info} from 'log-symbols'
import semver from 'semver'
import {noopLogger} from '@sanity/telemetry'
import rimrafCallback from 'rimraf'
import {rimraf} from 'rimraf'
import type {CliCommandArguments, CliCommandContext} from '@sanity/cli'

import {buildStaticFiles, ChunkModule, ChunkStats} from '../../server'
Expand All @@ -18,8 +17,6 @@ import {compareStudioDependencyVersions} from '../../util/compareStudioDependenc
import {getAutoUpdateImportMap} from '../../util/getAutoUpdatesImportMap'
import {shouldAutoUpdate} from '../../util/shouldAutoUpdate'

const rimraf = promisify(rimrafCallback)

export interface BuildSanityStudioCommandFlags {
'yes'?: boolean
'y'?: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const downloadBackupCommand: CliCommandDefinition = {
progressSpinner.set({
step: `Cleaning up temporary files at ${chalk.cyan(`${tmpOutDir}`)}`,
})
cleanupTmpDir(tmpOutDir)
await cleanupTmpDir(tmpOutDir)

progressSpinner.set({
step: `Backup download complete [${prettyMs(Date.now() - start)}]`,
Expand Down
2 changes: 1 addition & 1 deletion perf/efps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"chalk": "^4.1.2",
"cli-table3": "^0.6.5",
"dotenv": "^16.0.3",
"globby": "^10.0.0",
"globby": "^11.1.0",
"ora": "^8.0.1",
"playwright": "^1.46.1",
"react": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion perf/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@sanity/uuid": "^3.0.1",
"dotenv": "^16.0.3",
"execa": "^2.0.0",
"globby": "^10.0.0",
"globby": "^11.1.0",
"lodash": "^4.17.21",
"rxjs": "^7.8.0",
"sanity": "workspace:*"
Expand Down
Loading

0 comments on commit 5e3b8c1

Please sign in to comment.