Skip to content

Commit

Permalink
chore: expand prettier-e2e test and update typings/deps (#14779)
Browse files Browse the repository at this point in the history
* chore

* test

* test

* update plugin-transform-typescript
  • Loading branch information
liuxingbaoyu authored Jul 26, 2022
1 parent 24d5fce commit bfb4f98
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 115 deletions.
2 changes: 1 addition & 1 deletion Gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ const libBundles = [
}));

const cjsBundles = [
// This is used by Prettier, @babel/register and @babel/eslint-parser
// This is used by @babel/register and @babel/eslint-parser
{ src: "packages/babel-parser" },
];

Expand Down
7 changes: 0 additions & 7 deletions lib/fs-readdir-recursive.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/babel-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"devDependencies": {
"@babel/core": "workspace:^",
"@babel/helper-fixtures": "workspace:^",
"@types/fs-readdir-recursive": "^1.1.0",
"rimraf": "^3.0.0"
},
"bin": {
Expand Down
1 change: 0 additions & 1 deletion scripts/generators/tsconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ fs.writeFileSync(
["./node_modules/to-fast-properties-BABEL_8_BREAKING-true"],
],
["slash", ["./node_modules/slash-BABEL_8_BREAKING-true"]],
["fs-readdir-recursive", ["./lib/fs-readdir-recursive.d.ts"]],
["kexec", ["./lib/kexec.d.ts"]],
]),
},
Expand Down
11 changes: 4 additions & 7 deletions scripts/integration-tests/e2e-prettier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ source utils/cleanup.sh
set -x

# Clone prettier
git clone --depth=1 https://github.com/prettier/prettier tmp/prettier
git clone --depth=1 --single-branch --branch next https://github.com/prettier/prettier tmp/prettier
cd tmp/prettier || exit

# Update @babel/* dependencies
Expand All @@ -32,14 +32,11 @@ yarn --version
# TEST #
#==============================================================================#

# Don't use Yarn 2
export YARN_IGNORE_PATH=1

startLocalRegistry "$root"/verdaccio-config.yml
yarn install
yarn install --no-immutable
yarn info

# Only run js,jsx,misc format tests
# Without --runInBand CircleCI hangs.
yarn test "tests/format/(jsx?|misc)/" --update-snapshot --runInBand
yarn test "tests/format/(jsx?|misc|typescript|flow|flow-repo)/" --update-snapshot --runInBand

cleanup
10 changes: 6 additions & 4 deletions scripts/integration-tests/utils/bump-babel-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,25 @@ const packageJSONPath = path.resolve(cwd, "./package.json");
const content = JSON.parse(fs.readFileSync(packageJSONPath));

let bumped = false;
function bumpBabelDependency(dependencies, version) {
function bumpBabelDependency(type, version) {
const dependencies = content[type];
for (const dep of Object.keys(dependencies)) {
if (dep.startsWith("@babel/") && !dependencies[dep].includes(":")) {
dependencies[dep] = version;
console.log(`Bumped ${type}:${dep} to ${version}`);
bumped = true;
}
}
}

if ("peerDependencies" in content) {
bumpBabelDependency(content.peerDependencies, "*");
bumpBabelDependency("peerDependencies", "*");
}
if ("devDependencies" in content) {
bumpBabelDependency(content.devDependencies, "latest");
bumpBabelDependency("devDependencies", "latest");
}
if ("dependencies" in content) {
bumpBabelDependency(content.dependencies, "latest");
bumpBabelDependency("dependencies", "latest");
}

if (bumped) {
Expand Down
3 changes: 0 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -730,9 +730,6 @@
"slash": [
"./node_modules/slash-BABEL_8_BREAKING-true"
],
"fs-readdir-recursive": [
"./lib/fs-readdir-recursive.d.ts"
],
"kexec": [
"./lib/kexec.d.ts"
]
Expand Down
Loading

0 comments on commit bfb4f98

Please sign in to comment.