Skip to content

Commit bbe7be5

Browse files
authored
build: Remove @types/rimraf and some rimraf usage (#12276)
This was not really needed, so we may as well remove it. We still use it in package scripts, which is fine I'd say. Note that this still does not "fix" the `yarn add` issue, but one step at a time...
1 parent 81e0fd1 commit bbe7be5

File tree

5 files changed

+11
-73
lines changed

5 files changed

+11
-73
lines changed

dev-packages/e2e-tests/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"dotenv": "16.0.3",
2323
"esbuild": "0.20.0",
2424
"glob": "8.0.3",
25-
"rimraf": "^3.0.2",
2625
"ts-node": "10.9.1",
2726
"yaml": "2.2.2"
2827
},

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
"@types/jest": "^27.4.1",
106106
"@types/jsdom": "^21.1.6",
107107
"@types/node": "^14.18.0",
108-
"@types/rimraf": "^3.0.2",
109108
"@vitest/coverage-v8": "^1.6.0",
110109
"codecov": "^3.6.5",
111110
"deepmerge": "^4.2.2",

packages/aws-serverless/scripts/buildLambdaLayer.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable no-console */
22
import * as childProcess from 'child_process';
33
import * as fs from 'fs';
4-
import * as rimraf from 'rimraf';
54

65
import { version } from '../package.json';
76

@@ -60,6 +59,6 @@ buildLambdaLayer();
6059
* there), but also harmless when used in CI.
6160
*/
6261
function fsForceMkdirSync(path: string): void {
63-
rimraf.sync(path);
62+
fs.rmSync(path, { recursive: true, force: true });
6463
fs.mkdirSync(path);
6564
}

packages/nextjs/test/config/mocks.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import * as fs from 'fs';
55
import * as os from 'os';
66
import * as path from 'path';
7-
import * as rimraf from 'rimraf';
87

98
import { CLIENT_SDK_CONFIG_FILE, EDGE_SDK_CONFIG_FILE, SERVER_SDK_CONFIG_FILE } from './fixtures';
109

@@ -41,13 +40,13 @@ jest.spyOn(os, 'tmpdir').mockReturnValue(TEMP_DIR_PATH);
4140
// In theory, we should always land in the `else` here, but this saves the cases where the prior run got interrupted and
4241
// the `afterAll` below didn't happen.
4342
if (fs.existsSync(TEMP_DIR_PATH)) {
44-
rimraf.sync(path.join(TEMP_DIR_PATH, '*'));
45-
} else {
46-
fs.mkdirSync(TEMP_DIR_PATH);
43+
fs.rmSync(TEMP_DIR_PATH, { recursive: true, force: true });
4744
}
4845

46+
fs.mkdirSync(TEMP_DIR_PATH);
47+
4948
afterAll(() => {
50-
rimraf.sync(TEMP_DIR_PATH);
49+
fs.rmSync(TEMP_DIR_PATH, { recursive: true, force: true });
5150
});
5251

5352
// In order to know what to expect in the webpack config `entry` property, we need to know the path of the temporary

yarn.lock

+6-64
Original file line numberDiff line numberDiff line change
@@ -8451,17 +8451,7 @@
84518451
dependencies:
84528452
"@types/unist" "*"
84538453

8454-
"@types/history-4@npm:@types/[email protected]":
8455-
version "4.7.8"
8456-
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
8457-
integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
8458-
8459-
"@types/history-5@npm:@types/[email protected]":
8460-
version "4.7.8"
8461-
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
8462-
integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
8463-
8464-
"@types/history@*":
8454+
"@types/history-4@npm:@types/[email protected]", "@types/history-5@npm:@types/[email protected]", "@types/history@*":
84658455
version "4.7.8"
84668456
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
84678457
integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
@@ -8827,15 +8817,7 @@
88278817
"@types/history" "^3"
88288818
"@types/react" "*"
88298819

8830-
"@types/react-router-4@npm:@types/[email protected]":
8831-
version "5.1.14"
8832-
resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.1.14.tgz#e0442f4eb4c446541ad7435d44a97f8fe6df40da"
8833-
integrity sha512-LAJpqYUaCTMT2anZheoidiIymt8MuX286zoVFPM3DVb23aQBH0mAkFvzpd4LKqiolV8bBtZWT5Qp7hClCNDENw==
8834-
dependencies:
8835-
"@types/history" "*"
8836-
"@types/react" "*"
8837-
8838-
"@types/react-router-5@npm:@types/[email protected]":
8820+
"@types/react-router-4@npm:@types/[email protected]", "@types/react-router-5@npm:@types/[email protected]":
88398821
version "5.1.14"
88408822
resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.1.14.tgz#e0442f4eb4c446541ad7435d44a97f8fe6df40da"
88418823
integrity sha512-LAJpqYUaCTMT2anZheoidiIymt8MuX286zoVFPM3DVb23aQBH0mAkFvzpd4LKqiolV8bBtZWT5Qp7hClCNDENw==
@@ -8889,14 +8871,6 @@
88898871
"@types/glob" "*"
88908872
"@types/node" "*"
88918873

8892-
"@types/rimraf@^3.0.2":
8893-
version "3.0.2"
8894-
resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-3.0.2.tgz#a63d175b331748e5220ad48c901d7bbf1f44eef8"
8895-
integrity sha512-F3OznnSLAUxFrCEu/L5PY8+ny8DtcFRjx7fZZ9bycvXRi3KPTRS9HOitGZwvPg0juRhXFWIeKX58cnX5YqLohQ==
8896-
dependencies:
8897-
"@types/glob" "*"
8898-
"@types/node" "*"
8899-
89008874
"@types/rsvp@*", "@types/rsvp@~4.0.3":
89018875
version "4.0.4"
89028876
resolved "https://registry.yarnpkg.com/@types/rsvp/-/rsvp-4.0.4.tgz#55e93e7054027f1ad4b4ebc1e60e59eb091e2d32"
@@ -26134,7 +26108,7 @@ react-is@^18.0.0:
2613426108
dependencies:
2613526109
"@remix-run/router" "1.0.2"
2613626110

26137-
"react-router-6@npm:[email protected]":
26111+
"react-router-6@npm:[email protected]", [email protected]:
2613826112
version "6.3.0"
2613926113
resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.3.0.tgz#3970cc64b4cb4eae0c1ea5203a80334fdd175557"
2614026114
integrity sha512-7Wh1DzVQ+tlFjkeo+ujvjSqSJmkt1+8JO+T5xklPlgrh70y7ogx75ODRW0ThWhY7S+6yEDks8TYrtQe/aoboBQ==
@@ -26149,13 +26123,6 @@ react-router-dom@^6.2.2:
2614926123
history "^5.2.0"
2615026124
react-router "6.3.0"
2615126125

26152-
26153-
version "6.3.0"
26154-
resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.3.0.tgz#3970cc64b4cb4eae0c1ea5203a80334fdd175557"
26155-
integrity sha512-7Wh1DzVQ+tlFjkeo+ujvjSqSJmkt1+8JO+T5xklPlgrh70y7ogx75ODRW0ThWhY7S+6yEDks8TYrtQe/aoboBQ==
26156-
dependencies:
26157-
history "^5.2.0"
26158-
2615926126
react@^18.0.0:
2616026127
version "18.0.0"
2616126128
resolved "https://registry.yarnpkg.com/react/-/react-18.0.0.tgz#b468736d1f4a5891f38585ba8e8fb29f91c3cb96"
@@ -28474,7 +28441,7 @@ string-template@~0.2.1:
2847428441
resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add"
2847528442
integrity sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=
2847628443

28477-
"string-width-cjs@npm:string-width@^4.2.0":
28444+
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
2847828445
version "4.2.3"
2847928446
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
2848028447
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -28500,15 +28467,6 @@ string-width@^2.1.0:
2850028467
is-fullwidth-code-point "^2.0.0"
2850128468
strip-ansi "^4.0.0"
2850228469

28503-
string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
28504-
version "4.2.3"
28505-
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
28506-
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
28507-
dependencies:
28508-
emoji-regex "^8.0.0"
28509-
is-fullwidth-code-point "^3.0.0"
28510-
strip-ansi "^6.0.1"
28511-
2851228470
string-width@^5.0.1, string-width@^5.1.2:
2851328471
version "5.1.2"
2851428472
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
@@ -28604,14 +28562,7 @@ stringify-object@^3.2.1:
2860428562
is-obj "^1.0.1"
2860528563
is-regexp "^1.0.0"
2860628564

28607-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
28608-
version "6.0.1"
28609-
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
28610-
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
28611-
dependencies:
28612-
ansi-regex "^5.0.1"
28613-
28614-
[email protected], strip-ansi@^6.0.0, strip-ansi@^6.0.1:
28565+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", [email protected], strip-ansi@^6.0.0, strip-ansi@^6.0.1:
2861528566
version "6.0.1"
2861628567
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
2861728568
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -31238,7 +31189,7 @@ workerpool@^6.4.0:
3123831189
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.4.0.tgz#f8d5cfb45fde32fa3b7af72ad617c3369567a462"
3123931190
integrity sha512-i3KR1mQMNwY2wx20ozq2EjISGtQWDIfV56We+yGJ5yDs8jTwQiLLaqHlkBHITlCuJnYlVRmXegxFxZg7gqI++A==
3124031191

31241-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
31192+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
3124231193
version "7.0.0"
3124331194
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
3124431195
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -31256,15 +31207,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0:
3125631207
string-width "^4.1.0"
3125731208
strip-ansi "^6.0.0"
3125831209

31259-
wrap-ansi@^7.0.0:
31260-
version "7.0.0"
31261-
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
31262-
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
31263-
dependencies:
31264-
ansi-styles "^4.0.0"
31265-
string-width "^4.1.0"
31266-
strip-ansi "^6.0.0"
31267-
3126831210
wrap-ansi@^8.1.0:
3126931211
version "8.1.0"
3127031212
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"

0 commit comments

Comments
 (0)