Skip to content

Commit

Permalink
chore: replace mkdirp with make-dir (#9486)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jan 31, 2020
1 parent 28f6da4 commit cd6f755
Show file tree
Hide file tree
Showing 11 changed files with 341 additions and 292 deletions.
Empty file removed jest-worker
Empty file.
16 changes: 0 additions & 16 deletions jsconfig.json

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -59,8 +59,8 @@
"karma-mocha": "^1.3.0",
"karma-webpack": "^4.0.2",
"lerna": "3.20.2",
"make-dir": "^3.0.0",
"micromatch": "^4.0.2",
"mkdirp": "^0.5.1",
"mocha": "^7.0.0",
"mock-fs": "^4.4.1",
"opencollective": "^1.0.3",
Expand All @@ -69,7 +69,7 @@
"progress": "^2.0.0",
"promise": "^8.0.2",
"realpath-native": "^2.0.0",
"resolve": "^1.4.0",
"resolve": "^1.15.0",
"rimraf": "^3.0.0",
"slash": "^3.0.0",
"string-length": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-reporters/package.json
Expand Up @@ -34,7 +34,7 @@
"@types/glob": "^7.1.1",
"@types/istanbul-lib-coverage": "^2.0.0",
"@types/istanbul-lib-instrument": "^1.7.2",
"@types/istanbul-lib-report": "^1.1.0",
"@types/istanbul-lib-report": "^3.0.0",
"@types/istanbul-lib-source-maps": "^1.2.1",
"@types/istanbul-reports": "^1.1.0",
"@types/node-notifier": "^5.4.0",
Expand Down
17 changes: 9 additions & 8 deletions packages/jest-reporters/src/coverage_reporter.ts
Expand Up @@ -492,7 +492,6 @@ export default class CoverageReporter extends BaseReporter {
transformedCoverage.forEach(res => map.merge(res));

const reportContext = istanbulReport.createContext({
// @ts-ignore
coverageMap: map,
dir: this._globalConfig.coverageDirectory,
watermarks: getWatermarks(this._globalConfig),
Expand All @@ -502,14 +501,16 @@ export default class CoverageReporter extends BaseReporter {
}

const map = await this._sourceMapStore.transformCoverage(this._coverageMap);
const reportContext = istanbulReport.createContext({
// @ts-ignore
coverageMap: map,
dir: this._globalConfig.coverageDirectory,
const reportContext = istanbulReport.createContext(
// @ts-ignore
sourceFinder: this._sourceMapStore.sourceFinder,
watermarks: getWatermarks(this._globalConfig),
});
{
coverageMap: map,
dir: this._globalConfig.coverageDirectory,
// @ts-ignore
sourceFinder: this._sourceMapStore.sourceFinder,
watermarks: getWatermarks(this._globalConfig),
},
);

// @ts-ignore
return {map, reportContext};
Expand Down
3 changes: 1 addition & 2 deletions packages/jest-snapshot/package.json
Expand Up @@ -19,14 +19,13 @@
"jest-matcher-utils": "^25.1.0",
"jest-message-util": "^25.1.0",
"jest-resolve": "^25.1.0",
"mkdirp": "^0.5.1",
"make-dir": "^3.0.0",
"natural-compare": "^1.4.0",
"pretty-format": "^25.1.0",
"semver": "^6.3.0"
},
"devDependencies": {
"@babel/traverse": "^7.3.4",
"@types/mkdirp": "^0.5.2",
"@types/natural-compare": "^1.4.0",
"@types/prettier": "^1.16.1",
"@types/semver": "^6.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-snapshot/src/utils.ts
Expand Up @@ -7,7 +7,7 @@

import * as fs from 'fs';
import * as path from 'path';
import {sync as mkdirp} from 'mkdirp';
import makeDir = require('make-dir');
import naturalCompare = require('natural-compare');
import chalk = require('chalk');
import {Config} from '@jest/types';
Expand Down Expand Up @@ -183,7 +183,7 @@ const printBacktickString = (str: string): string =>

export const ensureDirectoryExists = (filePath: Config.Path) => {
try {
mkdirp(path.join(path.dirname(filePath)), '777');
makeDir.sync(path.join(path.dirname(filePath)));
} catch (e) {}
};

Expand Down
5 changes: 2 additions & 3 deletions packages/jest-util/package.json
Expand Up @@ -13,12 +13,11 @@
"@jest/types": "^25.1.0",
"chalk": "^3.0.0",
"is-ci": "^2.0.0",
"mkdirp": "^0.5.1"
"make-dir": "^3.0.0"
},
"devDependencies": {
"@types/graceful-fs": "^4.1.2",
"@types/is-ci": "^2.0.0",
"@types/mkdirp": "^0.5.2"
"@types/is-ci": "^2.0.0"
},
"engines": {
"node": ">= 8.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-util/src/createDirectory.ts
Expand Up @@ -5,12 +5,12 @@
* LICENSE file in the root directory of this source tree.
*/

import {sync as mkdirp} from 'mkdirp';
import makeDir = require('make-dir');
import {Config} from '@jest/types';

export default function createDirectory(path: Config.Path) {
try {
mkdirp(path, '777');
makeDir.sync(path);
} catch (e) {
if (e.code !== 'EEXIST') {
throw e;
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.js
Expand Up @@ -23,7 +23,7 @@
const fs = require('fs');
const path = require('path');
const glob = require('glob');
const mkdirp = require('mkdirp');
const makeDir = require('make-dir');

const babel = require('@babel/core');
const chalk = require('chalk');
Expand Down Expand Up @@ -118,7 +118,7 @@ function buildFile(file, silent) {
return;
}

mkdirp.sync(path.dirname(destPath), '777');
makeDir.sync(path.dirname(destPath));
if (
!micromatch.isMatch(file, JS_FILES_PATTERN) &&
!micromatch.isMatch(file, TS_FILES_PATTERN)
Expand Down

0 comments on commit cd6f755

Please sign in to comment.