Skip to content

Commit 59f6af7

Browse files
authoredJan 6, 2022
fix: replace make-dir package with native (#3940)
1 parent afdf556 commit 59f6af7

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed
 

‎npm-shrinkwrap.json

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@
141141
"lodash": "^4.17.20",
142142
"log-symbols": "^4.0.0",
143143
"log-update": "^5.0.0",
144-
"make-dir": "^3.0.0",
145144
"memoize-one": "^6.0.0",
146145
"minimist": "^1.2.5",
147146
"multiparty": "^4.2.1",

‎src/lib/functions/runtimes/js/builders/zisi.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
const { writeFile } = require('fs').promises
1+
const { mkdir, writeFile } = require('fs').promises
22
const path = require('path')
33

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

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

7473
try {
75-
await makeDir(targetDirectory)
74+
await mkdir(targetDirectory, { recursive: true })
7675
} catch (error) {
7776
errorExit(`${NETLIFYDEVERR} Could not create directory: ${targetDirectory}`)
7877
}

‎src/utils/state-config.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const process = require('process')
44

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

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

1 commit comments

Comments
 (1)

github-actions[bot] commented on Jan 6, 2022

@github-actions[bot]

📊 Benchmark results

Package size: 359 MB

Please sign in to comment.