From 751af8b7bdc4c6c9942e872a58370fe195435e3d Mon Sep 17 00:00:00 2001 From: bdistin Date: Sun, 10 Feb 2019 17:12:04 -0600 Subject: [PATCH] Release v0.4.1 (#86) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove hard-coded functions names for `promisify` (#9) * remove hard-coded functions names for `promisify` * fixing eslint * fix code style * add atomics keyword, and bump to v0.1.5 * It requires Node.js 8.1.0 (#10) * fix npm npm wouldn't let me fix the pulished version correctly, had to bump package to fix. * Modualized Refactor and Docs (#12) * modualise and document * fix util requires * fix outputjsonatomic requires * finish out docs * generated docs * Fix travis * bump version to v0.2.0 * Fix lint * remove search the search didn't really work * cname for js.org * more docs customization * More document coverage * Fix lint * finish documentation coverage * Add a Codacy badge to README.md (#13) * Add Codacy badge * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * update docs * Create LICENSE * update dev deps, add tests to travis, unskip all tests * Some fixes, and a bunch more tests I am aware builds are going to fail for a while * Fix one test * finish tests draft * fix a couple tests * fix more tests * Fix build with test skips * 3 more skips * more test work * remove fixes * this is probably going to fail build * maybe fixed 1 test? * fix move test * fix some test bugs * skip symlink tests until I can rewrite to remove fs-mock * Create .travis-deploy.sh * Update package.json * Update .travis.yml * Update .travis-deploy.sh * try auto docs * Update .travis-deploy.sh * fix .travis-deploy? * Update .travis-deploy.sh * Update .travis-deploy.sh * Update .travis-deploy.sh * Update .travis-deploy.sh * Update .travis-deploy.sh * Update .travis-deploy.sh * Update .travis-deploy.sh * Site build: c4a1ec1e3c739d4a08a32ea2d4483600286200c9 * fix docs, from auto docs test * Site build: b8d9a56d40b100fd0e1a1e692561afd3e04b1bd6 * Update .travis-deploy.sh * Update .travis-deploy.sh * Update .travis.yml * Update .travis-deploy.sh * add .travis-deploy.sh to npmignore * update deps * Docs build: c94706278e9c45a54bed6f280c1b62466d3cbe41 * Docs build: 01c52e8c4d195c30b4eb4fe242970cde79a6d7f6 * Add Greenkeeper badge 🌴 (#15) * docs(readme): add Greenkeeper badge * Update README.md * Fix travis deploy * Docs build: 21de27fb68c853b1a8b5d3884de0a76504217f20 * update eslint * Update README.md * Docs build: 39e4515a722ca1270bfbd455a195def289d81ef0 * code cleanup * Fix typo (#16) * Docs build: e1f855619c43b870cd12d20f90098f69a97349a3 * fix util mkDir * Docs build: 011f8b74ec618b0bcb29d23c6987766596f6fbe9 * Fix copy error * 0.2.1 * Copy file (#18) * copyFile changes * some docs, still very wip * Update .travis.yml * mock fs can't handle the new fs.copyFile yet * emptyDir bugfix * last bug fix * Typings. (#19) * Create tslint.json * Fixed typos, added typings. * Fixed all JSDocs * minor fixes * fix lint and friends * missed docs * le typings * Docs build: 29fb5da6294b703ca6e7424ba4caf2e245b16a9f * update readme * Docs build: 83dc519c5f933a08803bf127595d6d4242fbf757 * Coverage (#21) * start coverage and docs changes * remove docs from future master * oops travis * make codacy happy more tests, still wip * progress, but mock-fs sucks * fix scripts * begin module structure and ditching mock-fs * add another test to see if somethings wrong... * oops * Update Messages, Add test * tests progress * push progress * push progress * oops * push progress * oops * finish basic tests * small fixes * oops * bug fix * test fixes * should fix a lot of symlink bugs? * maybe fix move tests? * take 2 move tests * take 3 move * fix remove tests * ahah! * see how this fares for copy * idek anymore * try this on for size * duh * fingers crossed * more copy coverage * copy coverage * Update README.md * More unit tests (#22) * copy tests * oh yeah * symlink copy test * interesting edge test * oops * up threshold * update npm ignore for prepping patch release * 0.3.1 * Remove mock-fs since it's not used anymore * Scan (#24) * impliment scan idea (klaw without nastiness) * impliment limit * umm? * ohh! * should do the first directory. * add filter * fix limit * docs * copy paste OP * tests * fix test * unneeded `async` * typings I think * 0.3.2 * Fixed some types (#27) * Fixed some types * I guess this is the fix * chore(package): update ava to version 0.23.0 (#26) * Add matrix testing support * Add node 9 testing to coverage * uh, you skipped 8... * try again travis * ?? travis you there? * update lint * chore(package): update ava to version 0.25.0 (#28) * chore(package): update ava to version 0.25.0 (#29) Closes #28 * fix broken test? * Fixed typings (#30) * Fixed typings (hopefully) Fixed return types for createReadStream and createWriteStream Imported Buffer to fix a ton of errors * Fixed a missing property by just importing from fs I don't remember what I was trying to use, but something was missing from ReadStream/WriteStream. I just imported it from fs, to ensure consistency. * add fs/promises support if your node version is high enough * bump version and add note to readme * add node 10 tests to travis * fix broken test? * try again? * bump package.json * fix some docs * chore(package): update codacy-coverage to version 3.0.0 (#34) * more bugged docs * Update @types/node to the latest version 🚀 (#36) * chore(package): update @types/node to version 10.0.3 * Update README.md * fix lint warnings and fix fs.promises use for node ^10.1.0 drop support for node 10.0.0 fs.promises (will fall back to regular util.promisify so not breaking) * chore(package): update @types/node to version 10.1.3 (#39) * chore(package): update nyc to version 12.0.1 (#41) * Update README.md * Update typescript requirement to ^3.0.1 (#45) Updates the requirements on [typescript](https://github.com/Microsoft/TypeScript) to permit the latest version. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/commits/v3.0.1) Signed-off-by: dependabot[bot] * Update eslint requirement to ^5.2.0 (#46) Updates the requirements on [eslint](https://github.com/eslint/eslint) to permit the latest version. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/commits/v5.2.0) Signed-off-by: dependabot[bot] * docs: Improved typings and docs (#43) * doc: Updated all docs, made typings way better * fix: fsn#emptyDir (readdir returns string[], mkdirs returns string) * tslint: Replaced quotes * eslint: Remove @returns tag for emptyDir * tslint: Fix typings for fs#write * return 'file' if lstat errors * test: Add test for bug kyra found * bump version for release * fix alias `writeJsonAtomic` (#49) * bump version for release * Update nyc requirement from ^12.0.1 to ^13.0.1 (#51) Updates the requirements on [nyc](https://github.com/istanbuljs/nyc) to permit the latest version. - [Release notes](https://github.com/istanbuljs/nyc/releases) - [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md) - [Commits](https://github.com/istanbuljs/nyc/commits/v13.0.1) Signed-off-by: dependabot[bot] * Update scan.js * Chore(deps-dev): update ava requirement from ^0.25.0 to ^1.0.1 (#53) * Chore(deps-dev): update ava requirement from ^0.25.0 to ^1.0.1 Updates the requirements on [ava](https://github.com/avajs/ava) to permit the latest version. - [Release notes](https://github.com/avajs/ava/releases) - [Commits](https://github.com/avajs/ava/commits/v1.0.1) Signed-off-by: dependabot[bot] * Update copy.js * Update scan.js * Update remove.js * Update move.js * use yarn.lock for dependabot, add node 11 tests (#54) * use yarn.lock for dependabot, add node 11 tests * actually, no need to test node 9 any longer * refactor copy to be less complex (#55) * bump patch for new release * switch from codacy to coveralls * better test coverage * typos * add another test case * another test having trouble hitting the lines I want to... * more tests * fix expected assertions * more tests * lint * badge updates * attempt ignoring all windows specific code * wrong path ignored * updated comments * see if this makes a branch difference * more clear logic/ comments * lint * util coverage comments * remove duplicate coercion * refactor then/catch tree into try/catch await * lint * docs spelling * more tests and docs fixes * maybe fix coverage ignore? * add appveyor config (#57) * add appveyor config * new line endof file * get linux errors * breaking: rewrite move * test fails on both linux/windows, presumed flawed test * add proper ignores back to the new move * remove other clobber options * refactor util this might reduce coverage * better isSrcKid * fix bad refactor * another copy test * and another * another obscure test * bit of rewrite * better coverage * does this change how coverage sees branches? * ? * more rewrite no .then/.catch * symlink test * does this get that last symlink branch? * whoops * one last obscure test and hope we don't lock up travis * fix duplicate title * correction dev/null is a character device, not block device :( * Bump tslint from 5.11.0 to 5.12.0 Bumps [tslint](https://github.com/palantir/tslint) from 5.11.0 to 5.12.0. - [Release notes](https://github.com/palantir/tslint/releases) - [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/palantir/tslint/compare/5.11.0...5.12.0) Signed-off-by: dependabot[bot] * Bump @types/node from 10.12.15 to 10.12.17 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped) from 10.12.15 to 10.12.17. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits) Signed-off-by: dependabot[bot] * coverage * or actually * fix superfluous argument * clobber removed * make prs report coverage too (#60) * Bump @types/node from 10.12.17 to 10.12.18 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped) from 10.12.17 to 10.12.18. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits) Signed-off-by: dependabot[bot] * Bump eslint from 5.10.0 to 5.11.0 Bumps [eslint](https://github.com/eslint/eslint) from 5.10.0 to 5.11.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v5.10.0...v5.11.0) Signed-off-by: dependabot[bot] * Bump eslint from 5.11.0 to 5.11.1 Bumps [eslint](https://github.com/eslint/eslint) from 5.11.0 to 5.11.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v5.11.0...v5.11.1) Signed-off-by: dependabot[bot] * consistent errors * ensure strict returns and consistency sweep * fix return type * fix coverage * more simplification * whoops * remove useless return * revert change to mkdirs since that slows recursive calls unnecessarily * more cleanup and engine bump for object spread * forgot to hit save * Bump eslint from 5.11.1 to 5.12.0 Bumps [eslint](https://github.com/eslint/eslint) from 5.11.1 to 5.12.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v5.11.1...v5.12.0) Signed-off-by: dependabot[bot] * Bump tslint from 5.12.0 to 5.12.1 Bumps [tslint](https://github.com/palantir/tslint) from 5.12.0 to 5.12.1. - [Release notes](https://github.com/palantir/tslint/releases) - [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/palantir/tslint/compare/5.12.0...5.12.1) Signed-off-by: dependabot[bot] * Bump ava from 1.0.1 to 1.1.0 Bumps [ava](https://github.com/avajs/ava) from 1.0.1 to 1.1.0. - [Release notes](https://github.com/avajs/ava/releases) - [Commits](https://github.com/avajs/ava/compare/v1.0.1...v1.1.0) Signed-off-by: dependabot[bot] * Bump typescript from 3.2.2 to 3.2.4 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.2.2 to 3.2.4. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v3.2.2...v3.2.4) Signed-off-by: dependabot[bot] * Bump eslint from 5.12.0 to 5.12.1 Bumps [eslint](https://github.com/eslint/eslint) from 5.12.0 to 5.12.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v5.12.0...v5.12.1) Signed-off-by: dependabot[bot] * Bump ava from 1.1.0 to 1.2.0 Bumps [ava](https://github.com/avajs/ava) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/avajs/ava/releases) - [Commits](https://github.com/avajs/ava/compare/v1.1.0...v1.2.0) Signed-off-by: dependabot[bot] * Bump @types/node from 10.12.18 to 10.12.19 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped) from 10.12.18 to 10.12.19. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits) Signed-off-by: dependabot[bot] * Bump @types/node from 10.12.19 to 10.12.20 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped) from 10.12.19 to 10.12.20. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits) Signed-off-by: dependabot[bot] * Bump typescript from 3.2.4 to 3.3.1 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.2.4 to 3.3.1. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v3.2.4...v3.3.1) Signed-off-by: dependabot[bot] * Bump @types/node from 10.12.20 to 10.12.21 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped) from 10.12.20 to 10.12.21. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits) Signed-off-by: dependabot[bot] * Bump eslint from 5.12.1 to 5.13.0 Bumps [eslint](https://github.com/eslint/eslint) from 5.12.1 to 5.13.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v5.12.1...v5.13.0) Signed-off-by: dependabot[bot] * Bump jsdoc from `b214273` to `10c004f` Bumps [jsdoc](https://github.com/jsdoc3/jsdoc) from `b214273` to `10c004f`. - [Release notes](https://github.com/jsdoc3/jsdoc/releases) - [Commits](https://github.com/jsdoc3/jsdoc/compare/b21427343c7294bbf1f14c718a390f3e955e37cb...10c004f823b2d8691441e1b0b8d296005b087ae1) Signed-off-by: dependabot[bot] * Bump nyc from 13.1.0 to 13.2.0 Bumps [nyc](https://github.com/istanbuljs/nyc) from 13.1.0 to 13.2.0. - [Release notes](https://github.com/istanbuljs/nyc/releases) - [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md) - [Commits](https://github.com/istanbuljs/nyc/compare/v13.1.0...v13.2.0) Signed-off-by: dependabot[bot] * Bump ava from 1.2.0 to 1.2.1 Bumps [ava](https://github.com/avajs/ava) from 1.2.0 to 1.2.1. - [Release notes](https://github.com/avajs/ava/releases) - [Commits](https://github.com/avajs/ava/compare/v1.2.0...v1.2.1) Signed-off-by: dependabot[bot] * Bump @types/node from 10.12.21 to 10.12.23 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped) from 10.12.21 to 10.12.23. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits) Signed-off-by: dependabot[bot] * Bump typescript from 3.3.1 to 3.3.3 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.3.1 to 3.3.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/commits) Signed-off-by: dependabot[bot] * TypeScript Re-Write (#83) * wip ts rewrite * odd? * ah * make min node 10 * fix appveyor * cleaner export * Revert "cleaner export" This reverts commit 398a928c44795395b737d298669c491385c7c8af. * remove typings, update readme * full sounds wrong with ts * more official * update npm ignore * see if this fixes coverage * fix coverage * add a chmod test * mode includes more than just the chmod * who knows, tbh * make it more interesting * fk it * switch to a basic typedocs * fix output * update npm description * bump minor for new release * run tests in typescript (#85) * run tests in typescript * oops, fix test * fix linting * real fixes * use more yarn * fix lint * try this * revert coverage reporting * ok whatever * might aswell change these too * ugh, fix this * I cba anymore * bump patch for new release --- package.json | 24 +++- scripts/.travis-coverage.sh | 6 +- scripts/.travis-deploy.sh | 4 +- src/nextra/createSymlink.ts | 4 +- src/nextra/mkdirs.ts | 2 +- src/nextra/outputFile.ts | 2 +- src/nextra/outputJSON.ts | 2 +- src/nextra/remove.ts | 1 - src/nextra/writeJSON.ts | 2 +- test/{copy.js => copy.ts} | 10 +- test/{copyFileAtomic.js => copyFileAtomic.ts} | 8 +- test/{createFile.js => createFile.ts} | 8 +- ...reateFileAtomic.js => createFileAtomic.ts} | 8 +- test/{createFileCopy.js => createFileCopy.ts} | 8 +- ...eCopyAtomic.js => createFileCopyAtomic.ts} | 8 +- test/{createLink.js => createLink.ts} | 8 +- ...reateLinkAtomic.js => createLinkAtomic.ts} | 8 +- test/{createSymlink.js => createSymlink.ts} | 12 +- ...ymlinkAtomic.js => createSymlinkAtomic.ts} | 8 +- test/{emptyDir.js => emptyDir.ts} | 8 +- test/lib/index.js | 33 ----- test/lib/index.ts | 33 +++++ test/{linkAtomic.js => linkAtomic.ts} | 8 +- test/{mkdirs.js => mkdirs.ts} | 8 +- test/{move.js => move.ts} | 8 +- test/{outputFile.js => outputFile.ts} | 8 +- ...utputFileAtomic.js => outputFileAtomic.ts} | 8 +- test/{outputJSON.js => outputJSON.ts} | 9 +- ...utputJSONAtomic.js => outputJSONAtomic.ts} | 8 +- test/{pathExists.js => pathExists.ts} | 6 +- test/{readJSON.js => readJSON.ts} | 8 +- test/{remove.js => remove.ts} | 12 +- test/{scan.js => scan.ts} | 6 +- test/{symlinkAtomic.js => symlinkAtomic.ts} | 8 +- ...{writeFileAtomic.js => writeFileAtomic.ts} | 8 +- test/{writeJSON.js => writeJSON.ts} | 8 +- ...{writeJSONAtomic.js => writeJSONAtomic.ts} | 8 +- yarn.lock | 124 +++++++++++++----- 38 files changed, 258 insertions(+), 194 deletions(-) rename test/{copy.js => copy.ts} (94%) rename test/{copyFileAtomic.js => copyFileAtomic.ts} (61%) rename test/{createFile.js => createFile.ts} (85%) rename test/{createFileAtomic.js => createFileAtomic.ts} (81%) rename test/{createFileCopy.js => createFileCopy.ts} (87%) rename test/{createFileCopyAtomic.js => createFileCopyAtomic.ts} (83%) rename test/{createLink.js => createLink.ts} (86%) rename test/{createLinkAtomic.js => createLinkAtomic.ts} (83%) rename test/{createSymlink.js => createSymlink.ts} (88%) rename test/{createSymlinkAtomic.js => createSymlinkAtomic.ts} (83%) rename test/{emptyDir.js => emptyDir.ts} (81%) delete mode 100644 test/lib/index.js create mode 100644 test/lib/index.ts rename test/{linkAtomic.js => linkAtomic.ts} (61%) rename test/{mkdirs.js => mkdirs.ts} (88%) rename test/{move.js => move.ts} (93%) rename test/{outputFile.js => outputFile.ts} (84%) rename test/{outputFileAtomic.js => outputFileAtomic.ts} (80%) rename test/{outputJSON.js => outputJSON.ts} (86%) rename test/{outputJSONAtomic.js => outputJSONAtomic.ts} (83%) rename test/{pathExists.js => pathExists.ts} (73%) rename test/{readJSON.js => readJSON.ts} (75%) rename test/{remove.js => remove.ts} (75%) rename test/{scan.js => scan.ts} (89%) rename test/{symlinkAtomic.js => symlinkAtomic.ts} (75%) rename test/{writeFileAtomic.js => writeFileAtomic.ts} (75%) rename test/{writeJSON.js => writeJSON.ts} (83%) rename test/{writeJSONAtomic.js => writeJSONAtomic.ts} (77%) diff --git a/package.json b/package.json index dad392d0..cc5a78a3 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,17 @@ { "name": "fs-nextra", - "version": "0.4.0", + "version": "0.4.1", "description": "Node.js native fs promises with next-generation extra methods.", "main": "dist/index.js", "scripts": { - "build": "npx tsc", - "test": "npm run build && npx ava test/*.js", - "test:lint": "npx eslint test && npx tslint 'src/*.ts'", - "test:coverage": "npm run coverage && npx nyc check-coverage --lines 60 --functions 60 --branches 60", + "build": "tsc", + "test": "yarn build && ava test/*.ts", + "test:lint": "tslint '{test,src}/**/*.ts'", + "test:coverage": "yarn coverage && nyc check-coverage --lines 60 --functions 60 --branches 60", "coverage": "npx nyc npm test", "coveralls": "npx nyc report --reporter=text-lcov | npx coveralls", - "docs": "npx typedoc --mode file --out ./docs/ ./src/", - "lint": "npx eslint --fix test && npx tslint --fix 'src/*.ts'" + "docs": "typedoc --mode file --out ./docs/ ./src/", + "lint": "tslint --fix '{test,src}/**/*.ts'" }, "keywords": [ "atomics", @@ -42,11 +42,21 @@ "eslint-config-klasa": "github:dirigeants/klasa-lint", "nyc": "^13.0.1", "tslint": "^5.7.0", + "ts-node": "8.0.2", "typedoc": "^0.14.2", "typescript": "^3.0.1" }, "repository": { "type": "git", "url": "https://github.com/bdistin/fs-nextra" + }, + "ava": { + "compileEnhancements": false, + "extensions": [ + "ts" + ], + "require": [ + "ts-node/register" + ] } } diff --git a/scripts/.travis-coverage.sh b/scripts/.travis-coverage.sh index cac461c4..4e922e6f 100644 --- a/scripts/.travis-coverage.sh +++ b/scripts/.travis-coverage.sh @@ -4,12 +4,12 @@ set -e # For Node != 8, do nothing if [ "$TRAVIS_NODE_VERSION" != "10" ]; then echo -e "Build triggered with Node v${TRAVIS_NODE_VERSION} - testing without reporting." - npm run test:coverage + yarn run test:coverage exit 0 fi echo -e "Build triggered with Node v${TRAVIS_NODE_VERSION} - testing and reporting coverage." -npm run test:coverage +yarn run test:coverage -npm run coveralls +yarn run coveralls diff --git a/scripts/.travis-deploy.sh b/scripts/.travis-deploy.sh index 5af87dce..c1b010f6 100644 --- a/scripts/.travis-deploy.sh +++ b/scripts/.travis-deploy.sh @@ -5,7 +5,7 @@ set -e if [ "$TRAVIS_BRANCH" != "master" -o -n "$TRAVIS_TAG" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then echo -e "Not building for a non master branch push - building without deploying." - npm run docs + yarn run docs exit 0 fi @@ -17,7 +17,7 @@ SHA=$(git rev-parse --verify HEAD) TARGET_BRANCH="gh-pages" git clone $REPO dist -b $TARGET_BRANCH -npm run docs +yarn run docs rsync -vau docs/ dist/ diff --git a/src/nextra/createSymlink.ts b/src/nextra/createSymlink.ts index f9a01bf5..5d1dabeb 100644 --- a/src/nextra/createSymlink.ts +++ b/src/nextra/createSymlink.ts @@ -39,7 +39,7 @@ interface SymLinkPaths { * @param type The type of symlink you are creating * @param atomic Whether the operation should run atomically */ -export default async function createSymlink(source: string, destination: string, type?: SymLinkType, atomic: boolean = false): Promise { +export default async function createSymlink(source: string, destination: string, type?: SymLinkType | boolean, atomic: boolean = false): Promise { if (await pathExists(destination)) return; if (typeof type === 'boolean') [atomic, type] = [type, undefined]; @@ -47,7 +47,7 @@ export default async function createSymlink(source: string, destination: string, const relativePath = await symlinkPaths(source, destination); const symlinkMethod = atomic ? symlinkAtomic : symlink; - await symlinkMethod(relativePath.toDst, destination, type || await symlinkType(relativePath.toCwd)); + await symlinkMethod(relativePath.toDst, destination, type as SymLinkType || await symlinkType(relativePath.toCwd)); } const symlinkPaths = async (srcpath: string, dstPath: string): Promise => { diff --git a/src/nextra/mkdirs.ts b/src/nextra/mkdirs.ts index cca7e942..daf99dcc 100644 --- a/src/nextra/mkdirs.ts +++ b/src/nextra/mkdirs.ts @@ -59,7 +59,7 @@ export default async function mkdirs(path: string, options?: MkdirsOptions | num if (myStat.isDirectory()) return; throw err; } -}; +} const resolveOptions = (options: MkdirsOptions | number = {}): MkdirsOptions => { return { diff --git a/src/nextra/outputFile.ts b/src/nextra/outputFile.ts index 84304ce1..019f09fb 100644 --- a/src/nextra/outputFile.ts +++ b/src/nextra/outputFile.ts @@ -14,7 +14,7 @@ import mkdirs from './mkdirs'; * @param options The write options or the encoding string. * @param atomic {description} */ -export default async function outputFile(file: string, data: string | Buffer | Uint8Array, options?: WriteOptions | string, atomic: boolean = false): Promise { +export default async function outputFile(file: string, data: string | Buffer | Uint8Array, options?: WriteOptions | string | boolean, atomic: boolean = false): Promise { if (typeof options === 'boolean') [atomic, options] = [options, {}]; await mkdirs(dirname(file)); diff --git a/src/nextra/outputJSON.ts b/src/nextra/outputJSON.ts index 308a7768..8c65373c 100644 --- a/src/nextra/outputJSON.ts +++ b/src/nextra/outputJSON.ts @@ -22,7 +22,7 @@ import mkdirs from './mkdirs'; * @param options The write options or the encoding string. * @param atomic If the operation should be done atomically */ -export default async function outputJSON(file: string, data: any, options?: JsonOptions, atomic: boolean = false): Promise { +export default async function outputJSON(file: string, data: any, options?: JsonOptions | boolean, atomic: boolean = false): Promise { if (typeof options === 'boolean') [atomic, options] = [options, {}]; await mkdirs(dirname(file)); diff --git a/src/nextra/remove.ts b/src/nextra/remove.ts index 4e6ac380..7e764bc7 100644 --- a/src/nextra/remove.ts +++ b/src/nextra/remove.ts @@ -20,7 +20,6 @@ interface RemoveOptions { * @param options The remove options */ export default async function remove(path: string, options: RemoveOptions = {}): Promise { - if (typeof path !== 'string') throw new Error('FS-NEXTRA: Path should be a string'); options.maxBusyTries = typeof options.maxBusyTries === 'undefined' ? 3 : options.maxBusyTries; for (let buysTries = 0; buysTries < options.maxBusyTries; buysTries++) { diff --git a/src/nextra/writeJSON.ts b/src/nextra/writeJSON.ts index 31487528..09f939b5 100644 --- a/src/nextra/writeJSON.ts +++ b/src/nextra/writeJSON.ts @@ -39,7 +39,7 @@ export interface JsonOptions { * @param {boolean} [atomic = false] Whether the operation should run atomically * @returns {Promise} */ -export default async function writeJSON(file: string, object: any, options: JsonOptions = {}, atomic: boolean = false) { +export default async function writeJSON(file: string, object: any, options: JsonOptions | boolean = {}, atomic: boolean = false) { if (typeof options === 'boolean') [atomic, options] = [options, {}]; const writeMethod = atomic ? writeFileAtomic : writeFile; diff --git a/test/copy.js b/test/copy.ts similarity index 94% rename from test/copy.js rename to test/copy.ts index 0a10f712..e3b3e117 100644 --- a/test/copy.js +++ b/test/copy.ts @@ -1,8 +1,8 @@ -const ava = require('ava'); -const { join, basename } = require('path'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc, tempDir, tempDirLoc, tempSymlink } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { join, basename } from 'path'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc, tempDir, tempDirLoc, tempSymlink } from './lib'; +import * as nextra from '../dist'; // #region Success diff --git a/test/copyFileAtomic.js b/test/copyFileAtomic.ts similarity index 61% rename from test/copyFileAtomic.js rename to test/copyFileAtomic.ts index 1cb3774b..d3e6542b 100644 --- a/test/copyFileAtomic.js +++ b/test/copyFileAtomic.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc } from './lib'; +import * as nextra from '../dist'; ava('Standard Usage', async test => { test.plan(2); diff --git a/test/createFile.js b/test/createFile.ts similarity index 85% rename from test/createFile.js rename to test/createFile.ts index 1ac61d88..c1bb3476 100644 --- a/test/createFile.js +++ b/test/createFile.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('New File (Standard Usage)', async test => { test.plan(2); diff --git a/test/createFileAtomic.js b/test/createFileAtomic.ts similarity index 81% rename from test/createFileAtomic.js rename to test/createFileAtomic.ts index c0a5285e..0ead45bc 100644 --- a/test/createFileAtomic.js +++ b/test/createFileAtomic.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('New File (Standard Usage)', async test => { test.plan(2); diff --git a/test/createFileCopy.js b/test/createFileCopy.ts similarity index 87% rename from test/createFileCopy.js rename to test/createFileCopy.ts index b80e43d7..936aa591 100644 --- a/test/createFileCopy.js +++ b/test/createFileCopy.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempDir, tempFileLoc, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempDir, tempFileLoc, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('New File (Standard Usage)', async test => { test.plan(2); diff --git a/test/createFileCopyAtomic.js b/test/createFileCopyAtomic.ts similarity index 83% rename from test/createFileCopyAtomic.js rename to test/createFileCopyAtomic.ts index 28309d8e..888f92fe 100644 --- a/test/createFileCopyAtomic.js +++ b/test/createFileCopyAtomic.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('New File (Standard Usage)', async test => { test.plan(2); diff --git a/test/createLink.js b/test/createLink.ts similarity index 86% rename from test/createLink.js rename to test/createLink.ts index b8c37687..6b5b853e 100644 --- a/test/createLink.js +++ b/test/createLink.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('New File (Standard Usage)', async test => { test.plan(2); diff --git a/test/createLinkAtomic.js b/test/createLinkAtomic.ts similarity index 83% rename from test/createLinkAtomic.js rename to test/createLinkAtomic.ts index 6815afe4..10e492a9 100644 --- a/test/createLinkAtomic.js +++ b/test/createLinkAtomic.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('New File (Standard Usage)', async test => { test.plan(2); diff --git a/test/createSymlink.js b/test/createSymlink.ts similarity index 88% rename from test/createSymlink.js rename to test/createSymlink.ts index 9b1e1d78..58acc44f 100644 --- a/test/createSymlink.js +++ b/test/createSymlink.ts @@ -1,8 +1,8 @@ -const ava = require('ava'); -const { relative } = require('path'); -const { promises: fs } = require('fs'); -const { tempFile, tempDir, tempSymlink, tempFileLoc, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { relative } from 'path'; +import { promises as fs } from 'fs'; +import { tempFile, tempDir, tempSymlink, tempFileLoc, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('New File (Standard Usage)', async test => { test.plan(2); @@ -55,7 +55,7 @@ ava('New File w/ Non-Existent Directories', async test => { ava('Relative Source', async test => { test.plan(2); - const file = './test/createSymlink.js'; + const file = './test/createSymlink.ts'; const newFile = tempFileLoc(); const retVal = await nextra.createSymlink(file, newFile); const stats = await fs.lstat(newFile); diff --git a/test/createSymlinkAtomic.js b/test/createSymlinkAtomic.ts similarity index 83% rename from test/createSymlinkAtomic.js rename to test/createSymlinkAtomic.ts index ab352c3c..d94bd8b8 100644 --- a/test/createSymlinkAtomic.js +++ b/test/createSymlinkAtomic.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempSymlink, tempFileLoc, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempSymlink, tempFileLoc, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('New File (Standard Usage)', async test => { test.plan(2); diff --git a/test/emptyDir.js b/test/emptyDir.ts similarity index 81% rename from test/emptyDir.js rename to test/emptyDir.ts index 5f4e885c..aa1ceeee 100644 --- a/test/emptyDir.js +++ b/test/emptyDir.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempDir, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempDir, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('Non-Existent', async test => { test.plan(2); diff --git a/test/lib/index.js b/test/lib/index.js deleted file mode 100644 index 1c2fdaf6..00000000 --- a/test/lib/index.js +++ /dev/null @@ -1,33 +0,0 @@ -const { tmpdir } = require('os'); -const { randomBytes } = require('crypto'); -const { join } = require('path'); -const fs = require('fs'); - -exports.uuid = () => { - const id = randomBytes(32).toString('hex'); - return (Array(32).join(0) + id).slice(-32).replace(/^.{8}|.{4}(?!$)/g, '$&-'); -}; - -exports.dir = tmpdir(); - -exports.tempFile = dir => { - const path = this.tempFileLoc(dir); - fs.writeFileSync(path, ''); - return path; -}; - -exports.tempDir = dir => { - const path = this.tempDirLoc(dir); - fs.mkdirSync(path); - return path; -}; - -exports.tempSymlink = dir => { - const path = this.tempFileLoc(dir); - fs.symlinkSync(this.tempFile(), path); - return path; -}; - -exports.tempFileLoc = (dir = this.dir) => join(dir, `${this.uuid()}.txt`); - -exports.tempDirLoc = (dir = this.dir) => join(dir, this.uuid()); diff --git a/test/lib/index.ts b/test/lib/index.ts new file mode 100644 index 00000000..05b5e103 --- /dev/null +++ b/test/lib/index.ts @@ -0,0 +1,33 @@ +import { tmpdir } from 'os'; +import { randomBytes } from 'crypto'; +import { join } from 'path'; +import * as fs from 'fs'; + +export const uuid = (): string => { + const id = randomBytes(32).toString('hex'); + return (Array(32).join('0') + id).slice(-32).replace(/^.{8}|.{4}(?!$)/g, '$&-'); +}; + +export const dir = tmpdir(); + +export const tempFile = (directory?: string): string => { + const path = tempFileLoc(directory); + fs.writeFileSync(path, ''); + return path; +}; + +export const tempDir = (directory?: string): string => { + const path = tempDirLoc(directory); + fs.mkdirSync(path); + return path; +}; + +export const tempSymlink = (directory?: string): string => { + const path = tempFileLoc(directory); + fs.symlinkSync(tempFile(), path); + return path; +}; + +export const tempFileLoc = (directory: string = dir): string => join(directory, `${uuid()}.txt`); + +export const tempDirLoc = (directory: string = dir): string => join(directory, uuid()); diff --git a/test/linkAtomic.js b/test/linkAtomic.ts similarity index 61% rename from test/linkAtomic.js rename to test/linkAtomic.ts index d0ca989c..12ec8997 100644 --- a/test/linkAtomic.js +++ b/test/linkAtomic.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc } from './lib'; +import * as nextra from '../dist'; ava('Standard Usage', async test => { test.plan(2); diff --git a/test/mkdirs.js b/test/mkdirs.ts similarity index 88% rename from test/mkdirs.js rename to test/mkdirs.ts index cc1a1fe0..10bd2e28 100644 --- a/test/mkdirs.js +++ b/test/mkdirs.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempDirLoc, tempDir, tempFile } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempDirLoc, tempDir, tempFile } from './lib'; +import * as nextra from '../dist'; ava('Pre-Existing Directory', async test => { test.plan(2); diff --git a/test/move.js b/test/move.ts similarity index 93% rename from test/move.js rename to test/move.ts index fa0c6a85..bda314ce 100644 --- a/test/move.js +++ b/test/move.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFileLoc, tempDirLoc, tempFile, tempDir } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFileLoc, tempDirLoc, tempFile, tempDir } from './lib'; +import * as nextra from '../dist'; // #region Success diff --git a/test/outputFile.js b/test/outputFile.ts similarity index 84% rename from test/outputFile.js rename to test/outputFile.ts index 9cc8ce7c..6922f8ad 100644 --- a/test/outputFile.js +++ b/test/outputFile.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('Pre-Existing', async test => { test.plan(2); diff --git a/test/outputFileAtomic.js b/test/outputFileAtomic.ts similarity index 80% rename from test/outputFileAtomic.js rename to test/outputFileAtomic.ts index dd2d59e1..2a97464d 100644 --- a/test/outputFileAtomic.js +++ b/test/outputFileAtomic.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('Pre-Existing', async test => { test.plan(2); diff --git a/test/outputJSON.js b/test/outputJSON.ts similarity index 86% rename from test/outputJSON.js rename to test/outputJSON.ts index ba31aa70..a0b87317 100644 --- a/test/outputJSON.js +++ b/test/outputJSON.ts @@ -1,7 +1,8 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); + +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('Pre-Existing', async test => { test.plan(2); diff --git a/test/outputJSONAtomic.js b/test/outputJSONAtomic.ts similarity index 83% rename from test/outputJSONAtomic.js rename to test/outputJSONAtomic.ts index b4f6bd0b..156af021 100644 --- a/test/outputJSONAtomic.js +++ b/test/outputJSONAtomic.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('Pre-Existing', async test => { test.plan(2); diff --git a/test/pathExists.js b/test/pathExists.ts similarity index 73% rename from test/pathExists.js rename to test/pathExists.ts index ae5d909c..5b3074d5 100644 --- a/test/pathExists.js +++ b/test/pathExists.ts @@ -1,6 +1,6 @@ -const ava = require('ava'); -const { tempFile, tempFileLoc, tempDir, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { tempFile, tempFileLoc, tempDir, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('File Exists', async test => { test.true(await nextra.pathExists(tempFile())); diff --git a/test/readJSON.js b/test/readJSON.ts similarity index 75% rename from test/readJSON.js rename to test/readJSON.ts index 6ff85245..0115c6f2 100644 --- a/test/readJSON.js +++ b/test/readJSON.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFileLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFileLoc } from './lib'; +import * as nextra from '../dist'; ava('Standard Usage', async test => { const file = tempFileLoc(); diff --git a/test/remove.js b/test/remove.ts similarity index 75% rename from test/remove.js rename to test/remove.ts index 3be6e078..2badc6e3 100644 --- a/test/remove.js +++ b/test/remove.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc, tempDir, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc, tempDir, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('File', async test => { test.plan(2); @@ -41,7 +41,3 @@ ava('Non-Existent File', async test => { ava('Non-Existent Directory', async test => { await test.notThrowsAsync(nextra.remove(tempDirLoc())); }); - -ava('Bad Input', async test => { - await test.throwsAsync(nextra.remove({})); -}); diff --git a/test/scan.js b/test/scan.ts similarity index 89% rename from test/scan.js rename to test/scan.ts index 1868cce1..527f1133 100644 --- a/test/scan.js +++ b/test/scan.ts @@ -1,6 +1,6 @@ -const ava = require('ava'); -const { tempFile, tempFileLoc, tempDir, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { tempFile, tempFileLoc, tempDir, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('File', async test => { const file = tempFile(); diff --git a/test/symlinkAtomic.js b/test/symlinkAtomic.ts similarity index 75% rename from test/symlinkAtomic.js rename to test/symlinkAtomic.ts index f822fd35..58307bab 100644 --- a/test/symlinkAtomic.js +++ b/test/symlinkAtomic.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc, tempDir, tempDirLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc, tempDir, tempDirLoc } from './lib'; +import * as nextra from '../dist'; ava('File', async test => { test.plan(2); diff --git a/test/writeFileAtomic.js b/test/writeFileAtomic.ts similarity index 75% rename from test/writeFileAtomic.js rename to test/writeFileAtomic.ts index 6ea161e7..22c3bfd9 100644 --- a/test/writeFileAtomic.js +++ b/test/writeFileAtomic.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc } from './lib'; +import * as nextra from '../dist'; ava('Existing', async test => { test.plan(2); diff --git a/test/writeJSON.js b/test/writeJSON.ts similarity index 83% rename from test/writeJSON.js rename to test/writeJSON.ts index fe79589b..0bc98ea8 100644 --- a/test/writeJSON.js +++ b/test/writeJSON.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc } from './lib'; +import * as nextra from '../dist'; ava('Standard Usage', async test => { test.plan(2); diff --git a/test/writeJSONAtomic.js b/test/writeJSONAtomic.ts similarity index 77% rename from test/writeJSONAtomic.js rename to test/writeJSONAtomic.ts index f2487e47..99a8aabd 100644 --- a/test/writeJSONAtomic.js +++ b/test/writeJSONAtomic.ts @@ -1,7 +1,7 @@ -const ava = require('ava'); -const { promises: fs } = require('fs'); -const { tempFile, tempFileLoc } = require('./lib'); -const nextra = require('../dist'); +import ava from 'ava'; +import { promises as fs } from 'fs'; +import { tempFile, tempFileLoc } from './lib'; +import * as nextra from '../dist'; ava('Standard Usage', async test => { test.plan(2); diff --git a/yarn.lock b/yarn.lock index 7f971a46..79497d4c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -358,10 +358,19 @@ acorn-jsx@^5.0.0: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" acorn@^6.0.2: - version "6.0.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.4.tgz#77377e7353b72ec5104550aa2d2097a2fd40b754" + version "6.1.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.0.tgz#b0a3be31752c97a0f7013c5f4903b71a05db6818" + +ajv@^6.5.3, ajv@^6.9.1: + version "6.9.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.9.1.tgz#a4d3683d74abc5670e75f0b16520f70a20ea8dc1" + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" -ajv@^6.5.3, ajv@^6.5.5, ajv@^6.6.1: +ajv@^6.5.5: version "6.6.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.2.tgz#caceccf474bf3fc3ce3b147443711a24063cc30d" dependencies: @@ -376,10 +385,14 @@ ansi-align@^2.0.0: dependencies: string-width "^2.0.0" -ansi-escapes@^3.0.0, ansi-escapes@^3.1.0: +ansi-escapes@^3.1.0: version "3.1.0" resolved "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -430,6 +443,10 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" +arg@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.0.tgz#583c518199419e0037abb74062c37f8519e575f0" + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1150,7 +1167,7 @@ detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" -diff@^3.2.0: +diff@^3.1.0, diff@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" @@ -1188,6 +1205,10 @@ emittery@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.4.1.tgz#abe9d3297389ba424ac87e53d1c701962ce7433d" +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + empower-core@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/empower-core/-/empower-core-1.2.0.tgz#ce3fb2484d5187fa29c23fba8344b0b2fdf5601c" @@ -1383,7 +1404,7 @@ extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" -external-editor@^3.0.0: +external-editor@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" dependencies: @@ -1602,10 +1623,14 @@ global-dirs@^0.1.0: dependencies: ini "^1.3.4" -globals@^11.1.0, globals@^11.7.0: +globals@^11.1.0: version "11.9.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.9.0.tgz#bde236808e987f290768a93d065060d78e6ab249" +globals@^11.7.0: + version "11.10.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.10.0.tgz#1e09776dffda5e01816b3bb4077c8b59c24eaa50" + globby@^6.1.0: version "6.1.0" resolved "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" @@ -1811,19 +1836,19 @@ ini@^1.3.4, ini@~1.3.0: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" inquirer@^6.1.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.1.tgz#9943fc4882161bdb0b0c9276769c75b32dbfcd52" + version "6.2.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.2.tgz#46941176f65c9eb20804627149b743a218f25406" dependencies: - ansi-escapes "^3.0.0" - chalk "^2.0.0" + ansi-escapes "^3.2.0" + chalk "^2.4.2" cli-cursor "^2.1.0" cli-width "^2.0.0" - external-editor "^3.0.0" + external-editor "^3.0.3" figures "^2.0.0" - lodash "^4.17.10" + lodash "^4.17.11" mute-stream "0.0.7" run-async "^2.2.0" - rxjs "^6.1.0" + rxjs "^6.4.0" string-width "^2.1.0" strip-ansi "^5.0.0" through "^2.3.6" @@ -2123,13 +2148,20 @@ js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" -js-yaml@^3.10.0, js-yaml@^3.11.0, js-yaml@^3.12.0, js-yaml@^3.7.0: +js-yaml@^3.10.0, js-yaml@^3.11.0, js-yaml@^3.7.0: version "3.12.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" dependencies: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^3.12.0: + version "3.12.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.1.tgz#295c8632a18a23e054cf5c9d3cecafe678167600" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -2323,6 +2355,10 @@ make-dir@^1.0.0, make-dir@^1.3.0: dependencies: pify "^3.0.0" +make-error@^1.1.1: + version "1.3.5" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" + map-age-cleaner@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" @@ -3172,9 +3208,9 @@ run-async@^2.2.0: dependencies: is-promise "^2.1.0" -rxjs@^6.1.0: - version "6.3.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz#3c6a7fa420e844a81390fb1158a9ec614f4bad55" +rxjs@^6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.4.0.tgz#f3bb0fe7bda7fb69deac0c16f17b50b0b8790504" dependencies: tslib "^1.9.0" @@ -3262,20 +3298,20 @@ slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" -slice-ansi@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.0.0.tgz#5373bdb8559b45676e8541c66916cdd6251612e7" - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - slice-ansi@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" dependencies: is-fullwidth-code-point "^2.0.0" +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + slide@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" @@ -3317,7 +3353,7 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.10: +source-map-support@^0.5.10, source-map-support@^0.5.6: version "0.5.10" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c" dependencies: @@ -3419,6 +3455,14 @@ string-width@^1.0.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.0.0.tgz#5a1690a57cc78211fffd9bf24bbe24d090604eb1" + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.0.0" + string_decoder@~1.1.1: version "1.1.1" resolved "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -3500,13 +3544,13 @@ symbol-observable@^1.0.4, symbol-observable@^1.1.0: resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" table@^5.0.2: - version "5.1.1" - resolved "https://registry.yarnpkg.com/table/-/table-5.1.1.tgz#92030192f1b7b51b6eeab23ed416862e47b70837" + version "5.2.3" + resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2" dependencies: - ajv "^6.6.1" + ajv "^6.9.1" lodash "^4.17.11" - slice-ansi "2.0.0" - string-width "^2.1.1" + slice-ansi "^2.1.0" + string-width "^3.0.0" tar@^4: version "4.4.8" @@ -3541,7 +3585,7 @@ text-table@^0.2.0: through@^2.3.6: version "2.3.8" - resolved "http://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" time-zone@^1.0.0: version "1.0.0" @@ -3602,6 +3646,16 @@ trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" +ts-node@8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.0.2.tgz#9ecdf8d782a0ca4c80d1d641cbb236af4ac1b756" + dependencies: + arg "^4.1.0" + diff "^3.1.0" + make-error "^1.1.1" + source-map-support "^0.5.6" + yn "^3.0.0" + tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" @@ -3931,3 +3985,7 @@ yargs@^12.0.5: which-module "^2.0.0" y18n "^3.2.1 || ^4.0.0" yargs-parser "^11.1.1" + +yn@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.0.0.tgz#0073c6b56e92aed652fbdfd62431f2d6b9a7a091"