Skip to content

Commit

Permalink
chore(deps): update dependency rimraf to v4 (#5394)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Feb 27, 2023
1 parent 881dff6 commit ab792a9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 41 deletions.
File renamed without changes.
3 changes: 2 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions site/fs.mjs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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)
}
25 changes: 0 additions & 25 deletions site/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
}
Expand Down
8 changes: 4 additions & 4 deletions site/watch.mjs
Original file line number Diff line number Diff line change
@@ -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'] })

Expand Down Expand Up @@ -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}`)
}

1 comment on commit ab792a9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Package size: 262 MB

Please sign in to comment.