From 1ce6173ef152f7e72bd12693990d896c02ec2529 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 23 Sep 2021 08:42:18 +0200 Subject: [PATCH 01/11] Replace chalk with nanocolors --- Gulpfile.mjs | 14 +-- babel-worker.cjs | 4 +- lib/babel-packages.js.flow | 4 +- package.json | 2 +- packages/babel-code-frame/package.json | 3 +- packages/babel-code-frame/src/index.ts | 23 ++-- packages/babel-code-frame/test/index.js | 14 +-- packages/babel-highlight/package.json | 5 +- packages/babel-highlight/src/index.ts | 40 +++--- .../test/helpers/disable-colors.js | 2 + .../test/helpers/enable-colors.js | 2 + packages/babel-highlight/test/index.color.js | 40 ++++++ packages/babel-highlight/test/index.js | 115 ------------------ .../babel-highlight/test/index.no-color.js | 56 +++++++++ packages/babel-types/package.json | 4 +- .../parser-tests/utils/parser-test-runner.js | 8 +- test/esm/package.json | 2 +- test/esm/test-runner.js | 6 +- yarn.lock | 48 ++++---- 19 files changed, 184 insertions(+), 208 deletions(-) create mode 100644 packages/babel-highlight/test/helpers/disable-colors.js create mode 100644 packages/babel-highlight/test/helpers/enable-colors.js create mode 100644 packages/babel-highlight/test/index.color.js delete mode 100644 packages/babel-highlight/test/index.js create mode 100644 packages/babel-highlight/test/index.no-color.js diff --git a/Gulpfile.mjs b/Gulpfile.mjs index 01a1ba99fa1d..330262b34b6a 100644 --- a/Gulpfile.mjs +++ b/Gulpfile.mjs @@ -4,7 +4,7 @@ import { createRequire } from "module"; import { fileURLToPath } from "url"; import plumber from "gulp-plumber"; import through from "through2"; -import chalk from "chalk"; +import { green, cyan, yellow } from "nanocolors"; import fancyLog from "fancy-log"; import filter from "gulp-filter"; import gulp from "gulp"; @@ -107,7 +107,7 @@ function generateHelpers(generator, dest, filename, message) { file.contents = Buffer.from( formatCode(await generateCode(filename), dest + file.path) ); - fancyLog(`${chalk.green("✔")} Generated ${message}`); + fancyLog(`${green("✔")} Generated ${message}`); callback(null, file); }) ) @@ -291,7 +291,7 @@ function buildRollup(packages, targetBrowsers) { ); const input = getIndexFromPackage(src); - fancyLog(`Compiling '${chalk.cyan(input)}' with rollup ...`); + fancyLog(`Compiling '${cyan(input)}' with rollup ...`); const bundle = await rollup({ input, external, @@ -396,15 +396,15 @@ function buildRollup(packages, targetBrowsers) { if (!process.env.IS_PUBLISH) { fancyLog( - chalk.yellow( - `Skipped minification of '${chalk.cyan( + yellow( + `Skipped minification of '${cyan( outputFile )}' because not publishing` ) ); return undefined; } - fancyLog(`Minifying '${chalk.cyan(outputFile)}'...`); + fancyLog(`Minifying '${cyan(outputFile)}'...`); await bundle.write({ file: outputFile.replace(/\.js$/, ".min.js"), @@ -432,7 +432,7 @@ function buildRollupDts(packages) { packages.map(async packageName => { const input = `${mapToDts(packageName)}/src/index.d.ts`; const output = `${packageName}/lib/index.d.ts`; - fancyLog(`Bundling '${chalk.cyan(output)}' with rollup ...`); + fancyLog(`Bundling '${cyan(output)}' with rollup ...`); const bundle = await rollup({ input, diff --git a/babel-worker.cjs b/babel-worker.cjs index 6a27d27d1d9c..bf259cfbe447 100644 --- a/babel-worker.cjs +++ b/babel-worker.cjs @@ -1,7 +1,7 @@ const { transformSync } = require("@babel/core"); const { mkdirSync, statSync, readFileSync, writeFileSync } = require("fs"); const { dirname } = require("path"); -const chalk = require("chalk"); +const { cyan } = require("nanocolors"); const fancyLog = require("fancy-log"); function needCompile(src, dest) { @@ -24,7 +24,7 @@ exports.transform = function (src, dest) { if (!needCompile(src, dest)) { return; } - fancyLog(`Compiling '${chalk.cyan(src)}'...`); + fancyLog(`Compiling '${cyan(src)}'...`); const content = readFileSync(src, { encoding: "utf8" }); const { code } = transformSync(content, { filename: src, diff --git a/lib/babel-packages.js.flow b/lib/babel-packages.js.flow index dab37130a96a..5a7b5429b947 100644 --- a/lib/babel-packages.js.flow +++ b/lib/babel-packages.js.flow @@ -180,7 +180,7 @@ declare module "@babel/generator" { } declare module "@babel/highlight" { - import typeof { Chalk } from "chalk"; + import typeof { Colors } from "nanocolors"; declare type Options = { forceColor?: boolean, }; @@ -193,7 +193,7 @@ declare module "@babel/highlight" { /** * The Chalk instance that should be used given the passed options. */ - declare function getChalk(options: Options): Chalk; + declare function getChalk(options: Options): Colors; /** * Highlight `code`. diff --git a/package.json b/package.json index 4651979831d2..48a464916a91 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,6 @@ "@typescript-eslint/eslint-plugin": "^4.18.0", "@typescript-eslint/parser": "^4.18.0", "babel-plugin-transform-charcodes": "^0.2.0", - "chalk": "^2.4.2", "charcodes": "^0.2.0", "enhanced-resolve": "^5.8.2", "eslint": "^7.27.0", @@ -64,6 +63,7 @@ "lint-staged": "^9.2.0", "lodash": "^4.17.21", "mergeiterator": "^1.2.5", + "nanocolors": "^0.1.10", "prettier": "2.3.1", "rollup": "~2.54.0", "rollup-plugin-dts": "^2.0.0", diff --git a/packages/babel-code-frame/package.json b/packages/babel-code-frame/package.json index b5842dce2e0d..b40e849e38cd 100644 --- a/packages/babel-code-frame/package.json +++ b/packages/babel-code-frame/package.json @@ -19,8 +19,7 @@ "@babel/highlight": "workspace:^7.14.5" }, "devDependencies": { - "@types/chalk": "^2.0.0", - "chalk": "^2.0.0", + "nanocolors": "^0.1.10", "strip-ansi": "^4.0.0" }, "engines": { diff --git a/packages/babel-code-frame/src/index.ts b/packages/babel-code-frame/src/index.ts index 9c237d423ec0..93e1d6c3a5d1 100644 --- a/packages/babel-code-frame/src/index.ts +++ b/packages/babel-code-frame/src/index.ts @@ -35,13 +35,16 @@ export interface Options { } /** - * Chalk styles for code frame token types. + * Nano Colors styles for code frame token types. */ -function getDefs(chalk) { +function getDefs(colors) { + function redBold(s) { + return colors.red(colors.bold(s)); + } return { - gutter: chalk.grey, - marker: chalk.red.bold, - message: chalk.red.bold, + gutter: colors.gray, + marker: redBold, + message: redBold, }; } @@ -133,10 +136,10 @@ export function codeFrameColumns( ): string { const highlighted = (opts.highlightCode || opts.forceColor) && shouldHighlight(opts); - const chalk = getChalk(opts); - const defs = getDefs(chalk); - const maybeHighlight = (chalkFn, string) => { - return highlighted ? chalkFn(string) : string; + const colors = getChalk(opts); + const defs = getDefs(colors); + const maybeHighlight = (color, string) => { + return highlighted ? color(string) : string; }; const lines = rawLines.split(NEWLINE); const { start, end, markerLines } = getMarkerLines(loc, lines, opts); @@ -194,7 +197,7 @@ export function codeFrameColumns( } if (highlighted) { - return chalk.reset(frame); + return colors.reset(frame); } else { return frame; } diff --git a/packages/babel-code-frame/test/index.js b/packages/babel-code-frame/test/index.js index 397a78f1c52b..3e1a010e32d3 100644 --- a/packages/babel-code-frame/test/index.js +++ b/packages/babel-code-frame/test/index.js @@ -1,4 +1,4 @@ -import chalk from "chalk"; +import { red, bold, gray, yellow, reset } from "nanocolors"; import stripAnsi from "strip-ansi"; import codeFrame, { codeFrameColumns } from ".."; @@ -262,8 +262,7 @@ describe("@babel/code-frame", function () { }); test("opts.forceColor", function () { - const marker = chalk.red.bold; - const gutter = chalk.grey; + const gutter = gray; const rawLines = ["", "", "", ""].join("\n"); expect( @@ -273,10 +272,10 @@ describe("@babel/code-frame", function () { forceColor: true, }), ).toEqual( - chalk.reset( + reset( [ " " + gutter(" 2 |"), - marker(">") + gutter(" 3 |"), + red(bold(">")) + gutter(" 3 |"), " " + gutter(" 4 |"), ].join("\n"), ), @@ -284,8 +283,7 @@ describe("@babel/code-frame", function () { }); test("jsx", function () { - const gutter = chalk.grey; - const yellow = chalk.yellow; + const gutter = gray; const rawLines = ["
"].join("\n"); @@ -299,7 +297,7 @@ describe("@babel/code-frame", function () { ), ).toEqual( JSON.stringify( - chalk.reset( + reset( " " + gutter(" 1 |") + " " + diff --git a/packages/babel-highlight/package.json b/packages/babel-highlight/package.json index 39c31c58250a..cb4cf2fc1539 100644 --- a/packages/babel-highlight/package.json +++ b/packages/babel-highlight/package.json @@ -16,11 +16,10 @@ "main": "./lib/index.js", "dependencies": { "@babel/helper-validator-identifier": "workspace:^7.14.5", - "chalk": "^2.0.0", - "js-tokens": "condition:BABEL_8_BREAKING ? ^7.0.0 : ^4.0.0" + "js-tokens": "condition:BABEL_8_BREAKING ? ^7.0.0 : ^4.0.0", + "nanocolors": "^0.1.10" }, "devDependencies": { - "@types/chalk": "^2.0.0", "strip-ansi": "^4.0.0" }, "engines": { diff --git a/packages/babel-highlight/src/index.ts b/packages/babel-highlight/src/index.ts index 373f37edcd7e..830d7c575b18 100644 --- a/packages/babel-highlight/src/index.ts +++ b/packages/babel-highlight/src/index.ts @@ -7,9 +7,7 @@ import { isStrictReservedWord, isKeyword, } from "@babel/helper-validator-identifier"; -import Chalk from "chalk"; - -type ChalkClass = ReturnType; +import { isColorSupported, createColors, Colors, Color } from "nanocolors"; /** * Names that are always allowed as identifiers, but also appear as keywords @@ -34,19 +32,19 @@ type InternalTokenType = | "invalid"; /** - * Chalk styles for token types. + * Nano Colors styles for token types. */ -function getDefs(chalk: ChalkClass): Record { +function getDefs(colors: Colors): Record { return { - keyword: chalk.cyan, - capitalized: chalk.yellow, - jsxIdentifier: chalk.yellow, - punctuator: chalk.yellow, - number: chalk.magenta, - string: chalk.green, - regex: chalk.magenta, - comment: chalk.grey, - invalid: chalk.white.bgRed.bold, + keyword: colors.cyan, + capitalized: colors.yellow, + jsxIdentifier: colors.yellow, + punctuator: colors.yellow, + number: colors.magenta, + string: colors.green, + regex: colors.magenta, + comment: colors.gray, + invalid: s => colors.white(colors.bgRed(colors.bold(s))), }; } @@ -216,7 +214,7 @@ if (process.env.BABEL_8_BREAKING) { /** * Highlight `text` using the token definitions in `defs`. */ -function highlightTokens(defs: Record, text: string) { +function highlightTokens(defs: Record, text: string) { let highlighted = ""; for (const { type, value } of tokenize(text)) { @@ -246,16 +244,14 @@ type Options = { * Whether the code should be highlighted given the passed options. */ export function shouldHighlight(options: Options): boolean { - return !!Chalk.supportsColor || options.forceColor; + return isColorSupported || options.forceColor; } /** - * The Chalk instance that should be used given the passed options. + * The Nano Colors instance that should be used given the passed options. */ export function getChalk(options: Options) { - return options.forceColor - ? new Chalk.constructor({ enabled: true, level: 1 }) - : Chalk; + return createColors(options.forceColor); } /** @@ -263,8 +259,8 @@ export function getChalk(options: Options) { */ export default function highlight(code: string, options: Options = {}): string { if (shouldHighlight(options)) { - const chalk = getChalk(options); - const defs = getDefs(chalk); + const colors = getChalk(options); + const defs = getDefs(colors); return highlightTokens(defs, code); } else { return code; diff --git a/packages/babel-highlight/test/helpers/disable-colors.js b/packages/babel-highlight/test/helpers/disable-colors.js new file mode 100644 index 000000000000..ca0731ac7f6f --- /dev/null +++ b/packages/babel-highlight/test/helpers/disable-colors.js @@ -0,0 +1,2 @@ +process.env.NO_COLOR = 1; +delete process.env.FORCE_COLOR; diff --git a/packages/babel-highlight/test/helpers/enable-colors.js b/packages/babel-highlight/test/helpers/enable-colors.js new file mode 100644 index 000000000000..04af865599a1 --- /dev/null +++ b/packages/babel-highlight/test/helpers/enable-colors.js @@ -0,0 +1,2 @@ +delete process.env.NO_COLOR; +process.env.FORCE_COLOR = 1; diff --git a/packages/babel-highlight/test/index.color.js b/packages/babel-highlight/test/index.color.js new file mode 100644 index 000000000000..eda899ca85f1 --- /dev/null +++ b/packages/babel-highlight/test/index.color.js @@ -0,0 +1,40 @@ +import "./helpers/enable-colors"; +import { createColors } from "nanocolors"; +import stripAnsi from "strip-ansi"; +import highlight, { shouldHighlight, getChalk } from "../lib"; + +describe("@babel/highlight when colors are supported", function () { + describe("highlight", function () { + it("highlights code", function () { + const code = "console.log('hi')"; + const result = highlight(code); + const stripped = stripAnsi(result); + expect(result.length).toBeGreaterThan(stripped.length); + expect(stripped).toBe(code); + }); + }); + + describe("shouldHighlight", function () { + it("returns true", function () { + expect(shouldHighlight({})).toBeTruthy(); + }); + }); +}); + +describe("getChalk", function () { + describe("when forceColor is not passed", function () { + it("returns a Chalk instance", function () { + expect(Object.keys(getChalk({})).sort()).toEqual( + Object.keys(createColors()).sort(), + ); + }); + }); + + describe("when forceColor is passed", function () { + it("returns a Chalk instance", function () { + expect(Object.keys(getChalk({ forceColor: true })).sort()).toEqual( + Object.keys(createColors()).sort(), + ); + }); + }); +}); diff --git a/packages/babel-highlight/test/index.js b/packages/babel-highlight/test/index.js deleted file mode 100644 index 64877c7f7f35..000000000000 --- a/packages/babel-highlight/test/index.js +++ /dev/null @@ -1,115 +0,0 @@ -import chalk from "chalk"; -import stripAnsi from "strip-ansi"; -import highlight, { shouldHighlight, getChalk } from ".."; - -describe("@babel/highlight", function () { - function stubColorSupport(supported) { - let originalSupportsColor; - beforeEach(function () { - originalSupportsColor = chalk.supportsColor; - chalk.supportsColor = supported; - }); - - afterEach(function () { - chalk.supportsColor = originalSupportsColor; - }); - } - - describe("highlight", function () { - describe("when colors are supported", function () { - stubColorSupport(true); - - it("highlights code", function () { - const code = "console.log('hi')"; - const result = highlight(code); - const stripped = stripAnsi(result); - expect(result.length).toBeGreaterThan(stripped.length); - expect(stripped).toBe(code); - }); - }); - - describe("when colors are not supported", function () { - stubColorSupport(false); - - it("does not attempt to highlight code", function () { - const code = "console.log('hi')"; - const result = highlight(code); - const stripped = stripAnsi(result); - expect(result.length).toBe(stripped.length); - expect(result).toBe(code); - }); - - describe("and the forceColor option is passed", function () { - it("highlights the code anyway", function () { - const code = "console.log('hi')"; - const result = highlight(code, { forceColor: true }); - const stripped = stripAnsi(result); - expect(result.length).toBeGreaterThan(stripped.length); - expect(stripped).toBe(code); - }); - }); - }); - }); - - describe("shouldHighlight", function () { - describe("when colors are supported", function () { - stubColorSupport(true); - - it("returns true", function () { - expect(shouldHighlight({})).toBeTruthy(); - }); - }); - - describe("when colors are not supported", function () { - stubColorSupport(false); - - it("returns false", function () { - expect(shouldHighlight({})).toBeFalsy(); - }); - - describe("and the forceColor option is passed", function () { - it("returns true", function () { - expect(shouldHighlight({ forceColor: true })).toBeTruthy(); - }); - }); - }); - }); - - describe("getChalk", function () { - describe("when colors are supported", function () { - stubColorSupport(true); - - describe("when forceColor is not passed", function () { - it("returns a Chalk instance", function () { - expect(getChalk({}).constructor).toBe(chalk.constructor); - }); - }); - - describe("when forceColor is passed", function () { - it("returns a Chalk instance", function () { - expect(getChalk({ forceColor: true }).constructor).toBe( - chalk.constructor, - ); - }); - }); - }); - - describe("when colors are not supported", function () { - stubColorSupport(false); - - describe("when forceColor is not passed", function () { - it("returns a Chalk instance", function () { - expect(getChalk({}).constructor).toBe(chalk.constructor); - }); - }); - - describe("when forceColor is passed", function () { - it("returns a Chalk instance", function () { - expect(getChalk({ forceColor: true }).constructor).toBe( - chalk.constructor, - ); - }); - }); - }); - }); -}); diff --git a/packages/babel-highlight/test/index.no-color.js b/packages/babel-highlight/test/index.no-color.js new file mode 100644 index 000000000000..8efced727545 --- /dev/null +++ b/packages/babel-highlight/test/index.no-color.js @@ -0,0 +1,56 @@ +import "./helpers/disable-colors"; +import { createColors } from "nanocolors"; +import stripAnsi from "strip-ansi"; +import highlight, { shouldHighlight, getChalk } from "../lib"; + +describe("@babel/highlight when colors are not supported", function () { + describe("highlight", function () { + it("does not attempt to highlight code", function () { + const code = "console.log('hi')"; + const result = highlight(code); + const stripped = stripAnsi(result); + expect(result.length).toBe(stripped.length); + expect(result).toBe(code); + }); + + describe("and the forceColor option is passed", function () { + it("highlights the code anyway", function () { + const code = "console.log('hi')"; + const result = highlight(code, { forceColor: true }); + const stripped = stripAnsi(result); + expect(result.length).toBeGreaterThan(stripped.length); + expect(stripped).toBe(code); + }); + }); + }); + + describe("shouldHighlight", function () { + it("returns false", function () { + expect(shouldHighlight({})).toBeFalsy(); + }); + + describe("and the forceColor option is passed", function () { + it("returns true", function () { + expect(shouldHighlight({ forceColor: true })).toBeTruthy(); + }); + }); + }); + + describe("getChalk", function () { + describe("when forceColor is not passed", function () { + it("returns a Chalk instance", function () { + expect(Object.keys(getChalk({})).sort()).toEqual( + Object.keys(createColors()).sort(), + ); + }); + }); + + describe("when forceColor is passed", function () { + it("returns a Chalk instance", function () { + expect(Object.keys(getChalk({ forceColor: true })).sort()).toEqual( + Object.keys(createColors()).sort(), + ); + }); + }); + }); +}); diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index 491f7b142624..de59d5c45bf6 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -30,8 +30,8 @@ "devDependencies": { "@babel/generator": "workspace:*", "@babel/parser": "workspace:*", - "chalk": "^4.1.0", - "glob": "^7.1.7" + "glob": "^7.1.7", + "nanocolors": "^0.1.10" }, "engines": { "node": ">=6.9.0" diff --git a/scripts/parser-tests/utils/parser-test-runner.js b/scripts/parser-tests/utils/parser-test-runner.js index 79e235b48b5e..aeb16b0a3758 100644 --- a/scripts/parser-tests/utils/parser-test-runner.js +++ b/scripts/parser-tests/utils/parser-test-runner.js @@ -1,8 +1,8 @@ import fs from "fs/promises"; -import chalk from "chalk"; +import { red, green, gray } from "nanocolors"; import { parse as parser } from "../../../packages/babel-parser/lib/index.js"; -const dot = chalk.gray("."); +const dot = gray("."); class TestRunner { constructor({ @@ -212,11 +212,11 @@ class TestRunner { console.log(`Testing complete (${summary.count} tests).`); console.log("Summary:"); - console.log(chalk.green(goodnews.join("\n").replace(/^/gm, " ✔ "))); + console.log(green(goodnews.join("\n").replace(/^/gm, " ✔ "))); if (!summary.passed) { console.log(""); - console.log(chalk.red(badnews.join("\n").replace(/^/gm, " ✘ "))); + console.log(red(badnews.join("\n").replace(/^/gm, " ✘ "))); console.log(""); console.log("Details:"); console.log(badnewsDetails.join("\n").replace(/^/gm, " ")); diff --git a/test/esm/package.json b/test/esm/package.json index 916edd53407d..e53f7b6c9a79 100644 --- a/test/esm/package.json +++ b/test/esm/package.json @@ -6,6 +6,6 @@ "devDependencies": { "@babel/runtime": "workspace:*", "@babel/runtime-corejs3": "workspace:*", - "chalk": "^4.1.0" + "nanocolors": "^0.1.10" } } diff --git a/test/esm/test-runner.js b/test/esm/test-runner.js index 07313f2537fd..4a00b21d623b 100644 --- a/test/esm/test-runner.js +++ b/test/esm/test-runner.js @@ -1,4 +1,4 @@ -import chalk from "chalk"; +import { green, red } from "nanocolors"; export default async function testRunner({ title, testcases }) { console.log(title); @@ -6,9 +6,9 @@ export default async function testRunner({ title, testcases }) { for (const [subtitle, testcase] of testcases) { try { await testcase(); - console.log(chalk.green(indent + "✓ " + subtitle)); + console.log(green(indent + "✓ " + subtitle)); } catch (e) { - console.log(chalk.red(indent + "✗ " + subtitle)); + console.log(red(indent + "✗ " + subtitle)); console.error(e); } } diff --git a/yarn.lock b/yarn.lock index 25f18dac9db3..a0349397dfea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -174,8 +174,7 @@ __metadata: resolution: "@babel/code-frame@workspace:packages/babel-code-frame" dependencies: "@babel/highlight": "workspace:^7.14.5" - "@types/chalk": ^2.0.0 - chalk: ^2.0.0 + nanocolors: ^0.1.10 strip-ansi: ^4.0.0 languageName: unknown linkType: soft @@ -954,9 +953,8 @@ __metadata: resolution: "@babel/highlight@workspace:packages/babel-highlight" dependencies: "@babel/helper-validator-identifier": "workspace:^7.14.5" - "@types/chalk": ^2.0.0 - chalk: ^2.0.0 js-tokens: "condition:BABEL_8_BREAKING ? ^7.0.0 : ^4.0.0" + nanocolors: ^0.1.10 strip-ansi: ^4.0.0 languageName: unknown linkType: soft @@ -3542,7 +3540,7 @@ __metadata: dependencies: "@babel/runtime": "workspace:*" "@babel/runtime-corejs3": "workspace:*" - chalk: ^4.1.0 + nanocolors: ^0.1.10 languageName: unknown linkType: soft @@ -3597,8 +3595,8 @@ __metadata: "@babel/generator": "workspace:*" "@babel/helper-validator-identifier": "workspace:^7.14.9" "@babel/parser": "workspace:*" - chalk: ^4.1.0 glob: ^7.1.7 + nanocolors: ^0.1.10 to-fast-properties: ^2.0.0 languageName: unknown linkType: soft @@ -4085,15 +4083,6 @@ __metadata: languageName: node linkType: soft -"@types/chalk@npm:^2.0.0": - version: 2.2.0 - resolution: "@types/chalk@npm:2.2.0" - dependencies: - chalk: "*" - checksum: 846437590d0bf0026d8c2f454e5d91a486becfabde61c0441025e791a0fed75304e143717bc4d025569394dcce5a32f2c53d97253d0c735ac1abae63f1b25c3e - languageName: node - linkType: hard - "@types/color-name@npm:^1.1.1": version: 1.1.1 resolution: "@types/color-name@npm:1.1.1" @@ -5738,7 +5727,6 @@ __metadata: "@typescript-eslint/eslint-plugin": ^4.18.0 "@typescript-eslint/parser": ^4.18.0 babel-plugin-transform-charcodes: ^0.2.0 - chalk: ^2.4.2 charcodes: ^0.2.0 enhanced-resolve: ^5.8.2 eslint: ^7.27.0 @@ -5759,6 +5747,7 @@ __metadata: lint-staged: ^9.2.0 lodash: ^4.17.21 mergeiterator: ^1.2.5 + nanocolors: ^0.1.10 prettier: 2.3.1 rollup: ~2.54.0 rollup-plugin-dts: ^2.0.0 @@ -6317,16 +6306,6 @@ __metadata: languageName: node linkType: hard -"chalk@npm:*, chalk@npm:^4.0.0, chalk@npm:^4.1.0": - version: 4.1.0 - resolution: "chalk@npm:4.1.0" - dependencies: - ansi-styles: ^4.1.0 - supports-color: ^7.1.0 - checksum: 5561c7b4c063badee3e16d04bce50bd033e1be1bf4c6948639275683ffa7a1993c44639b43c22b1c505f0f813a24b1889037eb182546b48946f9fe7cdd0e7d13 - languageName: node - linkType: hard - "chalk@npm:^1.0.0, chalk@npm:^1.1.3": version: 1.1.3 resolution: "chalk@npm:1.1.3" @@ -6361,6 +6340,16 @@ __metadata: languageName: node linkType: hard +"chalk@npm:^4.0.0": + version: 4.1.0 + resolution: "chalk@npm:4.1.0" + dependencies: + ansi-styles: ^4.1.0 + supports-color: ^7.1.0 + checksum: 5561c7b4c063badee3e16d04bce50bd033e1be1bf4c6948639275683ffa7a1993c44639b43c22b1c505f0f813a24b1889037eb182546b48946f9fe7cdd0e7d13 + languageName: node + linkType: hard + "char-regex@npm:^1.0.2": version: 1.0.2 resolution: "char-regex@npm:1.0.2" @@ -11591,6 +11580,13 @@ fsevents@^1.2.7: languageName: node linkType: hard +"nanocolors@npm:^0.1.10": + version: 0.1.10 + resolution: "nanocolors@npm:0.1.10" + checksum: fae94d3afe7bf5b78ce909b00a52e7a8751355199805c45b30c7b2b547bedefcee2b0bcac637ee89041d4eafc1857fd6f5f4f924ad3c545af4a173de8f72802c + languageName: node + linkType: hard + "nanomatch@npm:^1.2.9": version: 1.2.13 resolution: "nanomatch@npm:1.2.13" From 74e73a0a5541f37e1ec529e56b00d16cb67dea1d Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 23 Sep 2021 09:04:28 +0200 Subject: [PATCH 02/11] Use Nano Colors 0.1.11 --- package.json | 2 +- packages/babel-code-frame/package.json | 2 +- packages/babel-highlight/package.json | 2 +- packages/babel-types/package.json | 2 +- test/esm/package.json | 2 +- yarn.lock | 18 +++++++++--------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 48a464916a91..7931fc2994e0 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "lint-staged": "^9.2.0", "lodash": "^4.17.21", "mergeiterator": "^1.2.5", - "nanocolors": "^0.1.10", + "nanocolors": "^0.1.11", "prettier": "2.3.1", "rollup": "~2.54.0", "rollup-plugin-dts": "^2.0.0", diff --git a/packages/babel-code-frame/package.json b/packages/babel-code-frame/package.json index b40e849e38cd..5880da452d81 100644 --- a/packages/babel-code-frame/package.json +++ b/packages/babel-code-frame/package.json @@ -19,7 +19,7 @@ "@babel/highlight": "workspace:^7.14.5" }, "devDependencies": { - "nanocolors": "^0.1.10", + "nanocolors": "^0.1.11", "strip-ansi": "^4.0.0" }, "engines": { diff --git a/packages/babel-highlight/package.json b/packages/babel-highlight/package.json index cb4cf2fc1539..e1f1931093f2 100644 --- a/packages/babel-highlight/package.json +++ b/packages/babel-highlight/package.json @@ -17,7 +17,7 @@ "dependencies": { "@babel/helper-validator-identifier": "workspace:^7.14.5", "js-tokens": "condition:BABEL_8_BREAKING ? ^7.0.0 : ^4.0.0", - "nanocolors": "^0.1.10" + "nanocolors": "^0.1.11" }, "devDependencies": { "strip-ansi": "^4.0.0" diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index de59d5c45bf6..a3a7c4409c9a 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -31,7 +31,7 @@ "@babel/generator": "workspace:*", "@babel/parser": "workspace:*", "glob": "^7.1.7", - "nanocolors": "^0.1.10" + "nanocolors": "^0.1.11" }, "engines": { "node": ">=6.9.0" diff --git a/test/esm/package.json b/test/esm/package.json index e53f7b6c9a79..38e9d9104653 100644 --- a/test/esm/package.json +++ b/test/esm/package.json @@ -6,6 +6,6 @@ "devDependencies": { "@babel/runtime": "workspace:*", "@babel/runtime-corejs3": "workspace:*", - "nanocolors": "^0.1.10" + "nanocolors": "^0.1.11" } } diff --git a/yarn.lock b/yarn.lock index a0349397dfea..930fd72d7444 100644 --- a/yarn.lock +++ b/yarn.lock @@ -174,7 +174,7 @@ __metadata: resolution: "@babel/code-frame@workspace:packages/babel-code-frame" dependencies: "@babel/highlight": "workspace:^7.14.5" - nanocolors: ^0.1.10 + nanocolors: ^0.1.11 strip-ansi: ^4.0.0 languageName: unknown linkType: soft @@ -954,7 +954,7 @@ __metadata: dependencies: "@babel/helper-validator-identifier": "workspace:^7.14.5" js-tokens: "condition:BABEL_8_BREAKING ? ^7.0.0 : ^4.0.0" - nanocolors: ^0.1.10 + nanocolors: ^0.1.11 strip-ansi: ^4.0.0 languageName: unknown linkType: soft @@ -3540,7 +3540,7 @@ __metadata: dependencies: "@babel/runtime": "workspace:*" "@babel/runtime-corejs3": "workspace:*" - nanocolors: ^0.1.10 + nanocolors: ^0.1.11 languageName: unknown linkType: soft @@ -3596,7 +3596,7 @@ __metadata: "@babel/helper-validator-identifier": "workspace:^7.14.9" "@babel/parser": "workspace:*" glob: ^7.1.7 - nanocolors: ^0.1.10 + nanocolors: ^0.1.11 to-fast-properties: ^2.0.0 languageName: unknown linkType: soft @@ -5747,7 +5747,7 @@ __metadata: lint-staged: ^9.2.0 lodash: ^4.17.21 mergeiterator: ^1.2.5 - nanocolors: ^0.1.10 + nanocolors: ^0.1.11 prettier: 2.3.1 rollup: ~2.54.0 rollup-plugin-dts: ^2.0.0 @@ -11580,10 +11580,10 @@ fsevents@^1.2.7: languageName: node linkType: hard -"nanocolors@npm:^0.1.10": - version: 0.1.10 - resolution: "nanocolors@npm:0.1.10" - checksum: fae94d3afe7bf5b78ce909b00a52e7a8751355199805c45b30c7b2b547bedefcee2b0bcac637ee89041d4eafc1857fd6f5f4f924ad3c545af4a173de8f72802c +"nanocolors@npm:^0.1.11": + version: 0.1.11 + resolution: "nanocolors@npm:0.1.11" + checksum: 1d9ce971f1803b746f8e26177abff8ede81e754bb44d453ba704a4fef4d8caf585fd300aae97ea2f87b4ac6a6b4555448fd522506ca30c45aef4b5fa368086b5 languageName: node linkType: hard From 0e8c1c5e5ec8ade16f7d7af3ce1ce9c1102e39bb Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 23 Sep 2021 09:07:55 +0200 Subject: [PATCH 03/11] Move types to type import --- packages/babel-highlight/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/babel-highlight/src/index.ts b/packages/babel-highlight/src/index.ts index 830d7c575b18..8346b5b1f35c 100644 --- a/packages/babel-highlight/src/index.ts +++ b/packages/babel-highlight/src/index.ts @@ -1,13 +1,14 @@ /// import type { Token, JSXToken } from "js-tokens"; +import type { Colors, Color } from "nanocolors"; import jsTokens from "js-tokens"; import { isStrictReservedWord, isKeyword, } from "@babel/helper-validator-identifier"; -import { isColorSupported, createColors, Colors, Color } from "nanocolors"; +import { isColorSupported, createColors } from "nanocolors"; /** * Names that are always allowed as identifiers, but also appear as keywords From 584c27dbd5f6369133634db7d9d7e0c98b7da097 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 23 Sep 2021 10:10:30 +0200 Subject: [PATCH 04/11] Update Nano Colors --- package.json | 2 +- packages/babel-code-frame/package.json | 2 +- packages/babel-highlight/package.json | 2 +- packages/babel-types/package.json | 2 +- test/esm/package.json | 2 +- yarn.lock | 18 +++++++++--------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 7931fc2994e0..57da1d9698e6 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "lint-staged": "^9.2.0", "lodash": "^4.17.21", "mergeiterator": "^1.2.5", - "nanocolors": "^0.1.11", + "nanocolors": "^0.1.12", "prettier": "2.3.1", "rollup": "~2.54.0", "rollup-plugin-dts": "^2.0.0", diff --git a/packages/babel-code-frame/package.json b/packages/babel-code-frame/package.json index 5880da452d81..5c43c1920f9f 100644 --- a/packages/babel-code-frame/package.json +++ b/packages/babel-code-frame/package.json @@ -19,7 +19,7 @@ "@babel/highlight": "workspace:^7.14.5" }, "devDependencies": { - "nanocolors": "^0.1.11", + "nanocolors": "^0.1.12", "strip-ansi": "^4.0.0" }, "engines": { diff --git a/packages/babel-highlight/package.json b/packages/babel-highlight/package.json index e1f1931093f2..7d72cac91a31 100644 --- a/packages/babel-highlight/package.json +++ b/packages/babel-highlight/package.json @@ -17,7 +17,7 @@ "dependencies": { "@babel/helper-validator-identifier": "workspace:^7.14.5", "js-tokens": "condition:BABEL_8_BREAKING ? ^7.0.0 : ^4.0.0", - "nanocolors": "^0.1.11" + "nanocolors": "^0.1.12" }, "devDependencies": { "strip-ansi": "^4.0.0" diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index a3a7c4409c9a..ffd2a879efdf 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -31,7 +31,7 @@ "@babel/generator": "workspace:*", "@babel/parser": "workspace:*", "glob": "^7.1.7", - "nanocolors": "^0.1.11" + "nanocolors": "^0.1.12" }, "engines": { "node": ">=6.9.0" diff --git a/test/esm/package.json b/test/esm/package.json index 38e9d9104653..6726e102d50d 100644 --- a/test/esm/package.json +++ b/test/esm/package.json @@ -6,6 +6,6 @@ "devDependencies": { "@babel/runtime": "workspace:*", "@babel/runtime-corejs3": "workspace:*", - "nanocolors": "^0.1.11" + "nanocolors": "^0.1.12" } } diff --git a/yarn.lock b/yarn.lock index 930fd72d7444..9b6092d24ec9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -174,7 +174,7 @@ __metadata: resolution: "@babel/code-frame@workspace:packages/babel-code-frame" dependencies: "@babel/highlight": "workspace:^7.14.5" - nanocolors: ^0.1.11 + nanocolors: ^0.1.12 strip-ansi: ^4.0.0 languageName: unknown linkType: soft @@ -954,7 +954,7 @@ __metadata: dependencies: "@babel/helper-validator-identifier": "workspace:^7.14.5" js-tokens: "condition:BABEL_8_BREAKING ? ^7.0.0 : ^4.0.0" - nanocolors: ^0.1.11 + nanocolors: ^0.1.12 strip-ansi: ^4.0.0 languageName: unknown linkType: soft @@ -3540,7 +3540,7 @@ __metadata: dependencies: "@babel/runtime": "workspace:*" "@babel/runtime-corejs3": "workspace:*" - nanocolors: ^0.1.11 + nanocolors: ^0.1.12 languageName: unknown linkType: soft @@ -3596,7 +3596,7 @@ __metadata: "@babel/helper-validator-identifier": "workspace:^7.14.9" "@babel/parser": "workspace:*" glob: ^7.1.7 - nanocolors: ^0.1.11 + nanocolors: ^0.1.12 to-fast-properties: ^2.0.0 languageName: unknown linkType: soft @@ -5747,7 +5747,7 @@ __metadata: lint-staged: ^9.2.0 lodash: ^4.17.21 mergeiterator: ^1.2.5 - nanocolors: ^0.1.11 + nanocolors: ^0.1.12 prettier: 2.3.1 rollup: ~2.54.0 rollup-plugin-dts: ^2.0.0 @@ -11580,10 +11580,10 @@ fsevents@^1.2.7: languageName: node linkType: hard -"nanocolors@npm:^0.1.11": - version: 0.1.11 - resolution: "nanocolors@npm:0.1.11" - checksum: 1d9ce971f1803b746f8e26177abff8ede81e754bb44d453ba704a4fef4d8caf585fd300aae97ea2f87b4ac6a6b4555448fd522506ca30c45aef4b5fa368086b5 +"nanocolors@npm:^0.1.12": + version: 0.1.12 + resolution: "nanocolors@npm:0.1.12" + checksum: 2ce58f57006ddd1d2680d05fe21f54d858db8ba81bd13381598ddc546f7637e33c4407da2ea7da40ea1c96794250e7c14a4d00358b48eeae4d917d6a92bafe4c languageName: node linkType: hard From 0cac7813560e2616c4373f4277eec081cf6f772c Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 23 Sep 2021 10:50:14 +0200 Subject: [PATCH 05/11] Try to fix jest E2E tests --- scripts/integration-tests/e2e-jest.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/integration-tests/e2e-jest.sh b/scripts/integration-tests/e2e-jest.sh index d2695fb95d69..b05ff9f2bcd0 100755 --- a/scripts/integration-tests/e2e-jest.sh +++ b/scripts/integration-tests/e2e-jest.sh @@ -49,6 +49,10 @@ if [ "$BABEL_8_BREAKING" = true ] ; then sed -i 's/t.Noop/any/g' node_modules/@types/babel__traverse/index.d.ts sed -i 's/t.Noop/any/g' node_modules/@types/babel__traverse/ts4.1/index.d.ts + # Temporary update code points in test. The visual result is the same. + sed -i 's/Whoops!\\"<\/>\);<\/><\/>/Whoops!\\"<\/>);/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap + sed -i 's/<\/> \|<\/>/ |/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap + node -e " var pkg = require('./package.json'); pkg.resolutions || (pkg.resolutions = {}); From cb0496c9548317d4e686ed581cd2b14acc18c9e3 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 23 Sep 2021 10:55:19 +0200 Subject: [PATCH 06/11] Fix sed syntax --- scripts/integration-tests/e2e-jest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/integration-tests/e2e-jest.sh b/scripts/integration-tests/e2e-jest.sh index b05ff9f2bcd0..c66ca69757c0 100755 --- a/scripts/integration-tests/e2e-jest.sh +++ b/scripts/integration-tests/e2e-jest.sh @@ -50,8 +50,8 @@ if [ "$BABEL_8_BREAKING" = true ] ; then sed -i 's/t.Noop/any/g' node_modules/@types/babel__traverse/ts4.1/index.d.ts # Temporary update code points in test. The visual result is the same. - sed -i 's/Whoops!\\"<\/>\);<\/><\/>/Whoops!\\"<\/>);/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap - sed -i 's/<\/> \|<\/>/ |/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap + sed -i 's/>);<\/><\/>/>);<\/>/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap + sed -i 's/<\/> |<\/> ^/ | |<\/> ^/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap node -e " var pkg = require('./package.json'); From 400245f92fd9d36440d92ed32a6367a812db3898 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 23 Sep 2021 15:17:20 +0200 Subject: [PATCH 07/11] Move jest hack out of if --- scripts/integration-tests/e2e-jest.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/integration-tests/e2e-jest.sh b/scripts/integration-tests/e2e-jest.sh index c66ca69757c0..e59f7f520d52 100755 --- a/scripts/integration-tests/e2e-jest.sh +++ b/scripts/integration-tests/e2e-jest.sh @@ -41,6 +41,10 @@ startLocalRegistry "$root"/verdaccio-config.yml yarn install yarn dedupe '@babel/*' +# Temporary update code points in test. The visual result is the same. +sed -i 's/>);<\/><\/>/>);<\/>/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap +sed -i 's/<\/> |<\/> ^/ | |<\/> ^/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap + if [ "$BABEL_8_BREAKING" = true ] ; then # This option is removed in Babel 8 sed -i 's/allowDeclareFields: true,\?/\/* allowDeclareFields: true *\//g' babel.config.js @@ -49,10 +53,6 @@ if [ "$BABEL_8_BREAKING" = true ] ; then sed -i 's/t.Noop/any/g' node_modules/@types/babel__traverse/index.d.ts sed -i 's/t.Noop/any/g' node_modules/@types/babel__traverse/ts4.1/index.d.ts - # Temporary update code points in test. The visual result is the same. - sed -i 's/>);<\/><\/>/>);<\/>/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap - sed -i 's/<\/> |<\/> ^/ | |<\/> ^/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap - node -e " var pkg = require('./package.json'); pkg.resolutions || (pkg.resolutions = {}); From 58af0b30c7f347d2ea25de59cb5f23ec81211896 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 23 Sep 2021 15:40:07 +0200 Subject: [PATCH 08/11] Typo --- scripts/integration-tests/e2e-jest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/integration-tests/e2e-jest.sh b/scripts/integration-tests/e2e-jest.sh index e59f7f520d52..207ebdf40a83 100755 --- a/scripts/integration-tests/e2e-jest.sh +++ b/scripts/integration-tests/e2e-jest.sh @@ -43,7 +43,7 @@ yarn dedupe '@babel/*' # Temporary update code points in test. The visual result is the same. sed -i 's/>);<\/><\/>/>);<\/>/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap -sed -i 's/<\/> |<\/> ^/ | |<\/> ^/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap +sed -i 's/<\/> |<\/> ^/ |<\/> ^/g' packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap if [ "$BABEL_8_BREAKING" = true ] ; then # This option is removed in Babel 8 From f1bce71b726def1f2b3a1690c1d3f7d7d4948536 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Sat, 25 Sep 2021 09:48:20 +0200 Subject: [PATCH 09/11] Update Nano Colors --- package.json | 2 +- packages/babel-code-frame/package.json | 2 +- packages/babel-highlight/package.json | 2 +- packages/babel-types/package.json | 2 +- test/esm/package.json | 2 +- yarn.lock | 18 +++++++++--------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 57da1d9698e6..3e4871120658 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "lint-staged": "^9.2.0", "lodash": "^4.17.21", "mergeiterator": "^1.2.5", - "nanocolors": "^0.1.12", + "nanocolors": "^0.2.2", "prettier": "2.3.1", "rollup": "~2.54.0", "rollup-plugin-dts": "^2.0.0", diff --git a/packages/babel-code-frame/package.json b/packages/babel-code-frame/package.json index 5c43c1920f9f..ed699aa02def 100644 --- a/packages/babel-code-frame/package.json +++ b/packages/babel-code-frame/package.json @@ -19,7 +19,7 @@ "@babel/highlight": "workspace:^7.14.5" }, "devDependencies": { - "nanocolors": "^0.1.12", + "nanocolors": "^0.2.2", "strip-ansi": "^4.0.0" }, "engines": { diff --git a/packages/babel-highlight/package.json b/packages/babel-highlight/package.json index 7d72cac91a31..de812e5a8e57 100644 --- a/packages/babel-highlight/package.json +++ b/packages/babel-highlight/package.json @@ -17,7 +17,7 @@ "dependencies": { "@babel/helper-validator-identifier": "workspace:^7.14.5", "js-tokens": "condition:BABEL_8_BREAKING ? ^7.0.0 : ^4.0.0", - "nanocolors": "^0.1.12" + "nanocolors": "^0.2.2" }, "devDependencies": { "strip-ansi": "^4.0.0" diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index ffd2a879efdf..91b4093942f9 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -31,7 +31,7 @@ "@babel/generator": "workspace:*", "@babel/parser": "workspace:*", "glob": "^7.1.7", - "nanocolors": "^0.1.12" + "nanocolors": "^0.2.2" }, "engines": { "node": ">=6.9.0" diff --git a/test/esm/package.json b/test/esm/package.json index 6726e102d50d..be71d54932bc 100644 --- a/test/esm/package.json +++ b/test/esm/package.json @@ -6,6 +6,6 @@ "devDependencies": { "@babel/runtime": "workspace:*", "@babel/runtime-corejs3": "workspace:*", - "nanocolors": "^0.1.12" + "nanocolors": "^0.2.2" } } diff --git a/yarn.lock b/yarn.lock index 9b6092d24ec9..32058786ca08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -174,7 +174,7 @@ __metadata: resolution: "@babel/code-frame@workspace:packages/babel-code-frame" dependencies: "@babel/highlight": "workspace:^7.14.5" - nanocolors: ^0.1.12 + nanocolors: ^0.2.2 strip-ansi: ^4.0.0 languageName: unknown linkType: soft @@ -954,7 +954,7 @@ __metadata: dependencies: "@babel/helper-validator-identifier": "workspace:^7.14.5" js-tokens: "condition:BABEL_8_BREAKING ? ^7.0.0 : ^4.0.0" - nanocolors: ^0.1.12 + nanocolors: ^0.2.2 strip-ansi: ^4.0.0 languageName: unknown linkType: soft @@ -3540,7 +3540,7 @@ __metadata: dependencies: "@babel/runtime": "workspace:*" "@babel/runtime-corejs3": "workspace:*" - nanocolors: ^0.1.12 + nanocolors: ^0.2.2 languageName: unknown linkType: soft @@ -3596,7 +3596,7 @@ __metadata: "@babel/helper-validator-identifier": "workspace:^7.14.9" "@babel/parser": "workspace:*" glob: ^7.1.7 - nanocolors: ^0.1.12 + nanocolors: ^0.2.2 to-fast-properties: ^2.0.0 languageName: unknown linkType: soft @@ -5747,7 +5747,7 @@ __metadata: lint-staged: ^9.2.0 lodash: ^4.17.21 mergeiterator: ^1.2.5 - nanocolors: ^0.1.12 + nanocolors: ^0.2.2 prettier: 2.3.1 rollup: ~2.54.0 rollup-plugin-dts: ^2.0.0 @@ -11580,10 +11580,10 @@ fsevents@^1.2.7: languageName: node linkType: hard -"nanocolors@npm:^0.1.12": - version: 0.1.12 - resolution: "nanocolors@npm:0.1.12" - checksum: 2ce58f57006ddd1d2680d05fe21f54d858db8ba81bd13381598ddc546f7637e33c4407da2ea7da40ea1c96794250e7c14a4d00358b48eeae4d917d6a92bafe4c +"nanocolors@npm:^0.2.2": + version: 0.2.2 + resolution: "nanocolors@npm:0.2.2" + checksum: 87392fa827d033847d08d5b6ef47aceb165856a100dd079de6cc7b749ca5ed5d237e8609b2e64b64f7933aee497f73ccc2930dcefe1cbcb70a253418423d936e languageName: node linkType: hard From bfe5f8dd608083a1f077a1ec1d9e4a15d92c6e0d Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Sat, 25 Sep 2021 10:26:29 +0200 Subject: [PATCH 10/11] Update Nano Colors --- package.json | 2 +- packages/babel-code-frame/package.json | 2 +- packages/babel-highlight/package.json | 2 +- packages/babel-types/package.json | 2 +- test/esm/package.json | 2 +- yarn.lock | 18 +++++++++--------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 3e4871120658..129f077ee2f2 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "lint-staged": "^9.2.0", "lodash": "^4.17.21", "mergeiterator": "^1.2.5", - "nanocolors": "^0.2.2", + "nanocolors": "^0.2.3", "prettier": "2.3.1", "rollup": "~2.54.0", "rollup-plugin-dts": "^2.0.0", diff --git a/packages/babel-code-frame/package.json b/packages/babel-code-frame/package.json index ed699aa02def..1d43f08e29b4 100644 --- a/packages/babel-code-frame/package.json +++ b/packages/babel-code-frame/package.json @@ -19,7 +19,7 @@ "@babel/highlight": "workspace:^7.14.5" }, "devDependencies": { - "nanocolors": "^0.2.2", + "nanocolors": "^0.2.3", "strip-ansi": "^4.0.0" }, "engines": { diff --git a/packages/babel-highlight/package.json b/packages/babel-highlight/package.json index de812e5a8e57..c3d12b800821 100644 --- a/packages/babel-highlight/package.json +++ b/packages/babel-highlight/package.json @@ -17,7 +17,7 @@ "dependencies": { "@babel/helper-validator-identifier": "workspace:^7.14.5", "js-tokens": "condition:BABEL_8_BREAKING ? ^7.0.0 : ^4.0.0", - "nanocolors": "^0.2.2" + "nanocolors": "^0.2.3" }, "devDependencies": { "strip-ansi": "^4.0.0" diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index 91b4093942f9..386a7ded848a 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -31,7 +31,7 @@ "@babel/generator": "workspace:*", "@babel/parser": "workspace:*", "glob": "^7.1.7", - "nanocolors": "^0.2.2" + "nanocolors": "^0.2.3" }, "engines": { "node": ">=6.9.0" diff --git a/test/esm/package.json b/test/esm/package.json index be71d54932bc..a18293a94058 100644 --- a/test/esm/package.json +++ b/test/esm/package.json @@ -6,6 +6,6 @@ "devDependencies": { "@babel/runtime": "workspace:*", "@babel/runtime-corejs3": "workspace:*", - "nanocolors": "^0.2.2" + "nanocolors": "^0.2.3" } } diff --git a/yarn.lock b/yarn.lock index 32058786ca08..17d65c9cac5b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -174,7 +174,7 @@ __metadata: resolution: "@babel/code-frame@workspace:packages/babel-code-frame" dependencies: "@babel/highlight": "workspace:^7.14.5" - nanocolors: ^0.2.2 + nanocolors: ^0.2.3 strip-ansi: ^4.0.0 languageName: unknown linkType: soft @@ -954,7 +954,7 @@ __metadata: dependencies: "@babel/helper-validator-identifier": "workspace:^7.14.5" js-tokens: "condition:BABEL_8_BREAKING ? ^7.0.0 : ^4.0.0" - nanocolors: ^0.2.2 + nanocolors: ^0.2.3 strip-ansi: ^4.0.0 languageName: unknown linkType: soft @@ -3540,7 +3540,7 @@ __metadata: dependencies: "@babel/runtime": "workspace:*" "@babel/runtime-corejs3": "workspace:*" - nanocolors: ^0.2.2 + nanocolors: ^0.2.3 languageName: unknown linkType: soft @@ -3596,7 +3596,7 @@ __metadata: "@babel/helper-validator-identifier": "workspace:^7.14.9" "@babel/parser": "workspace:*" glob: ^7.1.7 - nanocolors: ^0.2.2 + nanocolors: ^0.2.3 to-fast-properties: ^2.0.0 languageName: unknown linkType: soft @@ -5747,7 +5747,7 @@ __metadata: lint-staged: ^9.2.0 lodash: ^4.17.21 mergeiterator: ^1.2.5 - nanocolors: ^0.2.2 + nanocolors: ^0.2.3 prettier: 2.3.1 rollup: ~2.54.0 rollup-plugin-dts: ^2.0.0 @@ -11580,10 +11580,10 @@ fsevents@^1.2.7: languageName: node linkType: hard -"nanocolors@npm:^0.2.2": - version: 0.2.2 - resolution: "nanocolors@npm:0.2.2" - checksum: 87392fa827d033847d08d5b6ef47aceb165856a100dd079de6cc7b749ca5ed5d237e8609b2e64b64f7933aee497f73ccc2930dcefe1cbcb70a253418423d936e +"nanocolors@npm:^0.2.3": + version: 0.2.3 + resolution: "nanocolors@npm:0.2.3" + checksum: e2167b904cec141dcb0ec869a59ca3027403559c3ba0b546eb1c85e89056fd6d77795e891160ca527119a4d88c52f33d51dc3ddf7825594b7ca8392ffc1ad9d5 languageName: node linkType: hard From 1615e42a3745a196cd06a95159c023682eabd964 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Sat, 25 Sep 2021 11:58:11 +0200 Subject: [PATCH 11/11] Fix resolver for dual ESM/CJS packages --- test/jestExportsMapResolver.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jestExportsMapResolver.cjs b/test/jestExportsMapResolver.cjs index 5d3c7b91438e..228a24b3f30f 100644 --- a/test/jestExportsMapResolver.cjs +++ b/test/jestExportsMapResolver.cjs @@ -26,6 +26,6 @@ function getResolver(conditionNames) { } module.exports = function (request, options) { - const resolver = getResolver(options.conditions || ["default"]); + const resolver = getResolver(options.conditions || ["require", "default"]); return resolver(options.basedir, request); };