From 2ef29b36c76b6e697446cf5f5ad8a887e22cfdb8 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Mon, 14 Mar 2022 09:02:20 +0000 Subject: [PATCH 01/28] Add link to community plugins list (#12443) Co-authored-by: fisker Cheung --- website/data/languages.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/data/languages.yml b/website/data/languages.yml index f7026c70a..8dd807916 100644 --- a/website/data/languages.yml +++ b/website/data/languages.yml @@ -40,6 +40,7 @@ image: /images/languages/tools_yaml.svg variants: [] - name: Community Plugins + nameLink: ./docs/en/plugins.html#community-plugins showName: true image: /images/languages/tools_wip.svg variants: @@ -50,3 +51,4 @@ - "[Ruby](https://github.com/prettier/plugin-ruby)" - "[TOML](https://github.com/bd82/toml-tools/tree/master/packages/prettier-plugin-toml)" - "[XML](https://github.com/prettier/plugin-xml)" + - "[And more...](./docs/en/plugins.html#community-plugins)" From 6064a88fedd5c0b0f6876d24122706ad4b150f07 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 14 Mar 2022 20:02:02 +0800 Subject: [PATCH 02/28] Add `esbuildPluginReplaceText` (#12451) --- package.json | 1 - scripts/build/bundler.mjs | 25 ++- scripts/build/config.mjs | 209 +++++++++++------- .../build/esbuild-plugins/replace-text.mjs | 34 +++ yarn.lock | 16 +- 5 files changed, 185 insertions(+), 100 deletions(-) create mode 100644 scripts/build/esbuild-plugins/replace-text.mjs diff --git a/package.json b/package.json index 392bd90c4..a44093549 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,6 @@ "cspell": "5.19.0", "enquirer": "2.3.6", "esbuild": "0.14.25", - "esbuild-plugin-text-replace": "1.2.0", "esbuild-visualizer": "0.3.1", "eslint": "8.11.0", "eslint-config-prettier": "8.5.0", diff --git a/scripts/build/bundler.mjs b/scripts/build/bundler.mjs index c041dc55b..548191a88 100644 --- a/scripts/build/bundler.mjs +++ b/scripts/build/bundler.mjs @@ -4,11 +4,11 @@ import createEsmUtils from "esm-utils"; import * as babel from "@babel/core"; import esbuild from "esbuild"; import { NodeModulesPolyfillPlugin as esbuildPluginNodeModulePolyfills } from "@esbuild-plugins/node-modules-polyfill"; -import esbuildPluginTextReplace from "esbuild-plugin-text-replace"; import browserslistToEsbuild from "browserslist-to-esbuild"; import { PROJECT_ROOT, DIST_DIR } from "../utils/index.mjs"; import esbuildPluginEvaluate from "./esbuild-plugins/evaluate.mjs"; import esbuildPluginReplaceModule from "./esbuild-plugins/replace-module.mjs"; +import esbuildPluginReplaceText from "./esbuild-plugins/replace-text.mjs"; import esbuildPluginLicense from "./esbuild-plugins/license.mjs"; import esbuildPluginUmd from "./esbuild-plugins/umd.mjs"; import esbuildPluginVisualizer from "./esbuild-plugins/visualizer.mjs"; @@ -76,10 +76,14 @@ const bundledFiles = [ })); function* getEsbuildOptions(bundle, buildOptions) { - const replaceStrings = { + const replaceText = [ // `tslib` exports global variables - "createExporter(root": "createExporter({}", - }; + { + file: require.resolve("tslib"), + find: "factory(createExporter(root", + replacement: "factory(createExporter({}", + }, + ]; const define = { "process.env.PRETTIER_TARGET": JSON.stringify(bundle.target), @@ -89,7 +93,11 @@ function* getEsbuildOptions(bundle, buildOptions) { if (bundle.target === "universal") { // We can't reference `process` in UMD bundles and this is // an undocumented "feature" - replaceStrings["process.env.PRETTIER_DEBUG"] = "globalThis.PRETTIER_DEBUG"; + replaceText.push({ + file: "*", + find: "process.env.PRETTIER_DEBUG", + replacement: "globalThis.PRETTIER_DEBUG", + }); define.process = JSON.stringify({ env: {}, argv: [] }); @@ -148,10 +156,9 @@ function* getEsbuildOptions(bundle, buildOptions) { esbuildPluginEvaluate(), esbuildPluginReplaceModule({ ...replaceModule, ...bundle.replaceModule }), bundle.target === "universal" && esbuildPluginNodeModulePolyfills(), - esbuildPluginTextReplace({ - include: /\.[cm]?js$/, - // TODO[@fisker]: Use RegExp when possible - pattern: Object.entries({ ...replaceStrings, ...bundle.replace }), + esbuildPluginReplaceText({ + filter: /\.[cm]?js$/, + replacements: [...replaceText, ...(bundle.replaceText ?? [])], }), buildOptions.onLicenseFound && esbuildPluginLicense({ diff --git a/scripts/build/config.mjs b/scripts/build/config.mjs index 238569533..3b3d4e164 100644 --- a/scripts/build/config.mjs +++ b/scripts/build/config.mjs @@ -13,7 +13,7 @@ const { require } = createEsmUtils(import.meta); * @property {'core' | 'plugin'} type - it's a plugin bundle or core part of prettier * @property {string[]} external - array of paths that should not be included in the final bundle * @property {Object.} replaceModule - module replacement path or code - * @property {Object.} replace - map of strings to replace when processing the bundle + * @property {{file: string, find: string, replacement: string}[]} replaceText - Text replacements * @property {string[]} babelPlugins - babel plugins * @property {boolean?} minify - minify * @property {string[]?} esbuildTarget - ESBuild target @@ -30,68 +30,104 @@ const parsers = [ }, { input: "src/language-js/parse/flow.js", - replace: { + replaceText: [ // `flow-parser` use this for `globalThis`, can't work in strictMode - "(function(){return this}())": "(globalThis)", - }, + { + file: require.resolve("flow-parser"), + find: "(function(){return this}())", + replacement: "(globalThis)", + }, + ], }, { input: "src/language-js/parse/typescript.js", - replace: { - // `typescript/lib/typescript.js` expose extra global objects - // `TypeScript`, `toolsVersion`, `globalThis` - 'typeof process === "undefined" || process.browser': "false", - 'typeof globalThis === "object"': "true", + replaceText: [ // `@typescript-eslint/typescript-estree` v4 - 'require("globby")': "{}", - "extra.projects = prepareAndTransformProjects(": - "extra.projects = [] || prepareAndTransformProjects(", - "process.versions.node": JSON.stringify("999.999.999"), - "process.cwd()": JSON.stringify("/prettier-security-dirname-placeholder"), - // `rollup-plugin-polyfill-node` don't have polyfill for these modules - 'require("perf_hooks")': "{}", - 'require("inspector")': "{}", - "_fs.realpathSync.native": "_fs.realpathSync && _fs.realpathSync.native", - // Remove useless `ts.sys` - "ts.sys = ": "ts.sys = undefined && ", + { + file: "*", + find: 'require("globby")', + replacement: "{}", + }, + { + file: "*", + find: "extra.projects = prepareAndTransformProjects(", + replacement: "extra.projects = [] || prepareAndTransformProjects(", + }, + { + file: "*", + find: "process.versions.node", + replacement: JSON.stringify("999.999.999"), + }, + { + file: "*", + find: "process.cwd()", + replacement: JSON.stringify("/prettier-security-dirname-placeholder"), + }, + { + file: "*", + find: 'require("perf_hooks")', + replacement: "{}", + }, + { + file: "*", + find: 'require("inspector")', + replacement: "{}", + }, + { + file: "*", + find: "typescriptVersionIsAtLeast[version] = semverCheck(version);", + replacement: "typescriptVersionIsAtLeast[version] = true;", + }, - // Remove useless language service - "ts.realizeDiagnostics = ": "ts.realizeDiagnostics = undefined && ", - "ts.TypeScriptServicesFactory = ": - "ts.TypeScriptServicesFactory = undefined && ", - "var ShimBase = ": "var ShimBase = undefined && ", - "var TypeScriptServicesFactory = ": - "var TypeScriptServicesFactory = undefined && ", - "var LanguageServiceShimObject = ": - "var LanguageServiceShimObject = undefined && ", - "var CoreServicesShimHostAdapter = ": - "var CoreServicesShimHostAdapter = undefined && ", - "var LanguageServiceShimHostAdapter = ": - "var LanguageServiceShimHostAdapter = undefined && ", - "var ScriptSnapshotShimAdapter = ": - "var ScriptSnapshotShimAdapter = undefined && ", - "var ClassifierShimObject = ": "var ClassifierShimObject = undefined && ", - "var CoreServicesShimObject = ": - "var CoreServicesShimObject = undefined && ", - "function simpleForwardCall(": "0 && function simpleForwardCall(", - "function forwardJSONCall(": "0 && function forwardJSONCall(", - "function forwardCall(": "0 && function forwardCall(", - "function realizeDiagnostics(": "0 && function realizeDiagnostics(", - "function realizeDiagnostic(": "0 && function realizeDiagnostic(", - "function convertClassifications(": - "0 && function convertClassifications(", + ...Object.entries({ + // `typescript/lib/typescript.js` expose extra global objects + // `TypeScript`, `toolsVersion`, `globalThis` + 'typeof process === "undefined" || process.browser': "false", + 'typeof globalThis === "object"': "true", - // Dynamic `require()`s - "ts.sys && ts.sys.require": "false", - "require(etwModulePath)": "undefined", - 'require("source-map-support").install()': "", - "require(modulePath)": "undefined", - // `node-semver` can't work with `@rollup/plugin-commonjs>=19.0.0` - // https://github.com/rollup/plugins/issues/879 - // https://github.com/npm/node-semver/issues/381 - "typescriptVersionIsAtLeast[version] = semverCheck(version);": - "typescriptVersionIsAtLeast[version] = true;", - }, + "_fs.realpathSync.native": + "_fs.realpathSync && _fs.realpathSync.native", + // Remove useless `ts.sys` + "ts.sys = ": "ts.sys = undefined && ", + + // Remove useless language service + "ts.realizeDiagnostics = ": "ts.realizeDiagnostics = undefined && ", + "ts.TypeScriptServicesFactory = ": + "ts.TypeScriptServicesFactory = undefined && ", + "var ShimBase = ": "var ShimBase = undefined && ", + "var TypeScriptServicesFactory = ": + "var TypeScriptServicesFactory = undefined && ", + "var LanguageServiceShimObject = ": + "var LanguageServiceShimObject = undefined && ", + "var CoreServicesShimHostAdapter = ": + "var CoreServicesShimHostAdapter = undefined && ", + "var LanguageServiceShimHostAdapter = ": + "var LanguageServiceShimHostAdapter = undefined && ", + "var ScriptSnapshotShimAdapter = ": + "var ScriptSnapshotShimAdapter = undefined && ", + "var ClassifierShimObject = ": + "var ClassifierShimObject = undefined && ", + "var CoreServicesShimObject = ": + "var CoreServicesShimObject = undefined && ", + "function simpleForwardCall(": "0 && function simpleForwardCall(", + "function forwardJSONCall(": "0 && function forwardJSONCall(", + "function forwardCall(": "0 && function forwardCall(", + "function realizeDiagnostics(": "0 && function realizeDiagnostics(", + "function realizeDiagnostic(": "0 && function realizeDiagnostic(", + "function convertClassifications(": + "0 && function convertClassifications(", + + // Dynamic `require()`s + "ts.sys && ts.sys.require": "false", + "require(etwModulePath)": "undefined", + 'require("source-map-support").install()': "", + "require(modulePath)": "undefined", + }).map(([find, replacement]) => ({ + file: require.resolve("typescript"), + find, + replacement, + })), + ], replaceModule: { [require.resolve("debug")]: require.resolve("./shims/debug.cjs"), }, @@ -101,27 +137,43 @@ const parsers = [ name: "prettierPlugins.espree", // TODO: Rename this file to `parser-acorn-and-espree.js` or find a better way output: "parser-espree.js", - replace: { - "const Syntax = ": "const Syntax = undefined && ", - "var visitorKeys = ": "var visitorKeys = undefined && ", - }, + replaceText: [ + { + file: require.resolve("espree"), + find: "const Syntax = (function() {", + replacement: "const Syntax = undefined && (function() {", + }, + { + file: require.resolve("espree"), + find: "var visitorKeys = require('eslint-visitor-keys');", + replacement: "var visitorKeys;", + }, + ], }, { input: "src/language-js/parse/meriyah.js", }, { input: "src/language-js/parse/angular.js", - replace: { - "@angular/compiler/src": "@angular/compiler/esm2015/src", - }, + replaceText: [ + { + file: "*", + find: 'require("@angular/compiler/src/', + replacement: 'require("@angular/compiler/esm2015/src/', + }, + ], }, { input: "src/language-css/parser-postcss.js", - replace: { - // `postcss-values-parser` uses constructor.name, it will be changed by rollup or terser - // https://github.com/shellscape/postcss-values-parser/blob/c00f858ab8c86ce9f06fdb702e8f26376f467248/lib/parser.js#L499 - "node.constructor.name === 'Word'": "node.type === 'word'", - }, + replaceText: [ + { + // `postcss-values-parser` uses constructor.name, it will be changed by bundler + // https://github.com/shellscape/postcss-values-parser/blob/c00f858ab8c86ce9f06fdb702e8f26376f467248/lib/parser.js#L499 + file: require.resolve("postcss-values-parser/lib/parser.js"), + find: "node.constructor.name === 'Word'", + replacement: "node.type === 'word'", + }, + ], }, { input: "src/language-graphql/parser-graphql.js", @@ -170,10 +222,13 @@ const parsers = [ const coreBundles = [ { input: "src/index.js", - replace: { - // from @iarna/toml/parse-string - "eval(\"require('util').inspect\")": "require('util').inspect", - }, + replaceText: [ + { + file: require.resolve("@iarna/toml/lib/toml-parser.js"), + find: "const utilInspect = eval(\"require('util').inspect\")", + replacement: "const utilInspect = require('util').inspect", + }, + ], }, { input: "src/document/index.js", @@ -208,10 +263,14 @@ const coreBundles = [ }, { input: "src/common/third-party.js", - replace: { + replaceText: [ // cosmiconfig@6 -> import-fresh can't find parentModule, since module is bundled - "parentModule(__filename)": "__filename", - }, + { + file: require.resolve("import-fresh"), + find: "parentModule(__filename)", + replacement: "__filename", + }, + ], }, ].map((bundle) => ({ type: "core", diff --git a/scripts/build/esbuild-plugins/replace-text.mjs b/scripts/build/esbuild-plugins/replace-text.mjs new file mode 100644 index 000000000..a6dcf7289 --- /dev/null +++ b/scripts/build/esbuild-plugins/replace-text.mjs @@ -0,0 +1,34 @@ +import fs from "node:fs/promises"; + +function replaceText(text, options) { + return text.replaceAll(options.find, options.replacement); +} + +export default function esbuildPluginReplaceText({ + filter = /./, + replacements, +}) { + for (const replacement of replacements) { + if (!replacement.file) { + throw new Error("'file' option is required."); + } + } + + return { + name: "replace-text", + setup(build) { + build.onLoad({ filter }, async ({ path: file }) => { + let text = await fs.readFile(file, "utf8"); + + for (const replacement of replacements) { + if (replacement.file !== "*" && replacement.file !== file) { + continue; + } + text = replaceText(text, replacement); + } + + return { contents: text }; + }); + }, + }; +} diff --git a/yarn.lock b/yarn.lock index 3a601c424..36b3003fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2364,7 +2364,7 @@ core-js-compat@^3.20.2, core-js-compat@^3.21.0: browserslist "^4.19.1" semver "7.0.0" -core-js@3.21.1, core-js@^3.16.2, core-js@^3.4.1: +core-js@3.21.1, core-js@^3.16.2: version "3.21.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.21.1.tgz#f2e0ddc1fc43da6f904706e8e955bc19d06a0d94" integrity sha512-FRq5b/VMrWlrmCzwRrpDYNxyHP9BcAZC+xHJaqTgIE5091ZV1NTmyh0sGOg5XqpnHvR0svdy0sv1gWA1zmhxig== @@ -2834,13 +2834,6 @@ esbuild-openbsd-64@0.14.25: resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.25.tgz#31ebf616aadf6e60674469f2b92cec92280d9930" integrity sha512-QgFJ37A15D7NIXBTYEqz29+uw3nNBOIyog+3kFidANn6kjw0GHZ0lEYQn+cwjyzu94WobR+fes7cTl/ZYlHb1A== -esbuild-plugin-text-replace@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/esbuild-plugin-text-replace/-/esbuild-plugin-text-replace-1.2.0.tgz#43d87d88c5c1314151d8046d490aa21605fe1feb" - integrity sha512-04kdAMjxqGG+TEV/F+uGQVMFZlh65Eb11xo8b532io8FjOg5x2faoCXGicJo97BovXYARCPUhiZEECKZrFQq7Q== - dependencies: - ts-replace-all "^1.0.0" - esbuild-sunos-64@0.14.25: version "0.14.25" resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.25.tgz#815e4f936d74970292a63ccfd5791fe5e3569f5f" @@ -6245,13 +6238,6 @@ trough@^1.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA== -ts-replace-all@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ts-replace-all/-/ts-replace-all-1.0.0.tgz#ef28283ccdb4da7d69fb03cf543e09e51711659b" - integrity sha512-6uBtdkw3jHXkPtx/e9xB/5vcngMm17CyJYsS2YZeQ+9FdRnt6Ev5g931Sg2p+dxbtMGoCm13m3ax/obicTZIkQ== - dependencies: - core-js "^3.4.1" - tsconfig-paths@^3.12.0: version "3.12.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" From 9da21a92228c7d3f7bde9f5c1a3ba7eba9d48ec9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Mar 2022 23:55:26 +0800 Subject: [PATCH 03/28] Build(deps-dev): Bump esbuild from 0.14.25 to 0.14.26 (#12452) Bumps [esbuild](https://github.com/evanw/esbuild) from 0.14.25 to 0.14.26. - [Release notes](https://github.com/evanw/esbuild/releases) - [Changelog](https://github.com/evanw/esbuild/blob/master/CHANGELOG.md) - [Commits](https://github.com/evanw/esbuild/compare/v0.14.25...v0.14.26) --- updated-dependencies: - dependency-name: esbuild dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 208 +++++++++++++++++++++++++-------------------------- 2 files changed, 105 insertions(+), 105 deletions(-) diff --git a/package.json b/package.json index a44093549..fde3a1b6d 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "cross-env": "7.0.3", "cspell": "5.19.0", "enquirer": "2.3.6", - "esbuild": "0.14.25", + "esbuild": "0.14.26", "esbuild-visualizer": "0.3.1", "eslint": "8.11.0", "eslint-config-prettier": "8.5.0", diff --git a/yarn.lock b/yarn.lock index 36b3003fc..23b4f07d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2754,90 +2754,90 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -esbuild-android-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.25.tgz#d532d38cb5fe0ae45167ce35f4bbc784c636be40" - integrity sha512-L5vCUk7TzFbBnoESNoXjU3x9+/+7TDIE/1mTfy/erAfvZAqC+S3sp/Qa9wkypFMcFvN9FzvESkTlpeQDolREtQ== +esbuild-android-64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.26.tgz#c5cc52e1372b680e3e782583fa826b248a550a3d" + integrity sha512-HIyJ3VvigHfseaI0D+vsD8zKQ4roDUD962/vtO/KXzav6wR//Y//Qx1HUX8k5bQeQ7/0yCXlltY9VBw1MFnWFQ== -esbuild-android-arm64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.25.tgz#9c5bb3366aabfd14a1c726d36978b79441dfcb6e" - integrity sha512-4jv5xPjM/qNm27T5j3ZEck0PvjgQtoMHnz4FzwF5zNP56PvY2CT0WStcAIl6jNlsuDdN63rk2HRBIsO6xFbcFw== +esbuild-android-arm64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.26.tgz#675695134565b0a39d8e3f7a0bd0f4c1ddea5f29" + integrity sha512-TxRCLxyU5yj3U8Bud9fCg3IxzIXXKaWcmDbvURm8JkRr0WvCAmwZBdLi5T8BasT1v5vrVE//M0KSHZod6HC6lA== -esbuild-darwin-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.25.tgz#05dcdb6d884f427039ffee5e92ff97527e56c26d" - integrity sha512-TGp8tuudIxOyWd1+8aYPxQmC1ZQyvij/AfNBa35RubixD0zJ1vkKHVAzo0Zao1zcG6pNqiSyzfPto8vmg0s7oA== +esbuild-darwin-64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.26.tgz#7d83ba28bf178d21645b8118cb3280aad84e30ff" + integrity sha512-oZJBN+CkR47Fc7KB1vowZy2kb5r+WSnsBjVEw7aI8HmR6louAgTr4bs1NwzaF6MbLi41ajaw6RdipfsM1H9PvQ== -esbuild-darwin-arm64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.25.tgz#28e080da4ea0cfe9498071e7f8060498caee1a95" - integrity sha512-oTcDgdm0MDVEmw2DWu8BV68pYuImpFgvWREPErBZmNA4MYKGuBRaCiJqq6jZmBR1x+3y1DWCjez+5uLtuAm6mw== +esbuild-darwin-arm64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.26.tgz#4567ade51ba2f5f46c32a5b08880a93c7a683440" + integrity sha512-eYW+cmP3BGVPDp+wd9bRI5CN5HjkZnrMQtj46Mj//UsSh4SRvflAp3pjs3ooA+MCpIa9xZ8091HqLqpYi7KFWA== -esbuild-freebsd-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.25.tgz#200d3664a3b945bc9fdcba73614b49a11ebd1cfa" - integrity sha512-ueAqbnMZ8arnuLH8tHwTCQYeptnHOUV7vA6px6j4zjjQwDx7TdP7kACPf3TLZLdJQ3CAD1XCvQ2sPhX+8tacvQ== +esbuild-freebsd-64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.26.tgz#e03526cd6e5e06e6b3ba405524d62b486bd5519a" + integrity sha512-Q+Hs27fSBkNfUHNhphSyWfF5lxl3o9S6LFlzkC5KofxLCnCESP+7YTzAWTosYGANsPT2mvYFOraFeYEokG+5DA== -esbuild-freebsd-arm64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.25.tgz#624b08c5da6013bdc312aaa23c4ff409580f5c3c" - integrity sha512-+ZVWud2HKh+Ob6k/qiJWjBtUg4KmJGGmbvEXXW1SNKS7hW7HU+Zq2ZCcE1akFxOPkVB+EhOty/sSek30tkCYug== +esbuild-freebsd-arm64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.26.tgz#7ddbbefdb51edcc48158aa8752041090a1e54f22" + integrity sha512-MT+FuC/63oz6j/jvWOMCNqnHBYm/bNhGPArUgQX8GRhofFCeqe0NRmJbhtlHZaEeErIIjHPZQ/nXs34mfiqo/Q== -esbuild-linux-32@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.25.tgz#0238e597eb0b60aa06c7e98fccbbfd6bb9a0d6c5" - integrity sha512-3OP/lwV3kCzEz45tobH9nj+uE4ubhGsfx+tn0L26WAGtUbmmcRpqy7XRG/qK7h1mClZ+eguIANcQntYMdYklfw== +esbuild-linux-32@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.26.tgz#82d8c050dac0d1103dec2ad6537e419dc2247476" + integrity sha512-9gqSfJ8qMDvz7wXZoinNoe9/ekPpbT+/ZgVfZEeB72ETITVPHvMbG8i0E12wG366G01vMXtlxbD9IYJsMVhe6w== -esbuild-linux-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.25.tgz#8a8b8cf47dfce127c858e71229d9a385a82c62e8" - integrity sha512-+aKHdHZmX9qwVlQmu5xYXh7GsBFf4TWrePgeJTalhXHOG7NNuUwoHmketGiZEoNsWyyqwH9rE5BC+iwcLY30Ug== +esbuild-linux-64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.26.tgz#f06b38cc28d84c688b587a54125c0122bf871c07" + integrity sha512-aPku1lCxxXmBr5LkENSlGIbY33jjQExDzaSrNV+dDA5bHXhFnpI9UkSe+vQzrSkxgO66vNjSTNDcxg3pOXBaBw== -esbuild-linux-arm64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.25.tgz#7ac94371418a2640ba413bc1700aaedeb2794e52" - integrity sha512-UxfenPx/wSZx55gScCImPtXekvZQLI2GW3qe5dtlmU7luiqhp5GWPzGeQEbD3yN3xg/pHc671m5bma5Ns7lBHw== +esbuild-linux-arm64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.26.tgz#235a70b2f71933f814e8b14531c584974b52d972" + integrity sha512-S0boyzv5Yx+IN1A8253nEPzHqn/W/y+CRcLYFZ1E5DscqkY7EvBao6rhff3ZxaHU9Zrkn0pLVqlJdMx3rm6D4Q== -esbuild-linux-arm@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.25.tgz#034bd18e9310b9f010c89f90ef7f05706689600b" - integrity sha512-aTLcE2VBoLydL943REcAcgnDi3bHtmULSXWLbjtBdtykRatJVSxKMjK9YlBXUZC4/YcNQfH7AxwVeQr9fNxPhw== +esbuild-linux-arm@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.26.tgz#709a303ae0794457d6c41d0df4f3fafb9de24b1d" + integrity sha512-m7ozLQozfgBmh9l3HWxDEVYEEG8GuTqzRoFuf9iX0xAlbtqmhhlm7M4zNMa2eyPEG+ejgHndAuvuB1hcOWvdJw== -esbuild-linux-mips64le@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.25.tgz#05f98a8cf6b578eab6b4e6b0ab094f37530934f4" - integrity sha512-wLWYyqVfYx9Ur6eU5RT92yJVsaBGi5RdkoWqRHOqcJ38Kn60QMlcghsKeWfe9jcYut8LangYZ98xO1LxIoSXrQ== +esbuild-linux-mips64le@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.26.tgz#b1a26af4e33d36dafea7579f876c5e2041c2236e" + integrity sha512-TyMRc2ctQV1g9ruHg1Y793e18uDigKKsgzcZPzfxZi2z+hGK1uaSdaejGdULEJBJVMXt3/NC1T1yq0vCTiYYgg== -esbuild-linux-ppc64le@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.25.tgz#46fd0add8d8535678439d7a9c2876ad20042d952" - integrity sha512-0dR6Csl6Zas3g4p9ULckEl8Mo8IInJh33VCJ3eaV1hj9+MHGdmDOakYMN8MZP9/5nl+NU/0ygpd14cWgy8uqRw== +esbuild-linux-ppc64le@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.26.tgz#1de1b2e5d93e3327b3a66520722ed8cb7d8d606a" + integrity sha512-aOJPP80m2gV8CyDqEMGbwZaGKuR45tZU1qYZ0+Cy8lWV4CWmd9iBWhCLP3eI9d7163m6t+0YO/6N3iLSVlNnpA== -esbuild-linux-riscv64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.25.tgz#ea2e986f0f3e5df73c635135dd778051734fc605" - integrity sha512-J4d20HDmTrgvhR0bdkDhvvJGaikH3LzXQnNaseo8rcw9Yqby9A90gKUmWpfwqLVNRILvNnAmKLfBjCKU9ajg8w== +esbuild-linux-riscv64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.26.tgz#4dc147218a2ed5c796fe1abc832703fd4e991108" + integrity sha512-2E5xK7SNZFXhFzRbZGtUqg3MbHnrx5XzqHaGLOLdHBqOSWIAdJKB3w6WtjpLkZvPuWrKeh51XnRpk1jm0TsUjQ== -esbuild-linux-s390x@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.25.tgz#efe89486e9a1b1508925048076e3f3a6698aa6a3" - integrity sha512-YI2d5V6nTE73ZnhEKQD7MtsPs1EtUZJ3obS21oxQxGbbRw1G+PtJKjNyur+3t6nzHP9oTg6GHQ3S3hOLLmbDIQ== +esbuild-linux-s390x@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.26.tgz#12affff5f2d820e238cc5aa9aa7fd5f8f53c8d64" + integrity sha512-kfSuFea857mTYMp/RAFmMp9TBjf1T8F/dTRqLn2p+g8Ok30Cp1+mI2+YCmxz5Uw2JOfxyvpND0Ek1PGPMo1UsQ== -esbuild-netbsd-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.25.tgz#439fe27d8ee3b5887501ee63988e85f920107db6" - integrity sha512-TKIVgNWLUOkr+Exrye70XTEE1lJjdQXdM4tAXRzfHE9iBA7LXWcNtVIuSnphTqpanPzTDFarF0yqq4kpbC6miA== +esbuild-netbsd-64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.26.tgz#7a1a0962f0c15e5ff945004626e9f038da0076bb" + integrity sha512-tWhLwfOOqdZRwvaSYIWuic9Cj+WRRCLHe//Bmlf0ThBur9/EssRTtVh6/rC2Okp7Eb4QcerA/1wjWLYLECYD7g== -esbuild-openbsd-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.25.tgz#31ebf616aadf6e60674469f2b92cec92280d9930" - integrity sha512-QgFJ37A15D7NIXBTYEqz29+uw3nNBOIyog+3kFidANn6kjw0GHZ0lEYQn+cwjyzu94WobR+fes7cTl/ZYlHb1A== +esbuild-openbsd-64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.26.tgz#68e2949986fba77f17dfb86ee5b4e1f37cd302ca" + integrity sha512-Xj7IWpsPn/hgKNzwjLpnf6wMtV0lfw5bzn7N9vmiCKx9TBA28L2hI8G15O0s9atLKny4HpmCGwZWmReNF1Ui6g== -esbuild-sunos-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.25.tgz#815e4f936d74970292a63ccfd5791fe5e3569f5f" - integrity sha512-rmWfjUItYIVlqr5EnTH1+GCxXiBOC42WBZ3w++qh7n2cS9Xo0lO5pGSG2N+huOU2fX5L+6YUuJ78/vOYvefeFw== +esbuild-sunos-64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.26.tgz#a5c7930a7e86b7bd696aaf8379fd761d4feb1332" + integrity sha512-5odPsuhghCUYc3c1gEtz6pGq9cuGRDq1+iNdLBjZcz6IUebd0ay/AVORWchs5WddzyJA9hguxrKsPjECxX6OzQ== esbuild-visualizer@0.3.1: version "0.3.1" @@ -2848,46 +2848,46 @@ esbuild-visualizer@0.3.1: open "^7.4.2" yargs "^16.2.0" -esbuild-windows-32@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.25.tgz#189e14df2478f2c193c86968ab1fb54e1ceaafd2" - integrity sha512-HGAxVUofl3iUIz9W10Y9XKtD0bNsK9fBXv1D55N/ljNvkrAYcGB8YCm0v7DjlwtyS6ws3dkdQyXadbxkbzaKOA== +esbuild-windows-32@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.26.tgz#3eb5b7702355487e5939992f2cff2b0afdee9aa1" + integrity sha512-xSVyGV6xGQlAC/K+oBXC9YiGGqoKqQGXVEFQKlDGXD6rxHGK5Fch0ynuvkjaYWW/p8OWqxGVYcof5BvGjY49RA== -esbuild-windows-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.25.tgz#3d5fbfdc3856850bb47439299e3b60dd18be111f" - integrity sha512-TirEohRkfWU9hXLgoDxzhMQD1g8I2mOqvdQF2RS9E/wbkORTAqJHyh7wqGRCQAwNzdNXdg3JAyhQ9/177AadWA== +esbuild-windows-64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.26.tgz#7fb4bf6e1ad27ecd463294df6ad60b27c9f09197" + integrity sha512-Q0Bm42+wIqHJ8yF96T7nXosILXROegRtMmuI1L0kry0YBHnCFMtjNRTyUwv8yi7o2XvVYh7DF0NHLDL4N34MuA== -esbuild-windows-arm64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.25.tgz#8b243cbbad8a86cf98697da9ccb88c05df2ef458" - integrity sha512-4ype9ERiI45rSh+R8qUoBtaj6kJvUOI7oVLhKqPEpcF4Pa5PpT3hm/mXAyotJHREkHpM87PAJcA442mLnbtlNA== +esbuild-windows-arm64@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.26.tgz#3bff0b46a884ff8de3f6f5a82b171b08012b78e0" + integrity sha512-+l0DB0VV4LiSoDfNsGviK/2M88IR+/fOUfQoQx08RPu7OZ7gv9BqhRLZCSCT4qHT351OTH1nPv7avRXX6JRQcg== -esbuild@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.25.tgz#ddb9d47b91ca76abb7d850ce3dfed0bc3dc88d16" - integrity sha512-4JHEIOMNFvK09ziiL+iVmldIhLbn49V4NAVo888tcGFKedEZY/Y8YapfStJ6zSE23tzYPKxqKwQBnQoIO0BI/Q== +esbuild@0.14.26: + version "0.14.26" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.26.tgz#c83493ef55163d976241cc8ed077baf991f21201" + integrity sha512-v0zIYlFB9NZ82/hFljhvpA7f8rob66r68ymB7juMz6TYAAMYjKGoW+hrMfRRvic5MAOI2wE/SuykFvsELLa6eA== optionalDependencies: - esbuild-android-64 "0.14.25" - esbuild-android-arm64 "0.14.25" - esbuild-darwin-64 "0.14.25" - esbuild-darwin-arm64 "0.14.25" - esbuild-freebsd-64 "0.14.25" - esbuild-freebsd-arm64 "0.14.25" - esbuild-linux-32 "0.14.25" - esbuild-linux-64 "0.14.25" - esbuild-linux-arm "0.14.25" - esbuild-linux-arm64 "0.14.25" - esbuild-linux-mips64le "0.14.25" - esbuild-linux-ppc64le "0.14.25" - esbuild-linux-riscv64 "0.14.25" - esbuild-linux-s390x "0.14.25" - esbuild-netbsd-64 "0.14.25" - esbuild-openbsd-64 "0.14.25" - esbuild-sunos-64 "0.14.25" - esbuild-windows-32 "0.14.25" - esbuild-windows-64 "0.14.25" - esbuild-windows-arm64 "0.14.25" + esbuild-android-64 "0.14.26" + esbuild-android-arm64 "0.14.26" + esbuild-darwin-64 "0.14.26" + esbuild-darwin-arm64 "0.14.26" + esbuild-freebsd-64 "0.14.26" + esbuild-freebsd-arm64 "0.14.26" + esbuild-linux-32 "0.14.26" + esbuild-linux-64 "0.14.26" + esbuild-linux-arm "0.14.26" + esbuild-linux-arm64 "0.14.26" + esbuild-linux-mips64le "0.14.26" + esbuild-linux-ppc64le "0.14.26" + esbuild-linux-riscv64 "0.14.26" + esbuild-linux-s390x "0.14.26" + esbuild-netbsd-64 "0.14.26" + esbuild-openbsd-64 "0.14.26" + esbuild-sunos-64 "0.14.26" + esbuild-windows-32 "0.14.26" + esbuild-windows-64 "0.14.26" + esbuild-windows-arm64 "0.14.26" escalade@^3.1.1: version "3.1.1" From 541eec5b9c333f57cbec2a56c4eedfe17faa5714 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 15 Mar 2022 08:57:54 +0800 Subject: [PATCH 04/28] Replace `parent-module` (#12455) --- scripts/build/config.mjs | 12 +++++------- scripts/build/shims/parent-module.cjs | 3 +++ 2 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 scripts/build/shims/parent-module.cjs diff --git a/scripts/build/config.mjs b/scripts/build/config.mjs index 3b3d4e164..5d9aea8a7 100644 --- a/scripts/build/config.mjs +++ b/scripts/build/config.mjs @@ -263,14 +263,12 @@ const coreBundles = [ }, { input: "src/common/third-party.js", - replaceText: [ + replaceModule: { // cosmiconfig@6 -> import-fresh can't find parentModule, since module is bundled - { - file: require.resolve("import-fresh"), - find: "parentModule(__filename)", - replacement: "__filename", - }, - ], + [require.resolve("parent-module")]: require.resolve( + "./shims/parent-module.cjs" + ), + }, }, ].map((bundle) => ({ type: "core", diff --git a/scripts/build/shims/parent-module.cjs b/scripts/build/shims/parent-module.cjs new file mode 100644 index 000000000..0bcecab1c --- /dev/null +++ b/scripts/build/shims/parent-module.cjs @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = (file) => file; From b73ad8e7cb5af6db45c9ca04bea540839ed1cc2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:35:09 +0800 Subject: [PATCH 05/28] Build(deps-dev): Bump cspell from 5.19.0 to 5.19.2 (#12453) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 96 ++++++++++++++++++++++++++-------------------------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index fde3a1b6d..6e549c3c8 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "browserslist-to-esbuild": "1.1.1", "core-js": "3.21.1", "cross-env": "7.0.3", - "cspell": "5.19.0", + "cspell": "5.19.2", "enquirer": "2.3.6", "esbuild": "0.14.26", "esbuild-visualizer": "0.3.1", diff --git a/yarn.lock b/yarn.lock index 23b4f07d1..e988050c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -935,10 +935,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cspell/cspell-bundled-dicts@^5.19.0": - version "5.19.0" - resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-5.19.0.tgz#5c0670bae042efccaec94766eb600c47db9fedda" - integrity sha512-0wgsBcxsJXgkei+aW4OgqEeuGFCk0KOa9VufNmVUTS9fO2zzkXu/0oeROjUFQSp+vwPjhatEpRGNehM69PbxdQ== +"@cspell/cspell-bundled-dicts@^5.19.2": + version "5.19.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-5.19.2.tgz#c20d05d0ff5f3850bb62a32a95e05abd94673936" + integrity sha512-R+12xDw5iLCJH3O0n8t1D7acZrO/bjuULU3rs3CEt+i84/85b27shywc3E/vOiOt9613bpFNOL52J27Tu52YPQ== dependencies: "@cspell/dict-ada" "^2.0.0" "@cspell/dict-aws" "^2.0.0" @@ -980,15 +980,15 @@ "@cspell/dict-typescript" "^2.0.0" "@cspell/dict-vue" "^2.0.2" -"@cspell/cspell-pipe@^5.19.0": - version "5.19.0" - resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-5.19.0.tgz#a6cc4b7c47ed17ea5ccb4ca57cc534905fb09972" - integrity sha512-vHSGQxHfY1VjFnRB481DSNgOkbA/x59kpfCe6XQq3CzzmR7kiaUs3p478WU5JHNoTKdesoDFyct36VZT58/oWQ== +"@cspell/cspell-pipe@^5.19.2": + version "5.19.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-5.19.2.tgz#40bf46fae7aa0697f9ab9e36d165fe149b9b5f36" + integrity sha512-mFFSn4ZgNgIOM0iBT0+xKBhRTQd/ecrWVvPfJpHxXIFwTt0neD19hqK54RDedLf8Hjds5cBHvS1EjMNARju/bQ== -"@cspell/cspell-types@^5.19.0": - version "5.19.0" - resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-5.19.0.tgz#ad127703481850d17368750723a6dfb33acf7d96" - integrity sha512-AoQu0lNNoyWVSSBgjzozg9wso8dlVwiLrEcFqtT4mGPgxg6vD5AyBuGmkoP8qPfYC/YU28mIhDFOJ8qNuuOtHw== +"@cspell/cspell-types@^5.19.2": + version "5.19.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-5.19.2.tgz#faae04c918dca53d6a266d86d00c3bd1682ebe16" + integrity sha512-IkMQpa7IzoFm9NXzRz8Gp38f3aoMZf6xjT7J3FvWtIntPvkIFaY53R1/I9U/gujH/zflf2VmZGxoDuFg1VcD0g== "@cspell/dict-ada@^2.0.0": version "2.0.0" @@ -2424,41 +2424,41 @@ crypto-random-string@^4.0.0: dependencies: type-fest "^1.0.1" -cspell-gitignore@^5.19.0: - version "5.19.0" - resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-5.19.0.tgz#f431f66b15a6fcda74a99cade067cdb317f4dadc" - integrity sha512-pNKubcQLmx7MabfbaiSymXR0pIf22J6IZv7ftXpVnNONe1oef6P5Os+/uPN9ieHAIYITFjdNvVqIr1EjDqJBwA== +cspell-gitignore@^5.19.2: + version "5.19.2" + resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-5.19.2.tgz#8a364a18fbeef7b35356f2537933ea4fc1761063" + integrity sha512-j0iMQoLmq4J/19hM0j0rNUQoHsw1b9Yg1AZMus8WJgABPUPGgk4fRKJChUQu0+ys3wwWT/4vhKt7hU89ScphJQ== dependencies: - cspell-glob "^5.19.0" + cspell-glob "^5.19.2" find-up "^5.0.0" -cspell-glob@^5.19.0: - version "5.19.0" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-5.19.0.tgz#42efcc6415d035039a56461ade313860160db434" - integrity sha512-LyU4CL/5tRC/9KmyK/L2fO8lTmJO7L1c2ouAJXx7ehlj26n2v4ZFzUQCHrW5/ba2eiyhuRHq43QHpLFyO/ORaw== +cspell-glob@^5.19.2: + version "5.19.2" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-5.19.2.tgz#57a208bbb583d8385403d35fa2f1a1351b50e883" + integrity sha512-23pgM0KzWsnNv6zwC/xnxdE86MfLU7NWbBqDmn1KixhJjezOhg/LiSjnJuRVUuLR+4qApzjrBRpk+Rj1jzYi6A== dependencies: micromatch "^4.0.4" -cspell-io@^5.19.0: - version "5.19.0" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-5.19.0.tgz#a192cbae02ea565ecb26d76a310daf3b6439eb30" - integrity sha512-hNiHPrixk2XDRlC/Gf+yMk1lBjrQJZS8/BLyvxHkE7RJ4cO77NbmHZrPP7oIhwicKQIEhEisqC1NtXrGxLyD8g== +cspell-io@^5.19.2: + version "5.19.2" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-5.19.2.tgz#32ae634cccc73c8a0b8f1c83038301fbe137c85f" + integrity sha512-TLlXMmDdZQold3ZsbHEpwKjUIRtYksp7Qr9Z0Rt9JpII6riliUPdB0SMFgtrqAvV1+bhJEPPmSxts8SdtLkdnA== -cspell-lib@^5.19.0: - version "5.19.0" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-5.19.0.tgz#40f7b74906e678adf8b6bea571d9a9b76b5e2ee9" - integrity sha512-s6V1jBn9RbveUMj/5PJOois0BcTvurbhwR+xMpK5j6M9hLAuTiLZZJPHygfQbCE/GJCXDCb7nn1ABHceEn3BVQ== +cspell-lib@^5.19.2: + version "5.19.2" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-5.19.2.tgz#678ade6f3217e0ca3bb12efca55871912d90d2ff" + integrity sha512-x8NhOiXKRj6PHQty9RmaujE8dywzX0ZJr6AlPE/0N8IHmOg0Y8gAs7aN45l3PjFz+vaWfCghPbCIyxE/fdXNaw== dependencies: - "@cspell/cspell-bundled-dicts" "^5.19.0" - "@cspell/cspell-pipe" "^5.19.0" - "@cspell/cspell-types" "^5.19.0" + "@cspell/cspell-bundled-dicts" "^5.19.2" + "@cspell/cspell-pipe" "^5.19.2" + "@cspell/cspell-types" "^5.19.2" clear-module "^4.1.2" comment-json "^4.2.2" configstore "^5.0.1" cosmiconfig "^7.0.1" - cspell-glob "^5.19.0" - cspell-io "^5.19.0" - cspell-trie-lib "^5.19.0" + cspell-glob "^5.19.2" + cspell-io "^5.19.2" + cspell-trie-lib "^5.19.2" fast-equals "^3.0.0" find-up "^5.0.0" fs-extra "^10.0.1" @@ -2469,27 +2469,27 @@ cspell-lib@^5.19.0: vscode-languageserver-textdocument "^1.0.4" vscode-uri "^3.0.3" -cspell-trie-lib@^5.19.0: - version "5.19.0" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-5.19.0.tgz#50b4943b677ddbc824e94935f4edc81aa6bb2e05" - integrity sha512-GyViUJj35u3MY3R2YF/n4yc48Irem4DHpANSEbweNtxVtYM+SJpAxZZ8YLkneOgsqhp8I90zmRZpNHrqo/TaxA== +cspell-trie-lib@^5.19.2: + version "5.19.2" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-5.19.2.tgz#4573f897de9ad1200390c14b73d43066acdf8746" + integrity sha512-JCPBuA6XtIRuMZtIzRAV/nk/NmTQwxcQA4GEAkdxYZ9aUPTpMDItxQkrKrlEvAuqt8hKZkOpE6ZpChdLW7aKsg== dependencies: - "@cspell/cspell-pipe" "^5.19.0" + "@cspell/cspell-pipe" "^5.19.2" fs-extra "^10.0.1" gensequence "^3.1.1" -cspell@5.19.0: - version "5.19.0" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-5.19.0.tgz#6db14ecb8ec61604335db39ede4c3ba97163ecf7" - integrity sha512-13dB2WHkWYVh322dk3hmBiLTG93BOTkGFw/l5oCM6dKJgNmBFjnSmIVi0prGY3rSR6SKYHkKfIWK9RG0WouXsQ== +cspell@5.19.2: + version "5.19.2" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-5.19.2.tgz#79de5ab9335b089058fb9765fbdf39aebade3aa7" + integrity sha512-HqjwOZ5iJ4WBfl6TfQkGXax0uYVL3SI9XAsstFs7yQW+6/DwjgvR7GFTkGH+rZgN5hdGZPk81NYbfNLm0uyKCQ== dependencies: - "@cspell/cspell-pipe" "^5.19.0" + "@cspell/cspell-pipe" "^5.19.2" chalk "^4.1.2" commander "^9.0.0" comment-json "^4.2.2" - cspell-gitignore "^5.19.0" - cspell-glob "^5.19.0" - cspell-lib "^5.19.0" + cspell-gitignore "^5.19.2" + cspell-glob "^5.19.2" + cspell-lib "^5.19.2" fast-json-stable-stringify "^2.1.0" file-entry-cache "^6.0.1" fs-extra "^10.0.1" From c0432af0c39b06c47525710ef89276bf8953f993 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:35:34 +0800 Subject: [PATCH 06/28] Build(deps-dev): Bump eslint-plugin-react from 7.29.3 to 7.29.4 (#12454) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6e549c3c8..badf191f1 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "eslint-plugin-import": "2.25.4", "eslint-plugin-jest": "26.1.1", "eslint-plugin-prettier-internal-rules": "2.0.1", - "eslint-plugin-react": "7.29.3", + "eslint-plugin-react": "7.29.4", "eslint-plugin-regexp": "1.5.1", "eslint-plugin-unicorn": "41.0.0", "esm-utils": "3.0.0", diff --git a/yarn.lock b/yarn.lock index e988050c3..3e4661e56 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2998,10 +2998,10 @@ eslint-plugin-prettier-internal-rules@2.0.1: resolved "https://registry.yarnpkg.com/eslint-plugin-prettier-internal-rules/-/eslint-plugin-prettier-internal-rules-2.0.1.tgz#ee6f5b4d663fd16d406f66a0d52775d05be1bd6e" integrity sha512-6mLlbq4xl86c66Smulq2a/bIpTzXDL3LcoYQd/C+kSbjLl8L7G+3wNJs6lWsZZ5v8fyirundQBH6PP/PSAzDMw== -eslint-plugin-react@7.29.3: - version "7.29.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.29.3.tgz#f4eab757f2756d25d6d4c2a58a9e20b004791f05" - integrity sha512-MzW6TuCnDOcta67CkpDyRfRsEVx9FNMDV8wZsDqe1luHPdGTrQIUaUXD27Ja3gHsdOIs/cXzNchWGlqm+qRVRg== +eslint-plugin-react@7.29.4: + version "7.29.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.29.4.tgz#4717de5227f55f3801a5fd51a16a4fa22b5914d2" + integrity sha512-CVCXajliVh509PcZYRFyu/BoUEz452+jtQJq2b3Bae4v3xBUWPLCmtmBM+ZinG4MzwmxJgJ2M5rMqhqLVn7MtQ== dependencies: array-includes "^3.1.4" array.prototype.flatmap "^1.2.5" From 4b7a39c936ab08559ccd13ad1cad79679d36db46 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 15 Mar 2022 09:40:25 +0800 Subject: [PATCH 07/28] Update `chalk` to v5 (#12446) --- package.json | 2 +- scripts/vendors/vendor-meta.json | 13 + scripts/vendors/vendors.mjs | 2 +- src/cli/format.js | 3 +- src/cli/logger.js | 4 +- src/cli/options/get-options-for-file.js | 3 +- src/cli/options/parse-cli-arguments.js | 3 +- tests/config/install-prettier.js | 2 +- vendors/chalk.d.ts | 3 + vendors/chalk.js | 535 ++++++++++++++++++++++++ yarn.lock | 7 +- 11 files changed, 569 insertions(+), 8 deletions(-) create mode 100644 vendors/chalk.d.ts create mode 100644 vendors/chalk.js diff --git a/package.json b/package.json index badf191f1..bdc1a0891 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "angular-estree-parser": "2.5.0", "angular-html-parser": "1.8.0", "camelcase": "6.3.0", - "chalk": "4.1.2", + "chalk": "5.0.1", "ci-info": "3.3.0", "cjk-regex": "2.0.1", "cosmiconfig": "7.0.1", diff --git a/scripts/vendors/vendor-meta.json b/scripts/vendors/vendor-meta.json index d9a50fcd6..afd900a37 100644 --- a/scripts/vendors/vendor-meta.json +++ b/scripts/vendors/vendor-meta.json @@ -1478,6 +1478,19 @@ "url": "https://sindresorhus.com" }, "contributors": [] + }, + { + "name": "chalk", + "maintainers": [], + "version": "5.0.1", + "description": "Terminal string styling done right", + "repository": "chalk/chalk", + "homepage": null, + "private": false, + "license": "MIT", + "licenseText": "MIT License\n\nCopyright (c) Sindre Sorhus (https://sindresorhus.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", + "author": null, + "contributors": [] } ] } diff --git a/scripts/vendors/vendors.mjs b/scripts/vendors/vendors.mjs index d090a1ae8..46a67f445 100644 --- a/scripts/vendors/vendors.mjs +++ b/scripts/vendors/vendors.mjs @@ -1,3 +1,3 @@ -const vendors = ["string-width", "mem", "execa", "tempy"]; +const vendors = ["string-width", "mem", "execa", "tempy", "chalk"]; export default vendors; diff --git a/src/cli/format.js b/src/cli/format.js index 01806522f..ce3a1063f 100644 --- a/src/cli/format.js +++ b/src/cli/format.js @@ -3,7 +3,8 @@ const { promises: fs } = require("fs"); const path = require("path"); -const chalk = require("chalk"); +// eslint-disable-next-line no-restricted-modules +const { default: chalk } = require("../../vendors/chalk.js"); // eslint-disable-next-line no-restricted-modules const prettier = require("../index.js"); diff --git a/src/cli/logger.js b/src/cli/logger.js index 252b90496..350e91309 100644 --- a/src/cli/logger.js +++ b/src/cli/logger.js @@ -1,10 +1,12 @@ "use strict"; const readline = require("readline"); -const chalk = require("chalk"); const stripAnsi = require("strip-ansi"); const wcwidth = require("wcwidth"); +// eslint-disable-next-line no-restricted-modules +const { default: chalk } = require("../../vendors/chalk.js"); + const countLines = (stream, text) => { const columns = stream.columns || 80; let lineCount = 0; diff --git a/src/cli/options/get-options-for-file.js b/src/cli/options/get-options-for-file.js index 0bfa2454a..93778c46a 100644 --- a/src/cli/options/get-options-for-file.js +++ b/src/cli/options/get-options-for-file.js @@ -1,9 +1,10 @@ "use strict"; const dashify = require("dashify"); -const chalk = require("chalk"); const leven = require("leven"); // eslint-disable-next-line no-restricted-modules +const { default: chalk } = require("../../../vendors/chalk.js"); +// eslint-disable-next-line no-restricted-modules const prettier = require("../../index.js"); const { optionsNormalizer } = require("../prettier-internal.js"); const minimist = require("./minimist.js"); diff --git a/src/cli/options/parse-cli-arguments.js b/src/cli/options/parse-cli-arguments.js index 55ecea1de..cd6db20d2 100644 --- a/src/cli/options/parse-cli-arguments.js +++ b/src/cli/options/parse-cli-arguments.js @@ -1,8 +1,9 @@ "use strict"; const pick = require("lodash/pick"); const camelCase = require("camelcase"); -const chalk = require("chalk"); const leven = require("leven"); +// eslint-disable-next-line no-restricted-modules +const { default: chalk } = require("../../../vendors/chalk.js"); const { optionsNormalizer: { normalizeCliOptions }, } = require("../prettier-internal.js"); diff --git a/tests/config/install-prettier.js b/tests/config/install-prettier.js index 4d957e188..2f62f50c9 100644 --- a/tests/config/install-prettier.js +++ b/tests/config/install-prettier.js @@ -2,7 +2,7 @@ const path = require("path"); const fs = require("fs"); -const chalk = require("chalk"); +const { default: chalk } = require("../../vendors/chalk.js"); const { default: tempy } = require("../../vendors/tempy.js"); const { execaSync } = require("../../vendors/execa.js"); diff --git a/vendors/chalk.d.ts b/vendors/chalk.d.ts new file mode 100644 index 000000000..abeda7fb9 --- /dev/null +++ b/vendors/chalk.d.ts @@ -0,0 +1,3 @@ +// This file is generated automatically. +export {default} from "chalk"; +export * from "chalk"; diff --git a/vendors/chalk.js b/vendors/chalk.js new file mode 100644 index 000000000..65758d58a --- /dev/null +++ b/vendors/chalk.js @@ -0,0 +1,535 @@ +// @ts-nocheck +// This file is generated automatically +var __create = Object.create; +var __defProp = Object.defineProperty; +var __defProps = Object.defineProperties; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; +}; +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); +var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __reExport = (target, module2, copyDefault, desc) => { + if (module2 && typeof module2 === "object" || typeof module2 === "function") { + for (let key of __getOwnPropNames(module2)) + if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) + __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); + } + return target; +}; +var __toESM = (module2, isNodeMode) => { + return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); +}; +var __toCommonJS = /* @__PURE__ */ ((cache) => { + return (module2, temp) => { + return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp); + }; +})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0); + +// node_modules/chalk/source/index.js +var source_exports = {}; +__export(source_exports, { + Chalk: () => Chalk, + chalkStderr: () => chalkStderr, + default: () => source_default, + supportsColor: () => stdoutColor, + supportsColorStderr: () => stderrColor +}); + +// node_modules/chalk/source/vendor/ansi-styles/index.js +var ANSI_BACKGROUND_OFFSET = 10; +var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`; +var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; +var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`; +function assembleStyles() { + const codes = /* @__PURE__ */ new Map(); + const styles2 = { + modifier: { + reset: [0, 0], + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + overline: [53, 55], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + styles2.color.gray = styles2.color.blackBright; + styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright; + styles2.color.grey = styles2.color.blackBright; + styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright; + for (const [groupName, group] of Object.entries(styles2)) { + for (const [styleName, style] of Object.entries(group)) { + styles2[styleName] = { + open: `\x1B[${style[0]}m`, + close: `\x1B[${style[1]}m` + }; + group[styleName] = styles2[styleName]; + codes.set(style[0], style[1]); + } + Object.defineProperty(styles2, groupName, { + value: group, + enumerable: false + }); + } + Object.defineProperty(styles2, "codes", { + value: codes, + enumerable: false + }); + styles2.color.close = "\x1B[39m"; + styles2.bgColor.close = "\x1B[49m"; + styles2.color.ansi = wrapAnsi16(); + styles2.color.ansi256 = wrapAnsi256(); + styles2.color.ansi16m = wrapAnsi16m(); + styles2.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); + styles2.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); + styles2.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); + Object.defineProperties(styles2, { + rgbToAnsi256: { + value: (red, green, blue) => { + if (red === green && green === blue) { + if (red < 8) { + return 16; + } + if (red > 248) { + return 231; + } + return Math.round((red - 8) / 247 * 24) + 232; + } + return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5); + }, + enumerable: false + }, + hexToRgb: { + value: (hex) => { + const matches = /(?[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16)); + if (!matches) { + return [0, 0, 0]; + } + let { colorString } = matches.groups; + if (colorString.length === 3) { + colorString = [...colorString].map((character) => character + character).join(""); + } + const integer = Number.parseInt(colorString, 16); + return [ + integer >> 16 & 255, + integer >> 8 & 255, + integer & 255 + ]; + }, + enumerable: false + }, + hexToAnsi256: { + value: (hex) => styles2.rgbToAnsi256(...styles2.hexToRgb(hex)), + enumerable: false + }, + ansi256ToAnsi: { + value: (code) => { + if (code < 8) { + return 30 + code; + } + if (code < 16) { + return 90 + (code - 8); + } + let red; + let green; + let blue; + if (code >= 232) { + red = ((code - 232) * 10 + 8) / 255; + green = red; + blue = red; + } else { + code -= 16; + const remainder = code % 36; + red = Math.floor(code / 36) / 5; + green = Math.floor(remainder / 6) / 5; + blue = remainder % 6 / 5; + } + const value = Math.max(red, green, blue) * 2; + if (value === 0) { + return 30; + } + let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red)); + if (value === 2) { + result += 60; + } + return result; + }, + enumerable: false + }, + rgbToAnsi: { + value: (red, green, blue) => styles2.ansi256ToAnsi(styles2.rgbToAnsi256(red, green, blue)), + enumerable: false + }, + hexToAnsi: { + value: (hex) => styles2.ansi256ToAnsi(styles2.hexToAnsi256(hex)), + enumerable: false + } + }); + return styles2; +} +var ansiStyles = assembleStyles(); +var ansi_styles_default = ansiStyles; + +// node_modules/chalk/source/vendor/supports-color/index.js +var import_node_process = __toESM(require("process"), 1); +var import_node_os = __toESM(require("os"), 1); +var import_node_tty = __toESM(require("tty"), 1); +function hasFlag(flag, argv = import_node_process.default.argv) { + const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf("--"); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +} +var { env } = import_node_process.default; +var flagForceColor; +if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { + flagForceColor = 0; +} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + flagForceColor = 1; +} +function envForceColor() { + if ("FORCE_COLOR" in env) { + if (env.FORCE_COLOR === "true") { + return 1; + } + if (env.FORCE_COLOR === "false") { + return 0; + } + return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); + } +} +function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} +function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { + const noFlagForceColor = envForceColor(); + if (noFlagForceColor !== void 0) { + flagForceColor = noFlagForceColor; + } + const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; + if (forceColor === 0) { + return 0; + } + if (sniffFlags) { + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; + } + if (hasFlag("color=256")) { + return 2; + } + } + if (haveStream && !streamIsTTY && forceColor === void 0) { + return 0; + } + const min = forceColor || 0; + if (env.TERM === "dumb") { + return min; + } + if (import_node_process.default.platform === "win32") { + const osRelease = import_node_os.default.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + return 1; + } + if ("CI" in env) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; + } + return min; + } + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + if ("TF_BUILD" in env && "AGENT_NAME" in env) { + return 1; + } + if (env.COLORTERM === "truecolor") { + return 3; + } + if ("TERM_PROGRAM" in env) { + const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env.TERM_PROGRAM) { + case "iTerm.app": + return version >= 3 ? 3 : 2; + case "Apple_Terminal": + return 2; + } + } + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + if ("COLORTERM" in env) { + return 1; + } + return min; +} +function createSupportsColor(stream, options = {}) { + const level = _supportsColor(stream, __spreadValues({ + streamIsTTY: stream && stream.isTTY + }, options)); + return translateLevel(level); +} +var supportsColor = { + stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }), + stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) }) +}; +var supports_color_default = supportsColor; + +// node_modules/chalk/source/utilities.js +function stringReplaceAll(string, substring, replacer) { + let index = string.indexOf(substring); + if (index === -1) { + return string; + } + const substringLength = substring.length; + let endIndex = 0; + let returnValue = ""; + do { + returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; + endIndex = index + substringLength; + index = string.indexOf(substring, endIndex); + } while (index !== -1); + returnValue += string.slice(endIndex); + return returnValue; +} +function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) { + let endIndex = 0; + let returnValue = ""; + do { + const gotCR = string[index - 1] === "\r"; + returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix; + endIndex = index + 1; + index = string.indexOf("\n", endIndex); + } while (index !== -1); + returnValue += string.slice(endIndex); + return returnValue; +} + +// node_modules/chalk/source/index.js +var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default; +var GENERATOR = Symbol("GENERATOR"); +var STYLER = Symbol("STYLER"); +var IS_EMPTY = Symbol("IS_EMPTY"); +var levelMapping = [ + "ansi", + "ansi", + "ansi256", + "ansi16m" +]; +var styles = /* @__PURE__ */ Object.create(null); +var applyOptions = (object, options = {}) => { + if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { + throw new Error("The `level` option should be an integer from 0 to 3"); + } + const colorLevel = stdoutColor ? stdoutColor.level : 0; + object.level = options.level === void 0 ? colorLevel : options.level; +}; +var Chalk = class { + constructor(options) { + return chalkFactory(options); + } +}; +var chalkFactory = (options) => { + const chalk2 = (...strings) => strings.join(" "); + applyOptions(chalk2, options); + Object.setPrototypeOf(chalk2, createChalk.prototype); + return chalk2; +}; +function createChalk(options) { + return chalkFactory(options); +} +Object.setPrototypeOf(createChalk.prototype, Function.prototype); +for (const [styleName, style] of Object.entries(ansi_styles_default)) { + styles[styleName] = { + get() { + const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]); + Object.defineProperty(this, styleName, { value: builder }); + return builder; + } + }; +} +styles.visible = { + get() { + const builder = createBuilder(this, this[STYLER], true); + Object.defineProperty(this, "visible", { value: builder }); + return builder; + } +}; +var getModelAnsi = (model, level, type, ...arguments_) => { + if (model === "rgb") { + if (level === "ansi16m") { + return ansi_styles_default[type].ansi16m(...arguments_); + } + if (level === "ansi256") { + return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)); + } + return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_)); + } + if (model === "hex") { + return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_)); + } + return ansi_styles_default[type][model](...arguments_); +}; +var usedModels = ["rgb", "hex", "ansi256"]; +for (const model of usedModels) { + styles[model] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]); + return createBuilder(this, styler, this[IS_EMPTY]); + }; + } + }; + const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]); + return createBuilder(this, styler, this[IS_EMPTY]); + }; + } + }; +} +var proto = Object.defineProperties(() => { +}, __spreadProps(__spreadValues({}, styles), { + level: { + enumerable: true, + get() { + return this[GENERATOR].level; + }, + set(level) { + this[GENERATOR].level = level; + } + } +})); +var createStyler = (open, close, parent) => { + let openAll; + let closeAll; + if (parent === void 0) { + openAll = open; + closeAll = close; + } else { + openAll = parent.openAll + open; + closeAll = close + parent.closeAll; + } + return { + open, + close, + openAll, + closeAll, + parent + }; +}; +var createBuilder = (self, _styler, _isEmpty) => { + const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); + Object.setPrototypeOf(builder, proto); + builder[GENERATOR] = self; + builder[STYLER] = _styler; + builder[IS_EMPTY] = _isEmpty; + return builder; +}; +var applyStyle = (self, string) => { + if (self.level <= 0 || !string) { + return self[IS_EMPTY] ? "" : string; + } + let styler = self[STYLER]; + if (styler === void 0) { + return string; + } + const { openAll, closeAll } = styler; + if (string.includes("\x1B")) { + while (styler !== void 0) { + string = stringReplaceAll(string, styler.close, styler.open); + styler = styler.parent; + } + } + const lfIndex = string.indexOf("\n"); + if (lfIndex !== -1) { + string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); + } + return openAll + string + closeAll; +}; +Object.defineProperties(createChalk.prototype, styles); +var chalk = createChalk(); +var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); +var source_default = chalk; +module.exports = __toCommonJS(source_exports); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Chalk, + chalkStderr, + supportsColor, + supportsColorStderr +}); diff --git a/yarn.lock b/yarn.lock index 3e4661e56..021e2fc42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2170,7 +2170,12 @@ chalk@2.4.2, chalk@^2.0.0, chalk@^2.4.1: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.1, chalk@^4.1.2: +chalk@5.0.1: + version "5.0.1" + resolved "https://registry.npmmirror.com/chalk/-/chalk-5.0.1.tgz#ca57d71e82bb534a296df63bbacc4a1c22b2a4b6" + integrity sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w== + +chalk@^4.0.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== From f3917a3a4696d3295a445c6b389329e2da7059cd Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 15 Mar 2022 09:40:45 +0800 Subject: [PATCH 08/28] Add `levenshteinDistance` option check (#12447) --- src/main/options-normalizer.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/options-normalizer.js b/src/main/options-normalizer.js index 5d1c16028..637973551 100644 --- a/src/main/options-normalizer.js +++ b/src/main/options-normalizer.js @@ -271,8 +271,14 @@ function normalizeApiOptions(options, optionInfos, opts) { function normalizeCliOptions(options, optionInfos, opts) { /* istanbul ignore next */ - if (process.env.NODE_ENV !== "production" && !opts.colorsModule) { - throw new Error("'colorsModule' option is required."); + if (process.env.NODE_ENV !== "production") { + if (!opts.colorsModule) { + throw new Error("'colorsModule' option is required."); + } + + if (!opts.levenshteinDistance) { + throw new Error("'levenshteinDistance' option is required."); + } } return normalizeOptions(options, optionInfos, { isCLI: true, ...opts }); From 935d76780a2f851c22aecc92c1f209dd47a08739 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 15 Mar 2022 09:44:37 +0800 Subject: [PATCH 09/28] Prevent plugin search on format test (#12322) --- tests/config/format-test.js | 2 ++ tests/config/utils/create-snapshot.js | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/tests/config/format-test.js b/tests/config/format-test.js index cd87cd622..f99ef2ab3 100644 --- a/tests/config/format-test.js +++ b/tests/config/format-test.js @@ -228,6 +228,8 @@ function runSpec(fixtures, parsers, options) { describe(title, () => { const formatOptions = { printWidth: 80, + // Should not search plugins by default + pluginSearchDirs: false, ...options, filepath: filename, parser, diff --git a/tests/config/utils/create-snapshot.js b/tests/config/utils/create-snapshot.js index a889a2730..fccac2f71 100644 --- a/tests/config/utils/create-snapshot.js +++ b/tests/config/utils/create-snapshot.js @@ -25,10 +25,15 @@ function printOptions(options) { filepath, errors, parser, + pluginSearchDirs, ...snapshotOptions } = options; + if (pluginSearchDirs !== false) { + snapshotOptions.pluginSearchDirs = pluginSearchDirs; + } + const keys = Object.keys(snapshotOptions).sort(); return keys .map((key) => `${key}: ${stringify(snapshotOptions[key])}`) From cae195187f524dd74e60849e0a4392654423415b Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 15 Mar 2022 12:36:13 +0800 Subject: [PATCH 10/28] Fix `diff` package import (#12462) Co-authored-by: Sosuke Suzuki --- scripts/build/config.mjs | 17 +++++++++++++++++ src/cli/format.js | 15 +++------------ src/main/core.js | 3 +-- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/scripts/build/config.mjs b/scripts/build/config.mjs index 5d9aea8a7..87638ba24 100644 --- a/scripts/build/config.mjs +++ b/scripts/build/config.mjs @@ -23,6 +23,20 @@ const { require } = createEsmUtils(import.meta); * @property {string[]} ignore - paths of CJS modules to ignore */ +/* +`diff` use deprecated folder mapping "./" in the "exports" field, +so we can't `require("diff/lib/diff/array.js")` directory. +To reduce the bundle size + +We can switch to deep require once https://github.com/kpdecker/jsdiff/pull/351 get merged +*/ +const replaceDiffPackageEntry = (file) => ({ + [require.resolve("diff")]: path.join( + path.dirname(require.resolve("diff/package.json")), + file + ), +}); + /** @type {Bundle[]} */ const parsers = [ { @@ -229,6 +243,7 @@ const coreBundles = [ replacement: "const utilInspect = require('util').inspect", }, ], + replaceModule: replaceDiffPackageEntry("lib/diff/array.js"), }, { input: "src/document/index.js", @@ -248,6 +263,7 @@ const coreBundles = [ ), [createRequire(require.resolve("vnopts")).resolve("chalk")]: require.resolve("./shims/chalk.cjs"), + ...replaceDiffPackageEntry("lib/diff/array.js"), }, }, { @@ -260,6 +276,7 @@ const coreBundles = [ input: "src/cli/index.js", output: "cli.js", external: ["benchmark"], + replaceModule: replaceDiffPackageEntry("lib/patch/create.js"), }, { input: "src/common/third-party.js", diff --git a/src/cli/format.js b/src/cli/format.js index ce3a1063f..bfff5e2cd 100644 --- a/src/cli/format.js +++ b/src/cli/format.js @@ -17,18 +17,9 @@ const getOptionsForFile = require("./options/get-options-for-file.js"); const isTTY = require("./is-tty.js"); function diff(a, b) { - // Use `diff/lib/patch/create.js` instead of `diff` to reduce bundle size - return require("diff/lib/patch/create.js").createTwoFilesPatch( - "", - "", - a, - b, - "", - "", - { - context: 2, - } - ); + return require("diff").createTwoFilesPatch("", "", a, b, "", "", { + context: 2, + }); } function handleError(context, filename, error, printedFilename) { diff --git a/src/main/core.js b/src/main/core.js index 07e40624f..133128469 100644 --- a/src/main/core.js +++ b/src/main/core.js @@ -1,7 +1,6 @@ "use strict"; -// Use `diff/lib/diff/array.js` instead of `diff` to reduce bundle size -const { diffArrays } = require("diff/lib/diff/array.js"); +const { diffArrays } = require("diff"); const { printer: { printDocToString }, From 1bf2fa32a2b27d352546783a6459ddb870ba7fa9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 12:41:35 +0800 Subject: [PATCH 11/28] Build(deps-dev): Bump @babel/core from 7.17.5 to 7.17.7 (#12459) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 81 +++++++++++++++++++++++++++++++--------------------- 2 files changed, 50 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index bdc1a0891..529e1b73b 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "yaml-unist-parser": "1.3.1" }, "devDependencies": { - "@babel/core": "7.17.5", + "@babel/core": "7.17.7", "@babel/preset-env": "7.16.11", "@babel/types": "7.17.0", "@esbuild-plugins/node-modules-polyfill": "0.1.4", diff --git a/yarn.lock b/yarn.lock index 021e2fc42..8a99bad48 100644 --- a/yarn.lock +++ b/yarn.lock @@ -35,18 +35,23 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.0.tgz#86850b8597ea6962089770952075dcaabb8dba34" integrity sha512-392byTlpGWXMv4FbyWw3sAZ/FrW/DrwqLGXpy0mbyNe9Taqv1mg9yON5/o0cnr8XYCkFTZbC1eV+c+LAROgrng== -"@babel/core@7.17.5", "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": - version "7.17.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.5.tgz#6cd2e836058c28f06a4ca8ee7ed955bbf37c8225" - integrity sha512-/BBMw4EvjmyquN5O+t5eh0+YqB3XXJkYD2cjKpYtWOfFy4lQ4UozNSmxAcWT8r2XtZs0ewG+zrfsqeR15i1ajA== +"@babel/compat-data@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.7.tgz#078d8b833fbbcc95286613be8c716cef2b519fa2" + integrity sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ== + +"@babel/core@7.17.7", "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.7.tgz#f7c28228c83cdf2dbd1b9baa06eaf9df07f0c2f9" + integrity sha512-djHlEfFHnSnTAcPb7dATbiM5HxGOP98+3JLBZtjRb5I7RXrw7kFRoG2dXM8cm3H+o11A8IFH/uprmJpwFynRNQ== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.3" - "@babel/helper-compilation-targets" "^7.16.7" - "@babel/helper-module-transforms" "^7.16.7" - "@babel/helpers" "^7.17.2" - "@babel/parser" "^7.17.3" + "@babel/generator" "^7.17.7" + "@babel/helper-compilation-targets" "^7.17.7" + "@babel/helper-module-transforms" "^7.17.7" + "@babel/helpers" "^7.17.7" + "@babel/parser" "^7.17.7" "@babel/template" "^7.16.7" "@babel/traverse" "^7.17.3" "@babel/types" "^7.17.0" @@ -56,10 +61,10 @@ json5 "^2.1.2" semver "^6.3.0" -"@babel/generator@^7.17.3", "@babel/generator@^7.7.2": - version "7.17.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.3.tgz#a2c30b0c4f89858cb87050c3ffdfd36bdf443200" - integrity sha512-+R6Dctil/MgUsZsZAkYgK+ADNSZzJRRy0TvY65T71z/CR854xHQ1EweBYXdfT+HNeN7w0cSJJEzgxZMv40pxsg== +"@babel/generator@^7.17.3", "@babel/generator@^7.17.7", "@babel/generator@^7.7.2": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.7.tgz#8da2599beb4a86194a3b24df6c085931d9ee45ad" + integrity sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w== dependencies: "@babel/types" "^7.17.0" jsesc "^2.5.1" @@ -80,12 +85,12 @@ "@babel/helper-explode-assignable-expression" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz#06e66c5f299601e6c7da350049315e83209d551b" - integrity sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA== +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.16.7", "@babel/helper-compilation-targets@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz#a3c2924f5e5f0379b356d4cfb313d1414dc30e46" + integrity sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w== dependencies: - "@babel/compat-data" "^7.16.4" + "@babel/compat-data" "^7.17.7" "@babel/helper-validator-option" "^7.16.7" browserslist "^4.17.5" semver "^6.3.0" @@ -176,19 +181,19 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-module-transforms@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz#7665faeb721a01ca5327ddc6bba15a5cb34b6a41" - integrity sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng== +"@babel/helper-module-transforms@^7.16.7", "@babel/helper-module-transforms@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz#3943c7f777139e7954a5355c815263741a9c1cbd" + integrity sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw== dependencies: "@babel/helper-environment-visitor" "^7.16.7" "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-simple-access" "^7.16.7" + "@babel/helper-simple-access" "^7.17.7" "@babel/helper-split-export-declaration" "^7.16.7" "@babel/helper-validator-identifier" "^7.16.7" "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.7" - "@babel/types" "^7.16.7" + "@babel/traverse" "^7.17.3" + "@babel/types" "^7.17.0" "@babel/helper-optimise-call-expression@^7.16.7": version "7.16.7" @@ -229,6 +234,13 @@ dependencies: "@babel/types" "^7.16.7" +"@babel/helper-simple-access@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367" + integrity sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA== + dependencies: + "@babel/types" "^7.17.0" + "@babel/helper-skip-transparent-expression-wrappers@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz#0ee3388070147c3ae051e487eca3ebb0e2e8bb09" @@ -263,13 +275,13 @@ "@babel/traverse" "^7.16.8" "@babel/types" "^7.16.8" -"@babel/helpers@^7.17.2": - version "7.17.2" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.2.tgz#23f0a0746c8e287773ccd27c14be428891f63417" - integrity sha512-0Qu7RLR1dILozr/6M0xgj+DFPmi6Bnulgm9M8BVa9ZCWxDqlSnqt3cf8IDPB5m45sVXUZ0kuQAgUrdSFFH79fQ== +"@babel/helpers@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.7.tgz#6fc0a24280fd00026e85424bbfed4650e76d7127" + integrity sha512-TKsj9NkjJfTBxM7Phfy7kv6yYc4ZcOo+AaWGqQOKTPDOmcGkIFb5xNA746eKisQkm4yavUYh4InYM9S+VnO01w== dependencies: "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.0" + "@babel/traverse" "^7.17.3" "@babel/types" "^7.17.0" "@babel/highlight@^7.0.0", "@babel/highlight@^7.16.7": @@ -281,11 +293,16 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@7.17.3", "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3": +"@babel/parser@7.17.3": version "7.17.3" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.3.tgz#b07702b982990bf6fdc1da5049a23fece4c5c3d0" integrity sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3", "@babel/parser@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.7.tgz#fc19b645a5456c8d6fdb6cecd3c66c0173902800" + integrity sha512-bm3AQf45vR4gKggRfvJdYJ0gFLoCbsPxiFLSH6hTVYABptNHY6l9NrhnucVjQ/X+SPtLANT9lc0fFhikj+VBRA== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz#4eda6d6c2a0aa79c70fa7b6da67763dfe2141050" @@ -906,7 +923,7 @@ "@babel/parser" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/traverse@^7.13.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.17.0", "@babel/traverse@^7.17.3", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.13.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.17.3", "@babel/traverse@^7.7.2": version "7.17.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57" integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw== From 901c21915578da2425f8a509213d4c24fb23e675 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 12:53:27 +0800 Subject: [PATCH 12/28] Build(deps): Bump @typescript-eslint/typescript-estree (#12458) Bumps [@typescript-eslint/typescript-estree](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-estree) from 5.14.0 to 5.15.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-estree/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.15.0/packages/typescript-estree) --- updated-dependencies: - dependency-name: "@typescript-eslint/typescript-estree" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 529e1b73b..7f598145e 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@babel/parser": "7.17.3", "@glimmer/syntax": "0.84.0", "@iarna/toml": "2.2.5", - "@typescript-eslint/typescript-estree": "5.14.0", + "@typescript-eslint/typescript-estree": "5.15.0", "acorn": "8.7.0", "acorn-jsx": "5.3.2", "angular-estree-parser": "2.5.0", diff --git a/yarn.lock b/yarn.lock index 8a99bad48..c48ee44b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1747,6 +1747,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.14.0.tgz#96317cf116cea4befabc0defef371a1013f8ab11" integrity sha512-BR6Y9eE9360LNnW3eEUqAg6HxS9Q35kSIs4rp4vNHRdfg0s+/PgHgskvu5DFTM7G5VKAVjuyaN476LCPrdA7Mw== +"@typescript-eslint/types@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.15.0.tgz#c7bdd103843b1abae97b5518219d3e2a0d79a501" + integrity sha512-yEiTN4MDy23vvsIksrShjNwQl2vl6kJeG9YkVJXjXZnkJElzVK8nfPsWKYxcsGWG8GhurYXP4/KGj3aZAxbeOA== + "@typescript-eslint/typescript-estree@5.14.0": version "5.14.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.14.0.tgz#78b7f7385d5b6f2748aacea5c9b7f6ae62058314" @@ -1760,6 +1765,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.15.0.tgz#81513a742a9c657587ad1ddbca88e76c6efb0aac" + integrity sha512-Hb0e3dGc35b75xLzixM3cSbG1sSbrTBQDfIScqdyvrfJZVEi4XWAT+UL/HMxEdrJNB8Yk28SKxPLtAhfCbBInA== + dependencies: + "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/visitor-keys" "5.15.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/utils@5.14.0", "@typescript-eslint/utils@^5.10.0": version "5.14.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.14.0.tgz#6c8bc4f384298cbbb32b3629ba7415f9f80dc8c4" @@ -1780,6 +1798,14 @@ "@typescript-eslint/types" "5.14.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.15.0.tgz#5669739fbf516df060f978be6a6dce75855a8027" + integrity sha512-+vX5FKtgvyHbmIJdxMJ2jKm9z2BIlXJiuewI8dsDYMp5LzPUcuTT78Ya5iwvQg3VqSVdmxyM8Anj1Jeq7733ZQ== + dependencies: + "@typescript-eslint/types" "5.15.0" + eslint-visitor-keys "^3.0.0" + abab@^2.0.3, abab@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" From 6fa3966d8a6cb13c20b49190613fffbdbd580858 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 06:07:20 +0000 Subject: [PATCH 13/28] Build(deps-dev): Bump @typescript-eslint/eslint-plugin (#12457) --- package.json | 2 +- yarn.lock | 76 +++++++++++++++++----------------------------------- 2 files changed, 26 insertions(+), 52 deletions(-) diff --git a/package.json b/package.json index 7f598145e..c5897992a 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "@glimmer/reference": "0.84.0", "@types/estree": "0.0.51", "@types/jest": "27.4.1", - "@typescript-eslint/eslint-plugin": "5.14.0", + "@typescript-eslint/eslint-plugin": "5.15.0", "babel-jest": "27.5.1", "benchmark": "2.1.4", "browserslist-to-esbuild": "1.1.1", diff --git a/yarn.lock b/yarn.lock index c48ee44b2..43df556fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1710,14 +1710,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.14.0.tgz#5119b67152356231a0e24b998035288a9cd21335" - integrity sha512-ir0wYI4FfFUDfLcuwKzIH7sMVA+db7WYen47iRSaCGl+HMAZI9fpBwfDo45ZALD3A45ZGyHWDNLhbg8tZrMX4w== +"@typescript-eslint/eslint-plugin@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.15.0.tgz#c28ef7f2e688066db0b6a9d95fb74185c114fb9a" + integrity sha512-u6Db5JfF0Esn3tiAKELvoU5TpXVSkOpZ78cEGn/wXtT2RVqs2vkt4ge6N8cRCyw7YVKhmmLDbwI2pg92mlv7cA== dependencies: - "@typescript-eslint/scope-manager" "5.14.0" - "@typescript-eslint/type-utils" "5.14.0" - "@typescript-eslint/utils" "5.14.0" + "@typescript-eslint/scope-manager" "5.15.0" + "@typescript-eslint/type-utils" "5.15.0" + "@typescript-eslint/utils" "5.15.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -1725,46 +1725,28 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/scope-manager@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.14.0.tgz#ea518962b42db8ed0a55152ea959c218cb53ca7b" - integrity sha512-LazdcMlGnv+xUc5R4qIlqH0OWARyl2kaP8pVCS39qSL3Pd1F7mI10DbdXeARcE62sVQE4fHNvEqMWsypWO+yEw== +"@typescript-eslint/scope-manager@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.15.0.tgz#d97afab5e0abf4018d1289bd711be21676cdd0ee" + integrity sha512-EFiZcSKrHh4kWk0pZaa+YNJosvKE50EnmN4IfgjkA3bTHElPtYcd2U37QQkNTqwMCS7LXeDeZzEqnsOH8chjSg== dependencies: - "@typescript-eslint/types" "5.14.0" - "@typescript-eslint/visitor-keys" "5.14.0" + "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/visitor-keys" "5.15.0" -"@typescript-eslint/type-utils@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.14.0.tgz#711f08105860b12988454e91df433567205a8f0b" - integrity sha512-d4PTJxsqaUpv8iERTDSQBKUCV7Q5yyXjqXUl3XF7Sd9ogNLuKLkxz82qxokqQ4jXdTPZudWpmNtr/JjbbvUixw== +"@typescript-eslint/type-utils@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.15.0.tgz#d2c02eb2bdf54d0a645ba3a173ceda78346cf248" + integrity sha512-KGeDoEQ7gHieLydujGEFLyLofipe9PIzfvA/41urz4hv+xVxPEbmMQonKSynZ0Ks2xDhJQ4VYjB3DnRiywvKDA== dependencies: - "@typescript-eslint/utils" "5.14.0" + "@typescript-eslint/utils" "5.15.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.14.0.tgz#96317cf116cea4befabc0defef371a1013f8ab11" - integrity sha512-BR6Y9eE9360LNnW3eEUqAg6HxS9Q35kSIs4rp4vNHRdfg0s+/PgHgskvu5DFTM7G5VKAVjuyaN476LCPrdA7Mw== - "@typescript-eslint/types@5.15.0": version "5.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.15.0.tgz#c7bdd103843b1abae97b5518219d3e2a0d79a501" integrity sha512-yEiTN4MDy23vvsIksrShjNwQl2vl6kJeG9YkVJXjXZnkJElzVK8nfPsWKYxcsGWG8GhurYXP4/KGj3aZAxbeOA== -"@typescript-eslint/typescript-estree@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.14.0.tgz#78b7f7385d5b6f2748aacea5c9b7f6ae62058314" - integrity sha512-QGnxvROrCVtLQ1724GLTHBTR0lZVu13izOp9njRvMkCBgWX26PKvmMP8k82nmXBRD3DQcFFq2oj3cKDwr0FaUA== - dependencies: - "@typescript-eslint/types" "5.14.0" - "@typescript-eslint/visitor-keys" "5.14.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.15.0": version "5.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.15.0.tgz#81513a742a9c657587ad1ddbca88e76c6efb0aac" @@ -1778,26 +1760,18 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.14.0", "@typescript-eslint/utils@^5.10.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.14.0.tgz#6c8bc4f384298cbbb32b3629ba7415f9f80dc8c4" - integrity sha512-EHwlII5mvUA0UsKYnVzySb/5EE/t03duUTweVy8Zqt3UQXBrpEVY144OTceFKaOe4xQXZJrkptCf7PjEBeGK4w== +"@typescript-eslint/utils@5.15.0", "@typescript-eslint/utils@^5.10.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.15.0.tgz#468510a0974d3ced8342f37e6c662778c277f136" + integrity sha512-081rWu2IPKOgTOhHUk/QfxuFog8m4wxW43sXNOMSCdh578tGJ1PAaWPsj42LOa7pguh173tNlMigsbrHvh/mtA== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.14.0" - "@typescript-eslint/types" "5.14.0" - "@typescript-eslint/typescript-estree" "5.14.0" + "@typescript-eslint/scope-manager" "5.15.0" + "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/typescript-estree" "5.15.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.14.0.tgz#1927005b3434ccd0d3ae1b2ecf60e65943c36986" - integrity sha512-yL0XxfzR94UEkjBqyymMLgCBdojzEuy/eim7N9/RIcTNxpJudAcqsU8eRyfzBbcEzGoPWfdM3AGak3cN08WOIw== - dependencies: - "@typescript-eslint/types" "5.14.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.15.0": version "5.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.15.0.tgz#5669739fbf516df060f978be6a6dce75855a8027" From 34dcd96922efaff08ad72820da9efc2fb66d914f Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 15 Mar 2022 22:07:36 +0800 Subject: [PATCH 14/28] Build: Add a plugin to throw unexpected warnings (#12463) --- scripts/build/bundler.mjs | 6 ++++- .../build/esbuild-plugins/throw-warnings.mjs | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 scripts/build/esbuild-plugins/throw-warnings.mjs diff --git a/scripts/build/bundler.mjs b/scripts/build/bundler.mjs index 548191a88..9968226f1 100644 --- a/scripts/build/bundler.mjs +++ b/scripts/build/bundler.mjs @@ -12,6 +12,7 @@ import esbuildPluginReplaceText from "./esbuild-plugins/replace-text.mjs"; import esbuildPluginLicense from "./esbuild-plugins/license.mjs"; import esbuildPluginUmd from "./esbuild-plugins/umd.mjs"; import esbuildPluginVisualizer from "./esbuild-plugins/visualizer.mjs"; +import esbuildPluginThrowWarnings from "./esbuild-plugins/throw-warnings.mjs"; import bundles from "./config.mjs"; const { __dirname, readJsonSync, require } = createEsmUtils(import.meta); @@ -170,6 +171,7 @@ function* getEsbuildOptions(bundle, buildOptions) { }), buildOptions.reports && esbuildPluginVisualizer({ formats: buildOptions.reports }), + esbuildPluginThrowWarnings(), ].filter(Boolean), minify: shouldMinify, legalComments: "none", @@ -242,7 +244,9 @@ async function runBuild(bundle, esbuildOptions, buildOptions) { await esbuild.build({ ...esbuildOptions, define: {}, - plugins: plugins.filter(({ name }) => name === "umd"), + plugins: plugins.filter( + ({ name }) => name === "umd" || name === "throw-warnings" + ), entryPoints: [outfile], allowOverwrite: true, }); diff --git a/scripts/build/esbuild-plugins/throw-warnings.mjs b/scripts/build/esbuild-plugins/throw-warnings.mjs new file mode 100644 index 000000000..62492e63b --- /dev/null +++ b/scripts/build/esbuild-plugins/throw-warnings.mjs @@ -0,0 +1,22 @@ +const ignoredWarnings = new Set([ + // Duplicated case clause + "This case clause will never be evaluated because it duplicates an earlier case clause", +]); + +export default function esbuildPluginThrowWarnings() { + return { + name: "throw-warnings", + setup(build) { + build.onEnd(({ warnings }) => { + for (const warning of warnings) { + if (ignoredWarnings.has(warning.text)) { + continue; + } + + console.log(warning); + throw new Error(warning.text); + } + }); + }, + }; +} From b26a24558aa72af0b19be2b1702ccff4b8e84f52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 14:45:31 +0000 Subject: [PATCH 15/28] Build(deps-dev): Bump esbuild from 0.14.26 to 0.14.27 (#12461) --- package.json | 2 +- vendors/chalk.js | 25 ++--- vendors/execa.js | 25 ++--- vendors/mem.js | 25 ++--- vendors/string-width.js | 25 ++--- vendors/tempy.js | 25 ++--- yarn.lock | 208 ++++++++++++++++++++-------------------- 7 files changed, 150 insertions(+), 185 deletions(-) diff --git a/package.json b/package.json index c5897992a..f4cb14d70 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "cross-env": "7.0.3", "cspell": "5.19.2", "enquirer": "2.3.6", - "esbuild": "0.14.26", + "esbuild": "0.14.27", "esbuild-visualizer": "0.3.1", "eslint": "8.11.0", "eslint-config-prettier": "8.5.0", diff --git a/vendors/chalk.js b/vendors/chalk.js index 65758d58a..0cd39b0ad 100644 --- a/vendors/chalk.js +++ b/vendors/chalk.js @@ -23,27 +23,20 @@ var __spreadValues = (a, b) => { return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); -var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; -var __reExport = (target, module2, copyDefault, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) - __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } - return target; + return to; }; -var __toESM = (module2, isNodeMode) => { - return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); -}; -var __toCommonJS = /* @__PURE__ */ ((cache) => { - return (module2, temp) => { - return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp); - }; -})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0); +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // node_modules/chalk/source/index.js var source_exports = {}; @@ -54,6 +47,7 @@ __export(source_exports, { supportsColor: () => stdoutColor, supportsColorStderr: () => stderrColor }); +module.exports = __toCommonJS(source_exports); // node_modules/chalk/source/vendor/ansi-styles/index.js var ANSI_BACKGROUND_OFFSET = 10; @@ -525,7 +519,6 @@ Object.defineProperties(createChalk.prototype, styles); var chalk = createChalk(); var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); var source_default = chalk; -module.exports = __toCommonJS(source_exports); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { Chalk, diff --git a/vendors/execa.js b/vendors/execa.js index cae079ef2..e02477149 100644 --- a/vendors/execa.js +++ b/vendors/execa.js @@ -23,7 +23,6 @@ var __spreadValues = (a, b) => { return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); -var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); var __objRest = (source, exclude) => { var target = {}; for (var prop in source) @@ -43,22 +42,16 @@ var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; -var __reExport = (target, module2, copyDefault, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) - __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } - return target; + return to; }; -var __toESM = (module2, isNodeMode) => { - return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); -}; -var __toCommonJS = /* @__PURE__ */ ((cache) => { - return (module2, temp) => { - return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp); - }; -})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0); +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // node_modules/isexe/windows.js var require_windows = __commonJS({ @@ -880,6 +873,7 @@ __export(execa_exports, { execaNode: () => execaNode, execaSync: () => execaSync }); +module.exports = __toCommonJS(execa_exports); var import_node_buffer = require("buffer"); var import_node_path2 = __toESM(require("path"), 1); var import_node_child_process = __toESM(require("child_process"), 1); @@ -1897,7 +1891,6 @@ function execaNode(scriptPath, args, options = {}) { shell: false })); } -module.exports = __toCommonJS(execa_exports); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { execa, diff --git a/vendors/mem.js b/vendors/mem.js index 9d082affe..12d71f7ca 100644 --- a/vendors/mem.js +++ b/vendors/mem.js @@ -23,7 +23,6 @@ var __spreadValues = (a, b) => { return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); -var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; @@ -31,22 +30,16 @@ var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; -var __reExport = (target, module2, copyDefault, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) - __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } - return target; + return to; }; -var __toESM = (module2, isNodeMode) => { - return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); -}; -var __toCommonJS = /* @__PURE__ */ ((cache) => { - return (module2, temp) => { - return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp); - }; -})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0); +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // node_modules/p-defer/index.js var require_p_defer = __commonJS({ @@ -171,6 +164,7 @@ __export(dist_exports, { memClear: () => memClear, memDecorator: () => memDecorator }); +module.exports = __toCommonJS(dist_exports); // node_modules/mimic-fn/index.js var copyProperty = (to, from, property, ignoreNonConfigurable) => { @@ -272,7 +266,6 @@ function memClear(fn) { } cache.clear(); } -module.exports = __toCommonJS(dist_exports); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { memClear, diff --git a/vendors/string-width.js b/vendors/string-width.js index 914635988..bed36dfd4 100644 --- a/vendors/string-width.js +++ b/vendors/string-width.js @@ -6,7 +6,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; -var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; @@ -14,22 +13,16 @@ var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; -var __reExport = (target, module2, copyDefault, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) - __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } - return target; + return to; }; -var __toESM = (module2, isNodeMode) => { - return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); -}; -var __toCommonJS = /* @__PURE__ */ ((cache) => { - return (module2, temp) => { - return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp); - }; -})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0); +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // node_modules/emoji-regex/index.js var require_emoji_regex = __commonJS({ @@ -46,6 +39,7 @@ var string_width_exports = {}; __export(string_width_exports, { default: () => stringWidth }); +module.exports = __toCommonJS(string_width_exports); // node_modules/string-width/node_modules/ansi-regex/index.js function ansiRegex({ onlyFirst = false } = {}) { @@ -99,6 +93,5 @@ function stringWidth(string) { } return width; } -module.exports = __toCommonJS(string_width_exports); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = {}); diff --git a/vendors/tempy.js b/vendors/tempy.js index ce8117cdf..bf5ffee1f 100644 --- a/vendors/tempy.js +++ b/vendors/tempy.js @@ -23,7 +23,6 @@ var __spreadValues = (a, b) => { return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); -var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); var __objRest = (source, exclude) => { var target = {}; for (var prop in source) @@ -43,22 +42,16 @@ var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; -var __reExport = (target, module2, copyDefault, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) - __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } - return target; + return to; }; -var __toESM = (module2, isNodeMode) => { - return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); -}; -var __toCommonJS = /* @__PURE__ */ ((cache) => { - return (module2, temp) => { - return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp); - }; -})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0); +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // node_modules/temp-dir/index.js var require_temp_dir = __commonJS({ @@ -9688,6 +9681,7 @@ var tempy_exports = {}; __export(tempy_exports, { default: () => tempy_default }); +module.exports = __toCommonJS(tempy_exports); var import_node_fs = __toESM(require("fs"), 1); var import_node_path = __toESM(require("path"), 1); var import_node_stream = __toESM(require("stream"), 1); @@ -9871,7 +9865,6 @@ Object.defineProperty(tempy, "root", { } }); var tempy_default = tempy; -module.exports = __toCommonJS(tempy_exports); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = {}); /*! diff --git a/yarn.lock b/yarn.lock index 43df556fe..c72cf8c2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2776,90 +2776,90 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -esbuild-android-64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.26.tgz#c5cc52e1372b680e3e782583fa826b248a550a3d" - integrity sha512-HIyJ3VvigHfseaI0D+vsD8zKQ4roDUD962/vtO/KXzav6wR//Y//Qx1HUX8k5bQeQ7/0yCXlltY9VBw1MFnWFQ== +esbuild-android-64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.27.tgz#b868bbd9955a92309c69df628d8dd1945478b45c" + integrity sha512-LuEd4uPuj/16Y8j6kqy3Z2E9vNY9logfq8Tq+oTE2PZVuNs3M1kj5Qd4O95ee66yDGb3isaOCV7sOLDwtMfGaQ== -esbuild-android-arm64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.26.tgz#675695134565b0a39d8e3f7a0bd0f4c1ddea5f29" - integrity sha512-TxRCLxyU5yj3U8Bud9fCg3IxzIXXKaWcmDbvURm8JkRr0WvCAmwZBdLi5T8BasT1v5vrVE//M0KSHZod6HC6lA== +esbuild-android-arm64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.27.tgz#e7d6430555e8e9c505fd87266bbc709f25f1825c" + integrity sha512-E8Ktwwa6vX8q7QeJmg8yepBYXaee50OdQS3BFtEHKrzbV45H4foMOeEE7uqdjGQZFBap5VAqo7pvjlyA92wznQ== -esbuild-darwin-64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.26.tgz#7d83ba28bf178d21645b8118cb3280aad84e30ff" - integrity sha512-oZJBN+CkR47Fc7KB1vowZy2kb5r+WSnsBjVEw7aI8HmR6louAgTr4bs1NwzaF6MbLi41ajaw6RdipfsM1H9PvQ== +esbuild-darwin-64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.27.tgz#4dc7484127564e89b4445c0a560a3cb50b3d68e1" + integrity sha512-czw/kXl/1ZdenPWfw9jDc5iuIYxqUxgQ/Q+hRd4/3udyGGVI31r29LCViN2bAJgGvQkqyLGVcG03PJPEXQ5i2g== -esbuild-darwin-arm64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.26.tgz#4567ade51ba2f5f46c32a5b08880a93c7a683440" - integrity sha512-eYW+cmP3BGVPDp+wd9bRI5CN5HjkZnrMQtj46Mj//UsSh4SRvflAp3pjs3ooA+MCpIa9xZ8091HqLqpYi7KFWA== +esbuild-darwin-arm64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.27.tgz#469e59c665f84a8ed323166624c5e7b9b2d22ac1" + integrity sha512-BEsv2U2U4o672oV8+xpXNxN9bgqRCtddQC6WBh4YhXKDcSZcdNh7+6nS+DM2vu7qWIWNA4JbRG24LUUYXysimQ== -esbuild-freebsd-64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.26.tgz#e03526cd6e5e06e6b3ba405524d62b486bd5519a" - integrity sha512-Q+Hs27fSBkNfUHNhphSyWfF5lxl3o9S6LFlzkC5KofxLCnCESP+7YTzAWTosYGANsPT2mvYFOraFeYEokG+5DA== +esbuild-freebsd-64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.27.tgz#895df03bf5f87094a56c9a5815bf92e591903d70" + integrity sha512-7FeiFPGBo+ga+kOkDxtPmdPZdayrSzsV9pmfHxcyLKxu+3oTcajeZlOO1y9HW+t5aFZPiv7czOHM4KNd0tNwCA== -esbuild-freebsd-arm64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.26.tgz#7ddbbefdb51edcc48158aa8752041090a1e54f22" - integrity sha512-MT+FuC/63oz6j/jvWOMCNqnHBYm/bNhGPArUgQX8GRhofFCeqe0NRmJbhtlHZaEeErIIjHPZQ/nXs34mfiqo/Q== +esbuild-freebsd-arm64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.27.tgz#0b72a41a6b8655e9a8c5608f2ec1afdcf6958441" + integrity sha512-8CK3++foRZJluOWXpllG5zwAVlxtv36NpHfsbWS7TYlD8S+QruXltKlXToc/5ZNzBK++l6rvRKELu/puCLc7jA== -esbuild-linux-32@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.26.tgz#82d8c050dac0d1103dec2ad6537e419dc2247476" - integrity sha512-9gqSfJ8qMDvz7wXZoinNoe9/ekPpbT+/ZgVfZEeB72ETITVPHvMbG8i0E12wG366G01vMXtlxbD9IYJsMVhe6w== +esbuild-linux-32@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.27.tgz#43b8ba3803b0bbe7f051869c6a8bf6de1e95de28" + integrity sha512-qhNYIcT+EsYSBClZ5QhLzFzV5iVsP1YsITqblSaztr3+ZJUI+GoK8aXHyzKd7/CKKuK93cxEMJPpfi1dfsOfdw== -esbuild-linux-64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.26.tgz#f06b38cc28d84c688b587a54125c0122bf871c07" - integrity sha512-aPku1lCxxXmBr5LkENSlGIbY33jjQExDzaSrNV+dDA5bHXhFnpI9UkSe+vQzrSkxgO66vNjSTNDcxg3pOXBaBw== +esbuild-linux-64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.27.tgz#dc8072097327ecfadba1735562824ce8c05dd0bd" + integrity sha512-ESjck9+EsHoTaKWlFKJpPZRN26uiav5gkI16RuI8WBxUdLrrAlYuYSndxxKgEn1csd968BX/8yQZATYf/9+/qg== -esbuild-linux-arm64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.26.tgz#235a70b2f71933f814e8b14531c584974b52d972" - integrity sha512-S0boyzv5Yx+IN1A8253nEPzHqn/W/y+CRcLYFZ1E5DscqkY7EvBao6rhff3ZxaHU9Zrkn0pLVqlJdMx3rm6D4Q== +esbuild-linux-arm64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.27.tgz#c52b58cbe948426b1559910f521b0a3f396f10b8" + integrity sha512-no6Mi17eV2tHlJnqBHRLekpZ2/VYx+NfGxKcBE/2xOMYwctsanCaXxw4zapvNrGE9X38vefVXLz6YCF8b1EHiQ== -esbuild-linux-arm@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.26.tgz#709a303ae0794457d6c41d0df4f3fafb9de24b1d" - integrity sha512-m7ozLQozfgBmh9l3HWxDEVYEEG8GuTqzRoFuf9iX0xAlbtqmhhlm7M4zNMa2eyPEG+ejgHndAuvuB1hcOWvdJw== +esbuild-linux-arm@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.27.tgz#df869dbd67d4ee3a04b3c7273b6bd2b233e78a18" + integrity sha512-JnnmgUBdqLQO9hoNZQqNHFWlNpSX82vzB3rYuCJMhtkuaWQEmQz6Lec1UIxJdC38ifEghNTBsF9bbe8dFilnCw== -esbuild-linux-mips64le@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.26.tgz#b1a26af4e33d36dafea7579f876c5e2041c2236e" - integrity sha512-TyMRc2ctQV1g9ruHg1Y793e18uDigKKsgzcZPzfxZi2z+hGK1uaSdaejGdULEJBJVMXt3/NC1T1yq0vCTiYYgg== +esbuild-linux-mips64le@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.27.tgz#a2b646d9df368b01aa970a7b8968be6dd6b01d19" + integrity sha512-NolWP2uOvIJpbwpsDbwfeExZOY1bZNlWE/kVfkzLMsSgqeVcl5YMen/cedRe9mKnpfLli+i0uSp7N+fkKNU27A== -esbuild-linux-ppc64le@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.26.tgz#1de1b2e5d93e3327b3a66520722ed8cb7d8d606a" - integrity sha512-aOJPP80m2gV8CyDqEMGbwZaGKuR45tZU1qYZ0+Cy8lWV4CWmd9iBWhCLP3eI9d7163m6t+0YO/6N3iLSVlNnpA== +esbuild-linux-ppc64le@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.27.tgz#9a21af766a0292578a3009c7408b8509cac7cefd" + integrity sha512-/7dTjDvXMdRKmsSxKXeWyonuGgblnYDn0MI1xDC7J1VQXny8k1qgNp6VmrlsawwnsymSUUiThhkJsI+rx0taNA== -esbuild-linux-riscv64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.26.tgz#4dc147218a2ed5c796fe1abc832703fd4e991108" - integrity sha512-2E5xK7SNZFXhFzRbZGtUqg3MbHnrx5XzqHaGLOLdHBqOSWIAdJKB3w6WtjpLkZvPuWrKeh51XnRpk1jm0TsUjQ== +esbuild-linux-riscv64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.27.tgz#344a27f91568056a5903ad5841b447e00e78d740" + integrity sha512-D+aFiUzOJG13RhrSmZgrcFaF4UUHpqj7XSKrIiCXIj1dkIkFqdrmqMSOtSs78dOtObWiOrFCDDzB24UyeEiNGg== -esbuild-linux-s390x@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.26.tgz#12affff5f2d820e238cc5aa9aa7fd5f8f53c8d64" - integrity sha512-kfSuFea857mTYMp/RAFmMp9TBjf1T8F/dTRqLn2p+g8Ok30Cp1+mI2+YCmxz5Uw2JOfxyvpND0Ek1PGPMo1UsQ== +esbuild-linux-s390x@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.27.tgz#73a7309bd648a07ef58f069658f989a5096130db" + integrity sha512-CD/D4tj0U4UQjELkdNlZhQ8nDHU5rBn6NGp47Hiz0Y7/akAY5i0oGadhEIg0WCY/HYVXFb3CsSPPwaKcTOW3bg== -esbuild-netbsd-64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.26.tgz#7a1a0962f0c15e5ff945004626e9f038da0076bb" - integrity sha512-tWhLwfOOqdZRwvaSYIWuic9Cj+WRRCLHe//Bmlf0ThBur9/EssRTtVh6/rC2Okp7Eb4QcerA/1wjWLYLECYD7g== +esbuild-netbsd-64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.27.tgz#482a587cdbd18a6c264a05136596927deb46c30a" + integrity sha512-h3mAld69SrO1VoaMpYl3a5FNdGRE/Nqc+E8VtHOag4tyBwhCQXxtvDDOAKOUQexBGca0IuR6UayQ4ntSX5ij1Q== -esbuild-openbsd-64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.26.tgz#68e2949986fba77f17dfb86ee5b4e1f37cd302ca" - integrity sha512-Xj7IWpsPn/hgKNzwjLpnf6wMtV0lfw5bzn7N9vmiCKx9TBA28L2hI8G15O0s9atLKny4HpmCGwZWmReNF1Ui6g== +esbuild-openbsd-64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.27.tgz#e99f8cdc63f1628747b63edd124d53cf7796468d" + integrity sha512-xwSje6qIZaDHXWoPpIgvL+7fC6WeubHHv18tusLYMwL+Z6bEa4Pbfs5IWDtQdHkArtfxEkIZz77944z8MgDxGw== -esbuild-sunos-64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.26.tgz#a5c7930a7e86b7bd696aaf8379fd761d4feb1332" - integrity sha512-5odPsuhghCUYc3c1gEtz6pGq9cuGRDq1+iNdLBjZcz6IUebd0ay/AVORWchs5WddzyJA9hguxrKsPjECxX6OzQ== +esbuild-sunos-64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.27.tgz#8611d825bcb8239c78d57452e83253a71942f45c" + integrity sha512-/nBVpWIDjYiyMhuqIqbXXsxBc58cBVH9uztAOIfWShStxq9BNBik92oPQPJ57nzWXRNKQUEFWr4Q98utDWz7jg== esbuild-visualizer@0.3.1: version "0.3.1" @@ -2870,46 +2870,46 @@ esbuild-visualizer@0.3.1: open "^7.4.2" yargs "^16.2.0" -esbuild-windows-32@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.26.tgz#3eb5b7702355487e5939992f2cff2b0afdee9aa1" - integrity sha512-xSVyGV6xGQlAC/K+oBXC9YiGGqoKqQGXVEFQKlDGXD6rxHGK5Fch0ynuvkjaYWW/p8OWqxGVYcof5BvGjY49RA== +esbuild-windows-32@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.27.tgz#c06374206d4d92dd31d4fda299b09f51a35e82f6" + integrity sha512-Q9/zEjhZJ4trtWhFWIZvS/7RUzzi8rvkoaS9oiizkHTTKd8UxFwn/Mm2OywsAfYymgUYm8+y2b+BKTNEFxUekw== -esbuild-windows-64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.26.tgz#7fb4bf6e1ad27ecd463294df6ad60b27c9f09197" - integrity sha512-Q0Bm42+wIqHJ8yF96T7nXosILXROegRtMmuI1L0kry0YBHnCFMtjNRTyUwv8yi7o2XvVYh7DF0NHLDL4N34MuA== +esbuild-windows-64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.27.tgz#756631c1d301dfc0d1a887deed2459ce4079582f" + integrity sha512-b3y3vTSl5aEhWHK66ngtiS/c6byLf6y/ZBvODH1YkBM+MGtVL6jN38FdHUsZasCz9gFwYs/lJMVY9u7GL6wfYg== -esbuild-windows-arm64@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.26.tgz#3bff0b46a884ff8de3f6f5a82b171b08012b78e0" - integrity sha512-+l0DB0VV4LiSoDfNsGviK/2M88IR+/fOUfQoQx08RPu7OZ7gv9BqhRLZCSCT4qHT351OTH1nPv7avRXX6JRQcg== +esbuild-windows-arm64@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.27.tgz#ad7e187193dcd18768b16065a950f4441d7173f4" + integrity sha512-I/reTxr6TFMcR5qbIkwRGvldMIaiBu2+MP0LlD7sOlNXrfqIl9uNjsuxFPGEG4IRomjfQ5q8WT+xlF/ySVkqKg== -esbuild@0.14.26: - version "0.14.26" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.26.tgz#c83493ef55163d976241cc8ed077baf991f21201" - integrity sha512-v0zIYlFB9NZ82/hFljhvpA7f8rob66r68ymB7juMz6TYAAMYjKGoW+hrMfRRvic5MAOI2wE/SuykFvsELLa6eA== +esbuild@0.14.27: + version "0.14.27" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.27.tgz#41fe0f1b6b68b9f77cac025009bc54bb96e616f1" + integrity sha512-MZQt5SywZS3hA9fXnMhR22dv0oPGh6QtjJRIYbgL1AeqAoQZE+Qn5ppGYQAoHv/vq827flj4tIJ79Mrdiwk46Q== optionalDependencies: - esbuild-android-64 "0.14.26" - esbuild-android-arm64 "0.14.26" - esbuild-darwin-64 "0.14.26" - esbuild-darwin-arm64 "0.14.26" - esbuild-freebsd-64 "0.14.26" - esbuild-freebsd-arm64 "0.14.26" - esbuild-linux-32 "0.14.26" - esbuild-linux-64 "0.14.26" - esbuild-linux-arm "0.14.26" - esbuild-linux-arm64 "0.14.26" - esbuild-linux-mips64le "0.14.26" - esbuild-linux-ppc64le "0.14.26" - esbuild-linux-riscv64 "0.14.26" - esbuild-linux-s390x "0.14.26" - esbuild-netbsd-64 "0.14.26" - esbuild-openbsd-64 "0.14.26" - esbuild-sunos-64 "0.14.26" - esbuild-windows-32 "0.14.26" - esbuild-windows-64 "0.14.26" - esbuild-windows-arm64 "0.14.26" + esbuild-android-64 "0.14.27" + esbuild-android-arm64 "0.14.27" + esbuild-darwin-64 "0.14.27" + esbuild-darwin-arm64 "0.14.27" + esbuild-freebsd-64 "0.14.27" + esbuild-freebsd-arm64 "0.14.27" + esbuild-linux-32 "0.14.27" + esbuild-linux-64 "0.14.27" + esbuild-linux-arm "0.14.27" + esbuild-linux-arm64 "0.14.27" + esbuild-linux-mips64le "0.14.27" + esbuild-linux-ppc64le "0.14.27" + esbuild-linux-riscv64 "0.14.27" + esbuild-linux-s390x "0.14.27" + esbuild-netbsd-64 "0.14.27" + esbuild-openbsd-64 "0.14.27" + esbuild-sunos-64 "0.14.27" + esbuild-windows-32 "0.14.27" + esbuild-windows-64 "0.14.27" + esbuild-windows-arm64 "0.14.27" escalade@^3.1.1: version "3.1.1" From 6cdf21af085e42a3e058d10835689cdfdcd89ad0 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 16 Mar 2022 10:24:22 +0800 Subject: [PATCH 16/28] Fix comment (#12464) --- scripts/build/config.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build/config.mjs b/scripts/build/config.mjs index 87638ba24..5eb3b417b 100644 --- a/scripts/build/config.mjs +++ b/scripts/build/config.mjs @@ -25,8 +25,8 @@ const { require } = createEsmUtils(import.meta); /* `diff` use deprecated folder mapping "./" in the "exports" field, -so we can't `require("diff/lib/diff/array.js")` directory. -To reduce the bundle size +so we can't `require("diff/lib/diff/array.js")` directly. +To reduce the bundle size, replace the entry with smaller files. We can switch to deep require once https://github.com/kpdecker/jsdiff/pull/351 get merged */ From 9a070503a340f83319385ea02c69f301b8d9bd1f Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 16 Mar 2022 10:36:20 +0800 Subject: [PATCH 17/28] Build: Remove `mainFields` override (#12466) --- scripts/build/bundler.mjs | 1 - scripts/build/config.mjs | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/build/bundler.mjs b/scripts/build/bundler.mjs index 9968226f1..5681f7913 100644 --- a/scripts/build/bundler.mjs +++ b/scripts/build/bundler.mjs @@ -178,7 +178,6 @@ function* getEsbuildOptions(bundle, buildOptions) { external: [...(bundle.external ?? [])], // Disable esbuild auto discover `tsconfig.json` file tsconfig: path.join(__dirname, "empty-tsconfig.json"), - mainFields: ["main"], target: [...(bundle.esbuildTarget ?? ["node10"])], logLevel: "error", }; diff --git a/scripts/build/config.mjs b/scripts/build/config.mjs index 5eb3b417b..7b03ed0a4 100644 --- a/scripts/build/config.mjs +++ b/scripts/build/config.mjs @@ -143,7 +143,8 @@ const parsers = [ })), ], replaceModule: { - [require.resolve("debug")]: require.resolve("./shims/debug.cjs"), + [require.resolve("debug/src/browser.js")]: + require.resolve("./shims/debug.cjs"), }, }, { @@ -197,10 +198,6 @@ const parsers = [ replaceModule: { [require.resolve("parse-entities/decode-entity.browser.js")]: require.resolve("parse-entities/decode-entity.js"), - // Avoid `node:util` shim - [require.resolve("inherits")]: require.resolve( - "inherits/inherits_browser.js" - ), }, }, { From 4cae7e15a79429e29b1e36fad4b7d2d2f2dabd8d Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 16 Mar 2022 10:36:32 +0800 Subject: [PATCH 18/28] Build: Remove an extra new line in UMD bundle (#12467) --- scripts/build/esbuild-plugins/umd.mjs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/build/esbuild-plugins/umd.mjs b/scripts/build/esbuild-plugins/umd.mjs index 1d5f00209..0050ab354 100644 --- a/scripts/build/esbuild-plugins/umd.mjs +++ b/scripts/build/esbuild-plugins/umd.mjs @@ -118,10 +118,9 @@ export default function esbuildPluginUmd({ name }) { fs.writeFileSync( outfile, intro + - text.slice( - expectedOutput.start.length, - -expectedOutput.end.length - ) + + text + .slice(expectedOutput.start.length, -expectedOutput.end.length) + .trimEnd() + outro ); }); From cba25e6b095eb33e9185eb0657680fed3456e688 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Wed, 16 Mar 2022 13:09:58 +0900 Subject: [PATCH 19/28] Release 2.6.0 --- .github/ISSUE_TEMPLATE/formatting.md | 2 +- .github/ISSUE_TEMPLATE/integration.md | 2 +- CHANGELOG.md | 6 ++ docs/browser.md | 26 ++++----- package.json | 2 +- .../versioned_docs/version-stable/browser.md | 26 ++++----- website/versioned_docs/version-stable/cli.md | 4 ++ .../version-stable/configuration.md | 9 +++ .../versioned_docs/version-stable/index.md | 1 + .../versioned_docs/version-stable/options.md | 28 ++++++++- .../versioned_docs/version-stable/plugins.md | 32 +++++++--- .../versioned_docs/version-stable/webstorm.md | 58 +++---------------- 12 files changed, 106 insertions(+), 90 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index c5698f027..2a04b1517 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you: --> -**Prettier 2.5.1** +**Prettier 2.6.0** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index 5475c704a..25a39a882 100644 --- a/.github/ISSUE_TEMPLATE/integration.md +++ b/.github/ISSUE_TEMPLATE/integration.md @@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE: **Environments:** -- Prettier Version: 2.5.1 +- Prettier Version: 2.6.0 - Running Prettier via: - Runtime: - Operating System: diff --git a/CHANGELOG.md b/CHANGELOG.md index bfa58ad02..3cf9686a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.6.0 + +[diff](https://github.com/prettier/prettier/compare/2.5.1...2.6.0) + +🔗 [Release Notes](https://prettier.io/blog/2022/03/16/2.6.0.html) + # 2.5.1 [diff](https://github.com/prettier/prettier/compare/2.5.0...2.5.1) diff --git a/docs/browser.md b/docs/browser.md index 38c132e6c..5dcce5731 100644 --- a/docs/browser.md +++ b/docs/browser.md @@ -32,8 +32,8 @@ See below for examples. ### Global ```html - - + + - + +