diff --git a/changelog.md b/changelog.md index 527d6df..0f1e68c 100644 --- a/changelog.md +++ b/changelog.md @@ -19,3 +19,8 @@ - Updated dependencies. - Move configs out of package.json - Use `wx` file flag instead of default `w` (thanks to @mattbretl via #8) + +### 2.0.2 + +- Updated dev dependencies. +- Fix mjs structure to work with node v12. diff --git a/package.json b/package.json index 013bf1c..dd18daf 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,8 @@ "lib", "!lib/test.*" ], - "main": "lib", - "module": "lib/index.mjs", + "main": "lib/index.js", + "module": "src/index.mjs", "engines": { "node": ">=8.5" }, @@ -36,7 +36,7 @@ "eslint-config-prettier": "^4.0.0", "eslint-plugin-import": "^2.16.0", "eslint-plugin-import-order-alphabetical": "^0.0.2", - "eslint-plugin-node": "^8.0.1", + "eslint-plugin-node": "^9.0.1", "eslint-plugin-prettier": "^3.0.0", "husky": "^2.2.0", "leaked-handles": "^5.2.0", @@ -45,17 +45,11 @@ "tap": "^13.1.2" }, "scripts": { - "prepare": "npm run prepare:clean && npm run prepare:mjs && npm run prepare:js && npm run prepare:prettier", - "prepare:clean": "rm -rf lib", - "prepare:mjs": "BABEL_ESM=1 babel src -d lib --keep-file-extension", - "prepare:js": "babel src -d lib", - "prepare:prettier": "prettier 'lib/**/*.{mjs,js}' --write", - "test": "npm run test:eslint && npm run test:prettier && npm run test:mjs && npm run test:js", + "prepare": "rm -rf lib && babel src/index.mjs -d lib && prettier 'lib/**/*.js' --write", + "test": "npm run test:eslint && npm run test:prettier && npm run test:tap", "test:eslint": "eslint . --ext mjs,js", "test:prettier": "prettier '**/*.{json,yml,md}' -l", - "test:mjs": "node --experimental-modules --no-warnings lib/test | tap-mocha-reporter spec", - "test:js": "node lib/test | tap-mocha-reporter spec", - "prepublishOnly": "npm run prepare && npm test", - "watch": "watch 'npm run prepublishOnly --silent' src --interval 1" + "test:tap": "node --experimental-modules --no-warnings src/test | tap-mocha-reporter spec", + "prepublishOnly": "npm run prepare && npm test" } } diff --git a/src/test.mjs b/src/test.mjs index 6d6663e..fa343b3 100644 --- a/src/test.mjs +++ b/src/test.mjs @@ -3,7 +3,7 @@ import "leaked-handles"; import fs from "fs"; import stream from "stream"; import t from "tap"; -import WriteStream, { ReadAfterDestroyedError } from "."; +import WriteStream, { ReadAfterDestroyedError } from "./index.mjs"; const streamToString = stream => new Promise((resolve, reject) => {