Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace make-dir package with native #3940

Merged
merged 2 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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