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

Remove util.promisify polyfill for Node 6 #53

Merged
merged 4 commits into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
- Add toggle button for listing all served resources in server mode ([#49](https://github.com/marp-team/marp-cli/pull/49))
- Toggle full screen by hitting <kbd>f</kbd> / <kbd>F11</kbd> in `bespoke` template ([#50](https://github.com/marp-team/marp-cli/pull/50))

### Removed

- Remove `util.promisify` polyfill for Node 6 ([#53](https://github.com/marp-team/marp-cli/pull/53))

## v0.0.15 - 2018-12-06

### Added
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
"serve-index": "^1.9.1",
"terminate": "^2.1.2",
"tmp": "^0.0.33",
"util.promisify": "^1.0.0",
"ws": "^6.1.2",
"yargs": "^12.0.5"
}
Expand Down
1 change: 1 addition & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const external = [
'path',
'querystring',
'url',
'util',
'chrome-launcher/dist/chrome-finder',
'yargs/yargs',
]
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import cosmiconfig from 'cosmiconfig'
import path from 'path'
import fs from 'fs'
import osLocale from 'os-locale'
import promisify from 'util.promisify'
import { promisify } from 'util'
import { info, warn } from './cli'
import { ConverterOption, ConvertType } from './converter'
import resolveEngine, { ResolvableEngine, ResolvedEngine } from './engine'
Expand Down
2 changes: 1 addition & 1 deletion src/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Marpit } from '@marp-team/marpit'
import fs from 'fs'
import path from 'path'
import pkgUp from 'pkg-up'
import promisify from 'util.promisify'
import { promisify } from 'util'
import importFrom from 'import-from'
import { CLIError } from './error'

Expand Down
4 changes: 2 additions & 2 deletions src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import globby from 'globby'
import mkdirp from 'mkdirp'
import path from 'path'
import { tmpName } from 'tmp'
import promisify from 'util.promisify'
import { promisify } from 'util'

const mkdirpPromise = promisify(mkdirp)
const mkdirpPromise = promisify<string, any>(mkdirp)
const readFile = promisify(fs.readFile)
const tmpNamePromise = promisify(tmpName)
const unlink = promisify(fs.unlink)
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from 'path'
import querystring from 'querystring'
import serveIndex from 'serve-index'
import url from 'url'
import promisify from 'util.promisify'
import { promisify } from 'util'
import { Converter, ConvertedCallback, ConvertType } from './converter'
import { error } from './error'
import { File, markdownExtensions } from './file'
Expand Down
2 changes: 1 addition & 1 deletion src/templates/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MarpitOptions, MarpitRenderResult, Element } from '@marp-team/marpit'
import fs from 'fs'
import path from 'path'
import promisify from 'util.promisify'
import { promisify } from 'util'
import barePug from './bare/bare.pug'
import bareScss from './bare/bare.scss'
import bespokePug from './bespoke/bespoke.pug'
Expand Down
2 changes: 1 addition & 1 deletion src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Marpit } from '@marp-team/marpit'
import fs from 'fs'
import globby from 'globby'
import path from 'path'
import promisify from 'util.promisify'
import { promisify } from 'util'
import { warn } from './cli'

const lstat = promisify(fs.lstat)
Expand Down
4 changes: 2 additions & 2 deletions test/__mocks__/fs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { custom } from 'util.promisify'
import { promisify } from 'util'

const fs = require.requireActual('fs')

fs.writeFile[custom] = (path, data) =>
fs.writeFile[promisify.custom] = (path, data) =>
new Promise((resolve, reject) =>
fs.writeFile(path, data, e => (e ? reject(e) : resolve()))
)
Expand Down