From ab792a9de6fad438910e50638aab7b0ff1980581 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 13:30:00 +0000 Subject: [PATCH] chore(deps): update dependency rimraf to v4 (#5394) * chore(deps): update dependency rimraf to v4 * chore: remove rimraf * chore: 16 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Tschinder <231804+danez@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- functions/{telemetry.js => telemetry.cjs} | 0 netlify.toml | 3 ++- site/fs.mjs | 9 -------- site/package-lock.json | 25 ----------------------- site/package.json | 3 +-- site/watch.mjs | 8 ++++---- 6 files changed, 7 insertions(+), 41 deletions(-) rename functions/{telemetry.js => telemetry.cjs} (100%) diff --git a/functions/telemetry.js b/functions/telemetry.cjs similarity index 100% rename from functions/telemetry.js rename to functions/telemetry.cjs diff --git a/netlify.toml b/netlify.toml index e36c9098e4e..bd246877932 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,8 +5,9 @@ publish = "site/dist" [build.environment] + # cannot use node 18, as we use x0 which uses webpack 4 NODE_VERSION = "16" - AWS_LAMBDA_JS_RUNTIME = "nodejs14.x" + AWS_LAMBDA_JS_RUNTIME = "nodejs16.x" [functions] # Sets a custom directory for Netlify Functions diff --git a/site/fs.mjs b/site/fs.mjs index 22abed8c697..c1cce9c35d7 100644 --- a/site/fs.mjs +++ b/site/fs.mjs @@ -1,10 +1,5 @@ import { promises as fs } from 'fs' import { join, dirname } from 'path' -import { promisify } from 'util' - -import rimraf from 'rimraf' - -const rimrafAsync = promisify(rimraf) export const copyDirRecursiveAsync = async (src, dest) => { try { @@ -38,7 +33,3 @@ export const ensureFilePathAsync = async (filePath) => { // ignore any errors with mkdir - it will throw if the path already exists. } } - -export const removeRecursiveAsync = async (filePath) => { - await rimrafAsync(filePath) -} diff --git a/site/package-lock.json b/site/package-lock.json index 85ee304d11f..e3d761af498 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -26,7 +26,6 @@ "devDependencies": { "markdown-magic": "2.6.1", "npm-run-all": "^4.1.5", - "rimraf": "^3.0.0", "sane": "^5.0.0", "strip-ansi": "^7.0.0" }, @@ -10411,21 +10410,6 @@ "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -22495,15 +22479,6 @@ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, "ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", diff --git a/site/package.json b/site/package.json index b2056113419..a0435942181 100644 --- a/site/package.json +++ b/site/package.json @@ -19,7 +19,7 @@ "start:watch": "node ./watch.mjs", "watch": "node ./watch.mjs", "sync": "node ./sync.mjs", - "clean": "rimraf dist" + "clean": "rm -rf dist" }, "engines": { "node": "^14.16.0 || >=16.0.0" @@ -43,7 +43,6 @@ "devDependencies": { "markdown-magic": "2.6.1", "npm-run-all": "^4.1.5", - "rimraf": "^3.0.0", "sane": "^5.0.0", "strip-ansi": "^7.0.0" } diff --git a/site/watch.mjs b/site/watch.mjs index 2af71d39f0a..965cf1046e4 100644 --- a/site/watch.mjs +++ b/site/watch.mjs @@ -1,11 +1,11 @@ /* Syncs blog content from repo to /site/blog */ -import { promises as fs } from 'fs' +import { copyFile, rm } from 'fs/promises' import { join } from 'path' import sane from 'sane' import { docs } from './config.mjs' -import { ensureFilePathAsync, removeRecursiveAsync } from './fs.mjs' +import { ensureFilePathAsync } from './fs.mjs' const watcher = sane(docs.srcPath, { glob: ['**/*.md'] }) @@ -41,12 +41,12 @@ const getFullPath = function (filePath) { const syncFile = async function (filePath) { const { destination, src } = getFullPath(filePath) await ensureFilePathAsync(destination) - await fs.copyFile(src, destination) + await copyFile(src, destination) console.log(`${filePath} synced to ${destination}`) } const deleteFile = async function (filePath) { const { destination } = getFullPath(filePath) - await removeRecursiveAsync(destination) + await rm(destination, { force: true, recursive: true }) console.log(`${filePath} removed from ${destination}`) }