Skip to content

Commit

Permalink
chore: remove output-file-sync dependency (#10619)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung authored and existentialism committed Oct 31, 2019
1 parent 0b0edc3 commit a2b5437
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
1 change: 0 additions & 1 deletion packages/babel-cli/package.json
Expand Up @@ -25,7 +25,6 @@
"glob": "^7.0.0",
"lodash": "^4.17.13",
"make-dir": "^2.1.0",
"output-file-sync": "^2.0.0",
"slash": "^2.0.0",
"source-map": "^0.5.0"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-cli/src/babel/dir.js
@@ -1,7 +1,6 @@
// @flow

import defaults from "lodash/defaults";
import outputFileSync from "output-file-sync";
import { sync as makeDirSync } from "make-dir";
import slash from "slash";
import path from "path";
Expand All @@ -10,6 +9,11 @@ import fs from "fs";
import * as util from "./util";
import { type CmdOptions } from "./options";

function outputFileSync(filePath: string, data: string | Buffer): void {
makeDirSync(path.dirname(filePath));
fs.writeFileSync(filePath, data);
}

export default async function({
cliOptions,
babelOptions,
Expand Down
7 changes: 6 additions & 1 deletion packages/babel-cli/test/index.js
@@ -1,7 +1,7 @@
const readdir = require("fs-readdir-recursive");
const helper = require("@babel/helper-fixtures");
const rimraf = require("rimraf");
const outputFileSync = require("output-file-sync");
const { sync: makeDirSync } = require("make-dir");
const child = require("child_process");
const merge = require("lodash/merge");
const path = require("path");
Expand All @@ -14,6 +14,11 @@ const fileFilter = function(x) {
return x !== ".DS_Store";
};

const outputFileSync = function(filePath, data) {
makeDirSync(path.dirname(filePath));
fs.writeFileSync(filePath, data);
};

const presetLocs = [path.join(__dirname, "../../babel-preset-react")];

const pluginLocs = [
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-node/package.json
Expand Up @@ -34,7 +34,7 @@
"@babel/core": "^7.6.3",
"@babel/helper-fixtures": "^7.6.3",
"fs-readdir-recursive": "^1.0.0",
"output-file-sync": "^2.0.0"
"make-dir": "^2.1.0"
},
"bin": {
"babel-node": "./bin/babel-node.js"
Expand Down
7 changes: 6 additions & 1 deletion packages/babel-node/test/index.js
Expand Up @@ -2,7 +2,7 @@ const includes = require("lodash/includes");
const readdir = require("fs-readdir-recursive");
const helper = require("@babel/helper-fixtures");
const rimraf = require("rimraf");
const outputFileSync = require("output-file-sync");
const { sync: makeDirSync } = require("make-dir");
const child = require("child_process");
const merge = require("lodash/merge");
const path = require("path");
Expand All @@ -15,6 +15,11 @@ const fileFilter = function(x) {
return x !== ".DS_Store";
};

const outputFileSync = function(filePath, data) {
makeDirSync(path.dirname(filePath));
fs.writeFileSync(filePath, data);
};

const presetLocs = [
path.join(__dirname, "../../babel-preset-env"),
path.join(__dirname, "../../babel-preset-react"),
Expand Down

0 comments on commit a2b5437

Please sign in to comment.