Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update babel to v7.22.10 #15236

Merged
merged 4 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
],
"dependencies": {
"@angular/compiler": "16.2.0",
"@babel/code-frame": "7.22.5",
"@babel/code-frame": "7.22.10",
"@babel/parser": "7.22.10",
"@babel/types": "7.22.5",
"@babel/types": "7.22.10",
"@glimmer/syntax": "0.84.3",
"@iarna/toml": "2.2.5",
"@prettier/is-es5-identifier-name": "0.2.0",
Expand Down Expand Up @@ -106,7 +106,7 @@
"yaml-unist-parser": "2.0.1"
},
"devDependencies": {
"@babel/generator": "7.22.9",
"@babel/generator": "7.22.10",
"@esbuild-plugins/node-modules-polyfill": "0.2.2",
"@glimmer/reference": "0.84.3",
"@types/estree": "1.0.1",
Expand Down
35 changes: 31 additions & 4 deletions scripts/build/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path from "node:path";
import url from "node:url";
import fs from "node:fs";
import { createRequire } from "node:module";
import createEsmUtils from "esm-utils";
import { PROJECT_ROOT, DIST_DIR, copyFile } from "../utils/index.js";
import buildJavascriptModule from "./build-javascript-module.js";
Expand Down Expand Up @@ -426,12 +425,22 @@ const nonPluginUniversalFiles = [
umdVariableName: "prettier",
replaceModule: [
{
module: require.resolve("@babel/highlight"),
module: require.resolve("@babel/highlight", {
paths: [require.resolve("@babel/code-frame")],
}),
path: path.join(dirname, "./shims/babel-highlight.js"),
},
{
module: createRequire(require.resolve("vnopts")).resolve("chalk"),
path: path.join(dirname, "./shims/chalk.js"),
module: require.resolve("chalk", {
paths: [require.resolve("@babel/code-frame")],
}),
path: path.join(dirname, "./shims/chalk.cjs"),
},
{
module: require.resolve("chalk", {
paths: [require.resolve("vnopts")],
}),
path: path.join(dirname, "./shims/chalk.cjs"),
},
replaceDiffPackageEntry("lib/diff/array.js"),
],
Expand Down Expand Up @@ -514,6 +523,15 @@ const nodejsFiles = [
replacement: "const readBuffer = Buffer.alloc(this.options.readChunk);",
},
replaceDiffPackageEntry("lib/diff/array.js"),
// `@babel/code-frame` and `@babel/highlight` use compatible `chalk`, but they installed separately
{
module: require.resolve("chalk", {
paths: [require.resolve("@babel/highlight")],
}),
path: require.resolve("chalk", {
paths: [require.resolve("@babel/code-frame")],
}),
},
],
addDefaultExport: true,
},
Expand Down Expand Up @@ -547,6 +565,15 @@ const nodejsFiles = [
module: require.resolve("parent-module"),
path: path.join(dirname, "./shims/parent-module.cjs"),
},
// `@babel/code-frame` and `@babel/highlight` use compatible `chalk`, but they installed separately
{
module: require.resolve("chalk", {
paths: [require.resolve("@babel/highlight")],
}),
path: require.resolve("chalk", {
paths: [require.resolve("@babel/code-frame")],
}),
},
],
},
].flatMap((file) => {
Expand Down
4 changes: 1 addition & 3 deletions scripts/build/shims/babel-highlight.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
import chalk from "./chalk.js";

export const shouldHighlight = () => false;
export const getChalk = () => chalk;
export default String;
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

const chalk = new Proxy(String, { get: () => chalk });

export default chalk;
module.exports = chalk;
47 changes: 24 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ __metadata:
languageName: node
linkType: hard

"@babel/code-frame@npm:7.22.5, @babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/code-frame@npm:7.22.5"
"@babel/code-frame@npm:7.22.10, @babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.22.5":
version: 7.22.10
resolution: "@babel/code-frame@npm:7.22.10"
dependencies:
"@babel/highlight": ^7.22.5
checksum: cfe804f518f53faaf9a1d3e0f9f74127ab9a004912c3a16fda07fb6a633393ecb9918a053cb71804204c1b7ec3d49e1699604715e2cfb0c9f7bc4933d324ebb6
"@babel/highlight": ^7.22.10
chalk: ^2.4.2
checksum: 89a06534ad19759da6203a71bad120b1d7b2ddc016c8e07d4c56b35dea25e7396c6da60a754e8532a86733092b131ae7f661dbe6ba5d165ea777555daa2ed3c9
languageName: node
linkType: hard

Expand Down Expand Up @@ -91,15 +92,15 @@ __metadata:
languageName: node
linkType: hard

"@babel/generator@npm:7.22.9, @babel/generator@npm:^7.22.5, @babel/generator@npm:^7.7.2":
version: 7.22.9
resolution: "@babel/generator@npm:7.22.9"
"@babel/generator@npm:7.22.10, @babel/generator@npm:^7.22.5, @babel/generator@npm:^7.7.2":
version: 7.22.10
resolution: "@babel/generator@npm:7.22.10"
dependencies:
"@babel/types": ^7.22.5
"@babel/types": ^7.22.10
"@jridgewell/gen-mapping": ^0.3.2
"@jridgewell/trace-mapping": ^0.3.17
jsesc: ^2.5.1
checksum: 7c9d2c58b8d5ac5e047421a6ab03ec2ff5d9a5ff2c2212130a0055e063ac349e0b19d435537d6886c999771aef394832e4f54cd9fc810100a7f23d982f6af06b
checksum: 59a79730abdff9070692834bd3af179e7a9413fa2ff7f83dff3eb888765aeaeb2bfc7b0238a49613ed56e1af05956eff303cc139f2407eda8df974813e486074
languageName: node
linkType: hard

Expand Down Expand Up @@ -226,14 +227,14 @@ __metadata:
languageName: node
linkType: hard

"@babel/highlight@npm:^7.0.0, @babel/highlight@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/highlight@npm:7.22.5"
"@babel/highlight@npm:^7.0.0, @babel/highlight@npm:^7.22.10":
version: 7.22.10
resolution: "@babel/highlight@npm:7.22.10"
dependencies:
"@babel/helper-validator-identifier": ^7.22.5
chalk: ^2.0.0
chalk: ^2.4.2
js-tokens: ^4.0.0
checksum: f61ae6de6ee0ea8d9b5bcf2a532faec5ab0a1dc0f7c640e5047fc61630a0edb88b18d8c92eb06566d30da7a27db841aca11820ecd3ebe9ce514c9350fbed39c4
checksum: f714a1e1a72dd9d72f6383f4f30fd342e21a8df32d984a4ea8f5eab691bb6ba6db2f8823d4b4cf135d98869e7a98925b81306aa32ee3c429f8cfa52c75889e1b
languageName: node
linkType: hard

Expand Down Expand Up @@ -429,14 +430,14 @@ __metadata:
languageName: node
linkType: hard

"@babel/types@npm:7.22.5, @babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.5, @babel/types@npm:^7.3.3, @babel/types@npm:^7.8.3":
version: 7.22.5
resolution: "@babel/types@npm:7.22.5"
"@babel/types@npm:7.22.10, @babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.10, @babel/types@npm:^7.22.5, @babel/types@npm:^7.3.3, @babel/types@npm:^7.8.3":
version: 7.22.10
resolution: "@babel/types@npm:7.22.10"
dependencies:
"@babel/helper-string-parser": ^7.22.5
"@babel/helper-validator-identifier": ^7.22.5
to-fast-properties: ^2.0.0
checksum: c13a9c1dc7d2d1a241a2f8363540cb9af1d66e978e8984b400a20c4f38ba38ca29f06e26a0f2d49a70bad9e57615dac09c35accfddf1bb90d23cd3e0a0bab892
checksum: 095c4f4b7503fa816e4094113f0ec2351ef96ff32012010b771693066ff628c7c664b21c6bd3fb93aeb46fe7c61f6b3a3c9e4ed0034d6a2481201c417371c8af
languageName: node
linkType: hard

Expand Down Expand Up @@ -2594,7 +2595,7 @@ __metadata:
languageName: node
linkType: hard

"chalk@npm:2.4.2, chalk@npm:^2.0.0, chalk@npm:^2.4.1":
"chalk@npm:2.4.2, chalk@npm:^2.4.1, chalk@npm:^2.4.2":
version: 2.4.2
resolution: "chalk@npm:2.4.2"
dependencies:
Expand Down Expand Up @@ -7004,10 +7005,10 @@ __metadata:
resolution: "prettier@workspace:."
dependencies:
"@angular/compiler": 16.2.0
"@babel/code-frame": 7.22.5
"@babel/generator": 7.22.9
"@babel/code-frame": 7.22.10
"@babel/generator": 7.22.10
"@babel/parser": 7.22.10
"@babel/types": 7.22.5
"@babel/types": 7.22.10
"@esbuild-plugins/node-modules-polyfill": 0.2.2
"@glimmer/reference": 0.84.3
"@glimmer/syntax": 0.84.3
Expand Down