Skip to content

Commit

Permalink
fix: replace make-dir package with native (#3940)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR authored Jan 6, 2022
1 parent afdf556 commit 59f6af7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion npm-shrinkwrap.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@
"lodash": "^4.17.20",
"log-symbols": "^4.0.0",
"log-update": "^5.0.0",
"make-dir": "^3.0.0",
"memoize-one": "^6.0.0",
"minimist": "^1.2.5",
"multiparty": "^4.2.1",
Expand Down
5 changes: 2 additions & 3 deletions src/lib/functions/runtimes/js/builders/zisi.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const { writeFile } = require('fs').promises
const { mkdir, writeFile } = require('fs').promises
const path = require('path')

const { zipFunction } = require('@netlify/zip-it-and-ship-it')
const decache = require('decache')
const makeDir = require('make-dir')
const readPkgUp = require('read-pkg-up')
const sourceMapSupport = require('source-map-support')

Expand Down Expand Up @@ -72,7 +71,7 @@ const getTargetDirectory = async ({ errorExit }) => {
const targetDirectory = path.resolve(getPathInProject(['functions-serve']))

try {
await makeDir(targetDirectory)
await mkdir(targetDirectory, { recursive: true })
} catch (error) {
errorExit(`${NETLIFYDEVERR} Could not create directory: ${targetDirectory}`)
}
Expand Down
3 changes: 1 addition & 2 deletions src/utils/state-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const process = require('process')

const dotProp = require('dot-prop')
const findUp = require('find-up')
const makeDir = require('make-dir')
const writeFileAtomic = require('write-file-atomic')

const { getPathInProject } = require('../lib/settings')
Expand Down Expand Up @@ -55,7 +54,7 @@ class StateConfig {
set all(val) {
try {
// Make sure the folder exists as it could have been deleted in the meantime
makeDir.sync(path.dirname(this.path))
fs.mkdirSync(path.dirname(this.path), { recursive: true })
writeFileAtomic.sync(this.path, JSON.stringify(val, null, '\t'))
} catch (error) {
// Improve the message of permission errors
Expand Down

1 comment on commit 59f6af7

@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: 359 MB

Please sign in to comment.