remove dep on `mkdirp` (#1253)

There's no need for us to depend on `mkdirp`, because the `fs-extra`
module already has `fs.mkdirp` and `fs.mkdirpSync`. This commit removes
the dep from our `package.json`, and removes all explicit imports of it.

Test plan: `yarn test --full` passes. `git grep "import mkdirp"` has no
hits.
This commit is contained in:
Dandelion Mané 2019-07-23 00:28:49 +01:00 committed by GitHub
parent d0660c9366
commit 37b39a7e0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 9 deletions

View File

@ -23,7 +23,6 @@
"lodash.clonedeep": "^4.5.0", "lodash.clonedeep": "^4.5.0",
"lodash.isequal": "^4.5.0", "lodash.isequal": "^4.5.0",
"lodash.sortby": "^4.7.0", "lodash.sortby": "^4.7.0",
"mkdirp": "^0.5.1",
"object-assign": "4.1.1", "object-assign": "4.1.1",
"pako": "^1.0.6", "pako": "^1.0.6",
"promise": "8.0.3", "promise": "8.0.3",

View File

@ -1,7 +1,6 @@
// @flow // @flow
// Implementation of `sourcecred load`. // Implementation of `sourcecred load`.
import mkdirp from "mkdirp";
import path from "path"; import path from "path";
import chalk from "chalk"; import chalk from "chalk";
@ -303,7 +302,7 @@ export const loadIndividualPlugin = async (
repoIdToString(output), repoIdToString(output),
plugin plugin
); );
mkdirp.sync(directory); fs.mkdirpSync(directory);
return directory; return directory;
} }
const outputDirectory = scopedDirectory("data"); const outputDirectory = scopedDirectory("data");

View File

@ -1,7 +1,7 @@
// @flow // @flow
import mkdirp from "mkdirp";
import tmp from "tmp"; import tmp from "tmp";
import fs from "fs-extra";
import {makeUtils} from "../gitUtils"; import {makeUtils} from "../gitUtils";
import type {Hash} from "../types"; import type {Hash} from "../types";
@ -31,7 +31,7 @@ export const SUBMODULE_COMMIT_2: Hash =
*/ */
export function createExampleRepo(intoDirectory: string): RepositoryInfo { export function createExampleRepo(intoDirectory: string): RepositoryInfo {
const repositoryPath = intoDirectory; const repositoryPath = intoDirectory;
mkdirp(repositoryPath); fs.mkdirpSync(repositoryPath);
const git = makeUtils(repositoryPath); const git = makeUtils(repositoryPath);
const commits = []; const commits = [];
function commit(message) { function commit(message) {
@ -112,7 +112,7 @@ export function createExampleSubmoduleRepo(
intoDirectory: string intoDirectory: string
): RepositoryInfo { ): RepositoryInfo {
const repositoryPath = intoDirectory; const repositoryPath = intoDirectory;
mkdirp(repositoryPath); fs.mkdirpSync(repositoryPath);
const git = makeUtils(repositoryPath); const git = makeUtils(repositoryPath);
const commits = []; const commits = [];
function commit(message) { function commit(message) {

View File

@ -1,8 +1,7 @@
// @flow // @flow
import {execFileSync} from "child_process"; import {execFileSync} from "child_process";
import fs from "fs"; import fs from "fs-extra";
import mkdirp from "mkdirp";
import path from "path"; import path from "path";
export interface Utils { export interface Utils {
@ -62,7 +61,7 @@ export function makeUtils(repositoryPath: string): Utils {
writeAndStage(filename: string, contents: string) { writeAndStage(filename: string, contents: string) {
const filepath = path.join(repositoryPath, filename); const filepath = path.join(repositoryPath, filename);
const dirpath = path.join(repositoryPath, path.dirname(filename)); const dirpath = path.join(repositoryPath, path.dirname(filename));
mkdirp.sync(dirpath); fs.mkdirpSync(dirpath);
fs.writeFileSync(filepath, contents); fs.writeFileSync(filepath, contents);
git(["add", filename]); git(["add", filename]);
}, },