Skip to content

Commit

Permalink
Remove mkdirp-then in favor of promisify (vercel#6408)
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Feb 22, 2019
1 parent 9247c90 commit e60a7cf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 23 deletions.
5 changes: 4 additions & 1 deletion packages/next/export/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import del from 'del'
import { cpus } from 'os'
import { fork } from 'child_process'
import cp from 'recursive-copy'
import mkdirp from 'mkdirp-then'
import mkdirpModule from 'mkdirp'
import { resolve, join } from 'path'
import { existsSync, readFileSync } from 'fs'
import loadConfig from 'next-server/next-config'
import { PHASE_EXPORT, SERVER_DIRECTORY, PAGES_MANIFEST, CONFIG_FILE, BUILD_ID_FILE, CLIENT_STATIC_FILES_PATH } from 'next-server/constants'
import createProgress from 'tty-aware-progress'
import { promisify } from 'util'

const mkdirp = promisify(mkdirpModule)

export default async function (dir, options, configuration) {
function log (message) {
Expand Down
19 changes: 11 additions & 8 deletions packages/next/export/worker.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import mkdirpModule from 'mkdirp'
import { promisify } from 'util'
import { extname, join, dirname, sep } from 'path'
import { renderToHTML } from 'next-server/dist/server/render'
import { writeFile } from 'fs'
import Sema from 'async-sema'
import { loadComponents } from 'next-server/dist/server/load-components'

const envConfig = require('next-server/config')
const mkdirp = promisify(mkdirpModule)

global.__NEXT_DATA__ = {
nextExport: true
}

const { extname, join, dirname, sep } = require('path')
const mkdirp = require('mkdirp-then')
const { renderToHTML } = require('next-server/dist/server/render')
const { writeFile } = require('fs')
const Sema = require('async-sema')
const { loadComponents } = require('next-server/dist/server/load-components')
const envConfig = require('next-server/config')

process.on(
'message',
async ({
Expand Down
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"hoist-non-react-statics": "3.2.0",
"launch-editor": "2.2.1",
"loader-utils": "1.1.0",
"mkdirp-then": "1.2.0",
"mkdirp": "0.5.1",
"nanoid": "1.2.1",
"next-server": "8.0.3",
"prop-types": "15.6.2",
Expand Down
13 changes: 0 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2051,11 +2051,6 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1:
dependencies:
color-convert "^1.9.0"

any-promise@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
integrity sha1-q8av7tzqUugJzcA3au0845Y10X8=

anymatch@^1.3.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a"
Expand Down Expand Up @@ -8178,14 +8173,6 @@ mk-dirs@^1.0.0:
resolved "https://registry.yarnpkg.com/mk-dirs/-/mk-dirs-1.0.0.tgz#44ee67f82341c6762718e88e85e577882e1f67fd"
integrity sha1-RO5n+CNBxnYnGOiOheV3iC4fZ/0=

mkdirp-then@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/mkdirp-then/-/mkdirp-then-1.2.0.tgz#a492c879ca4d873f5ee45008f8f55fd0150de3c5"
integrity sha1-pJLIecpNhz9e5FAI+PVf0BUN48U=
dependencies:
any-promise "^1.1.0"
mkdirp "^0.5.0"

mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
Expand Down

0 comments on commit e60a7cf

Please sign in to comment.