diff --git a/.eslintignore b/.eslintignore index b7e97ace3..4095bf672 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ +.tmp !/*.js /tests/format/**/*.js /tests/integration/cli/ diff --git a/.github/workflows/bundler-friendly.yml b/.github/workflows/bundler-friendly.yml new file mode 100644 index 000000000..710e16fcd --- /dev/null +++ b/.github/workflows/bundler-friendly.yml @@ -0,0 +1,62 @@ +name: Bundler_Friendly + +on: + schedule: + # “At 00:00 on Sunday.” https://crontab.guru/#0%C2%A00%C2%A0*%C2%A0*%C2%A00 + - cron: "0 0 * * 0" + pull_request: + paths: + - "scripts/tools/bundle-test/**" + # This workflow file + - ".github/workflows/bundler-friendly.yml" + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + cache: "yarn" + + - name: Install Dependencies + run: yarn install --frozen-lockfile + + - name: Build Package + run: yarn build + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: dist + path: dist + + webpack: + name: Bundle Prettier with webpack + runs-on: ubuntu-latest + needs: [build] + defaults: + run: + working-directory: scripts/tools/bundle-test + steps: + - name: Checkout + uses: actions/checkout@v2.4.0 + + - name: Setup Node.js + uses: actions/setup-node@v2.5.1 + + - name: Download Artifact + uses: actions/download-artifact@v2 + with: + name: dist + path: dist + + - name: Install Dependencies + run: yarn install --frozen-lockfile + + - name: Test + run: yarn test diff --git a/.github/workflows/dev-package-test.yml b/.github/workflows/dev-package-test.yml index 7b4270853..3da079dd4 100644 --- a/.github/workflows/dev-package-test.yml +++ b/.github/workflows/dev-package-test.yml @@ -2,12 +2,14 @@ name: Dev_Package_Test on: schedule: - - cron: "0 0 * * 1" + # “At 00:00 on Sunday.” https://crontab.guru/#0%C2%A00%C2%A0*%C2%A0*%C2%A00 + - cron: "0 0 * * 0" pull_request: paths: - "package.json" - - ".github/workflows/dev-package-test.yml" - "yarn.lock" + # This workflow file + - ".github/workflows/dev-package-test.yml" jobs: test: diff --git a/.github/workflows/eslint-rules.yml b/.github/workflows/eslint-rules.yml index 248dec720..475e46651 100644 --- a/.github/workflows/eslint-rules.yml +++ b/.github/workflows/eslint-rules.yml @@ -4,10 +4,12 @@ on: push: paths: - "scripts/tools/eslint-plugin-prettier-internal-rules/**" + # This workflow file - ".github/workflows/eslint-rules.yml" pull_request: paths: - "scripts/tools/eslint-plugin-prettier-internal-rules/**" + # This workflow file - ".github/workflows/eslint-rules.yml" jobs: diff --git a/.gitignore b/.gitignore index 824eebe1c..bf4cd0b74 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,17 @@ -/.cache +# node_modules +# We have `node_modules` directory for tests, don't ignore them all /node_modules +/website/node_modules /scripts/release/node_modules +/scripts/tools/bundle-test/node_modules +/scripts/tools/eslint-plugin-prettier-internal-rules/node_modules + +.tmp *.log /errors /test*.* /.vscode /dist -/website/node_modules /website/build /website/i18n /website/static/playground.js @@ -22,5 +27,4 @@ package-lock.json !.yarn/versions .pnp.* .nyc_output -/scripts/tools/eslint-plugin-prettier-internal-rules/node_modules .devcontainer diff --git a/.prettierignore b/.prettierignore index 283fe8f06..f3d63e374 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,4 @@ +.tmp dist/ .cache/ coverage/ diff --git a/changelog_unreleased/cli/12477.md b/changelog_unreleased/cli/12477.md new file mode 100644 index 000000000..40b537db3 --- /dev/null +++ b/changelog_unreleased/cli/12477.md @@ -0,0 +1,12 @@ +#### Ignore `loglevel` when printing information (#12477 by @fisker) + + +```bash +# Prettier stable +prettier --loglevel silent --find-config-path index.js +# Nothing printed + +# Prettier main +prettier --loglevel silent --help no-color +# .prettierrc +``` diff --git a/changelog_unreleased/cli/12513.md b/changelog_unreleased/cli/12513.md new file mode 100644 index 000000000..4b854f74b --- /dev/null +++ b/changelog_unreleased/cli/12513.md @@ -0,0 +1,3 @@ +#### Fix minimist security issue (#12513 by @dependabot) + +Details: [Prototype Pollution](https://security.snyk.io/vuln/SNYK-JS-MINIMIST-559764) diff --git a/changelog_unreleased/misc/12485.md b/changelog_unreleased/misc/12485.md new file mode 100644 index 000000000..a2372ffb6 --- /dev/null +++ b/changelog_unreleased/misc/12485.md @@ -0,0 +1,6 @@ +#### Make artifact friendly for webpack (#12485, #12511 by @fisker) + +Fixes two problems when bundling our UMD files with webpack: + +- A error `` "`....__exportStar` is not a function" `` throws when running the bundles. +- Some files cause warning about `"Critical dependency: the request of a dependency is an expression"`. diff --git a/changelog_unreleased/typescript/12508.md b/changelog_unreleased/typescript/12508.md new file mode 100644 index 000000000..2113a7caa --- /dev/null +++ b/changelog_unreleased/typescript/12508.md @@ -0,0 +1,37 @@ +#### Fix non-idempotent formatting of function calls with complex type arguments (#12508 by @sosukesuzuki) + + +```tsx +// Input +const foo = + doSomething<{ foo1: "foo1", foo2: "foo2", foo3: "foo3", foo4: "foo4", foo5: "foo5" }>(); + +// Prettier stable (first) +const foo = + doSomething<{ + foo1: "foo1"; + foo2: "foo2"; + foo3: "foo3"; + foo4: "foo4"; + foo5: "foo5"; + }>(); + +// Prettier stable (second) +const foo = doSomething<{ + foo1: "foo1"; + foo2: "foo2"; + foo3: "foo3"; + foo4: "foo4"; + foo5: "foo5"; +}>(); + +// Prettier main +const foo = doSomething<{ + foo1: "foo1"; + foo2: "foo2"; + foo3: "foo3"; + foo4: "foo4"; + foo5: "foo5"; +}>(); + +``` diff --git a/package.json b/package.json index 354ee8c1e..a2800fde2 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,10 @@ "dependencies": { "@angular/compiler": "12.2.16", "@babel/code-frame": "7.16.7", - "@babel/parser": "7.17.3", + "@babel/parser": "7.17.8", "@glimmer/syntax": "0.84.1", "@iarna/toml": "2.2.5", - "@typescript-eslint/typescript-estree": "5.15.0", + "@typescript-eslint/typescript-estree": "5.16.0", "acorn": "8.7.0", "acorn-jsx": "5.3.2", "angular-estree-parser": "2.5.0", @@ -49,7 +49,7 @@ "fast-glob": "3.2.11", "fast-json-stable-stringify": "2.1.0", "find-parent-dir": "0.3.1", - "flow-parser": "0.173.0", + "flow-parser": "0.174.1", "get-stdin": "8.0.0", "graphql": "15.6.1", "html-element-attributes": "3.1.0", @@ -58,7 +58,7 @@ "html-void-elements": "2.0.1", "ignore": "5.2.0", "jest-docblock": "27.5.1", - "json5": "2.2.0", + "json5": "2.2.1", "leven": "4.0.0", "lines-and-columns": "2.0.3", "linguist-languages": "7.15.0", @@ -66,7 +66,7 @@ "mem": "9.0.2", "meriyah": "4.2.0", "micromatch": "4.0.4", - "minimist": "1.2.5", + "minimist": "1.2.6", "n-readlines": "1.0.1", "outdent": "0.8.0", "parse-srcset": "ikatyang/parse-srcset#54eb9c1cb21db5c62b4d0e275d7249516df6f0ee", @@ -93,7 +93,7 @@ "yaml-unist-parser": "1.3.1" }, "devDependencies": { - "@babel/core": "7.17.7", + "@babel/core": "7.17.8", "@babel/preset-env": "7.16.11", "@babel/types": "7.17.0", "@esbuild-plugins/node-modules-polyfill": "0.1.4", @@ -102,7 +102,7 @@ "@prettier/jest-light-runner": "file:./tests/config/jest-light-runner", "@types/estree": "0.0.51", "@types/jest": "27.4.1", - "@typescript-eslint/eslint-plugin": "5.15.0", + "@typescript-eslint/eslint-plugin": "5.16.0", "babel-jest": "27.5.1", "benchmark": "2.1.4", "browserslist-to-esbuild": "1.1.1", @@ -116,11 +116,11 @@ "eslint-formatter-friendly": "7.0.0", "eslint-plugin-compat": "4.0.2", "eslint-plugin-import": "2.25.4", - "eslint-plugin-jest": "26.1.1", + "eslint-plugin-jest": "26.1.2", "eslint-plugin-prettier-internal-rules": "2.0.1", "eslint-plugin-react": "7.29.4", - "eslint-plugin-regexp": "1.5.1", - "eslint-plugin-unicorn": "41.0.0", + "eslint-plugin-regexp": "1.6.0", + "eslint-plugin-unicorn": "41.0.1", "esm-utils": "3.0.0", "execa": "6.1.0", "jest": "27.5.1", diff --git a/scripts/build/bundler.mjs b/scripts/build/bundler.mjs index ee4580f69..953cce316 100644 --- a/scripts/build/bundler.mjs +++ b/scripts/build/bundler.mjs @@ -6,7 +6,6 @@ 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 esbuildPluginInteropDefault from "./esbuild-plugins/interop-default.mjs"; @@ -19,9 +18,53 @@ const { __dirname, readJsonSync, require } = createEsmUtils(import.meta); const packageJson = readJsonSync("../../package.json"); const umdTarget = browserslistToEsbuild(packageJson.browserslist); -const EXPORT_UNDEFINED_MODULE_REPLACEMENT = { - contents: "export default undefined", -}; + +function getBabelConfig(bundle) { + const config = { + babelrc: false, + assumptions: { + setSpreadProperties: true, + }, + sourceType: "unambiguous", + plugins: bundle.babelPlugins || [], + compact: false, + exclude: [/\/core-js\//], + }; + const targets = { node: "10" }; + if (bundle.target === "universal") { + targets.browsers = packageJson.browserslist; + } + config.presets = [ + [ + "@babel/preset-env", + { + targets, + exclude: [ + "es.array.unscopables.flat", + "es.array.unscopables.flat-map", + "es.array.sort", + "es.promise", + "es.promise.finally", + "es.string.replace", + "es.symbol.description", + "es.typed-array.*", + "web.*", + ], + modules: false, + useBuiltIns: "usage", + corejs: { + version: 3, + }, + debug: false, + }, + ], + ]; + config.plugins.push([ + "@babel/plugin-proposal-object-rest-spread", + { useBuiltIns: true }, + ]); + return config; +} const bundledFiles = [ ...bundles, @@ -32,7 +75,7 @@ const bundledFiles = [ })); function* getEsbuildOptions(bundle, buildOptions) { - const replaceText = [ + const replaceModule = [ // Use `require` directly { file: "*", @@ -45,11 +88,10 @@ function* getEsbuildOptions(bundle, buildOptions) { find: "const __dirname = path.dirname(fileURLToPath(import.meta.url));", replacement: "", }, - // `tslib` exports global variables + // #12493, not sure what the problem is, but replace the cjs version with esm version seems fix it { - file: require.resolve("tslib"), - find: "factory(createExporter(root", - replacement: "factory(createExporter({}", + module: require.resolve("tslib"), + path: require.resolve("tslib").replace(/tslib\.js$/, "tslib.es6.js"), }, ]; @@ -61,8 +103,8 @@ function* getEsbuildOptions(bundle, buildOptions) { if (bundle.target === "universal") { // We can't reference `process` in UMD bundles and this is // an undocumented "feature" - replaceText.push({ - file: "*", + replaceModule.push({ + module: "*", find: "process.env.PRETTIER_DEBUG", replacement: "globalThis.PRETTIER_DEBUG", }); @@ -78,20 +120,20 @@ function* getEsbuildOptions(bundle, buildOptions) { define.__dirname = JSON.stringify("/prettier-security-dirname-placeholder"); } - const replaceModule = {}; // Replace other bundled files if (bundle.target === "node") { // Replace bundled files and `package.json` with dynamic `require()` for (const { input, output } of bundledFiles) { - replaceModule[input] = { path: output, external: true }; + replaceModule.push({ module: input, external: output }); } } else { // Universal bundle only use version info from package.json // Replace package.json with `{version: "{VERSION}"}` - replaceModule[path.join(PROJECT_ROOT, "package.json")] = { - contents: JSON.stringify({ version: packageJson.version }), + replaceModule.push({ + module: path.join(PROJECT_ROOT, "package.json"), + text: JSON.stringify({ version: packageJson.version }), loader: "json", - }; + }); // Replace parser getters with `undefined` for (const file of [ @@ -105,17 +147,24 @@ function* getEsbuildOptions(bundle, buildOptions) { // This module requires file access, should not include in universal bundle "src/utils/get-interpreter.js", ]) { - replaceModule[path.join(PROJECT_ROOT, file)] = - EXPORT_UNDEFINED_MODULE_REPLACEMENT; + replaceModule.push({ + module: path.join(PROJECT_ROOT, file), + text: "export default undefined;", + }); } - // Prevent `esbuildPluginNodeModulePolyfills` include shim for this module - replaceModule.assert = require.resolve("./shims/assert.cjs"); - - // `esbuildPluginNodeModulePolyfills` didn't shim this module - replaceModule.module = { - contents: "export const createRequire = () => {};", - }; + replaceModule.push( + // Prevent `esbuildPluginNodeModulePolyfills` include shim for this module + { + module: "assert", + path: require.resolve("./shims/assert.cjs"), + }, + // `esbuildPluginNodeModulePolyfills` didn't shim this module + { + module: "module", + text: "export const createRequire = () => {};", + } + ); } let shouldMinify = buildOptions.minify; @@ -134,12 +183,10 @@ function* getEsbuildOptions(bundle, buildOptions) { plugins: [ esbuildPluginEvaluate(), esbuildPluginStripNodeProtocol(), - esbuildPluginReplaceModule({ ...replaceModule, ...bundle.replaceModule }), - bundle.target === "universal" && esbuildPluginNodeModulePolyfills(), - esbuildPluginReplaceText({ - filter: /\.[cm]?js$/, - replacements: [...replaceText, ...(bundle.replaceText ?? [])], + esbuildPluginReplaceModule({ + replacements: [...replaceModule, ...(bundle.replaceModule ?? [])], }), + bundle.target === "universal" && esbuildPluginNodeModulePolyfills(), buildOptions.onLicenseFound && esbuildPluginLicense({ cwd: PROJECT_ROOT, diff --git a/scripts/build/config.mjs b/scripts/build/config.mjs index 2884b8cc0..bf285d33f 100644 --- a/scripts/build/config.mjs +++ b/scripts/build/config.mjs @@ -1,6 +1,7 @@ import path from "node:path"; import { createRequire } from "node:module"; import createEsmUtils from "esm-utils"; +import { PROJECT_ROOT } from "../utils/index.mjs"; const { require } = createEsmUtils(import.meta); @@ -12,8 +13,7 @@ const { require } = createEsmUtils(import.meta); * @property {'node' | 'universal'} target - should generate a CJS only for node or universal bundle * @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 {{file: string, find: string, replacement: string}[]} replaceText - Text replacements + * @property {object[]} replaceModule - Module replacements * @property {string[]} babelPlugins - babel plugins * @property {boolean?} minify - minify * @property {string[]?} esbuildTarget - ESBuild target @@ -32,10 +32,8 @@ We can switch to deep require once https://github.com/kpdecker/jsdiff/pull/351 g */ const diffPackageDirectory = path.dirname(require.resolve("diff/package.json")); const replaceDiffPackageEntry = (file) => ({ - [path.join(diffPackageDirectory, "lib/index.mjs")]: path.join( - diffPackageDirectory, - file - ), + module: path.join(diffPackageDirectory, "lib/index.mjs"), + path: path.join(diffPackageDirectory, file), }); /** @type {Bundle[]} */ @@ -45,10 +43,10 @@ const parsers = [ }, { input: "src/language-js/parse/flow.js", - replaceText: [ + replaceModule: [ // `flow-parser` use this for `globalThis`, can't work in strictMode { - file: require.resolve("flow-parser"), + module: require.resolve("flow-parser"), find: "(function(){return this}())", replacement: "(globalThis)", }, @@ -56,43 +54,61 @@ const parsers = [ }, { input: "src/language-js/parse/typescript.js", - replaceText: [ + replaceModule: [ // `@typescript-eslint/typescript-estree` v4 { - file: "*", + module: "*", find: 'require("globby")', replacement: "{}", }, { - file: "*", + module: "*", find: "extra.projects = prepareAndTransformProjects(", replacement: "extra.projects = [] || prepareAndTransformProjects(", }, { - file: "*", + module: "*", find: "process.versions.node", replacement: JSON.stringify("999.999.999"), }, { - file: "*", + module: "*", find: "process.cwd()", replacement: JSON.stringify("/prettier-security-dirname-placeholder"), }, { - file: "*", + module: "*", find: 'require("perf_hooks")', replacement: "{}", }, { - file: "*", + module: "*", find: 'require("inspector")', replacement: "{}", }, { - file: "*", + module: "*", find: "typescriptVersionIsAtLeast[version] = semverCheck(version);", replacement: "typescriptVersionIsAtLeast[version] = true;", }, + // The next two replacement fixed webpack warning `Critical dependency: require function is used in a way in which dependencies cannot be statically extracted` + // #12338 + { + module: require.resolve( + "@typescript-eslint/typescript-estree/dist/create-program/shared.js" + ), + find: "moduleResolver = require(moduleResolverPath);", + replacement: "throw new Error('Dynamic require is not supported');", + }, + { + module: require.resolve("typescript"), + process(text) { + return text.replace( + /(?<=\n)(?\s+)function tryGetNodePerformanceHooks\(\) {.*?\n\k}(?=\n)/s, + "function tryGetNodePerformanceHooks() {}" + ); + }, + }, ...Object.entries({ // `typescript/lib/typescript.js` expose extra global objects @@ -138,29 +154,29 @@ const parsers = [ 'require("source-map-support").install()': "", "require(modulePath)": "undefined", }).map(([find, replacement]) => ({ - file: require.resolve("typescript"), + module: require.resolve("typescript"), find, replacement, })), + { + module: require.resolve("debug/src/browser.js"), + path: require.resolve("./shims/debug.cjs"), + }, ], - replaceModule: { - [require.resolve("debug/src/browser.js")]: - require.resolve("./shims/debug.cjs"), - }, }, { input: "src/language-js/parse/acorn-and-espree.js", name: "prettierPlugins.espree", // TODO: Rename this file to `parser-acorn-and-espree.js` or find a better way output: "parser-espree.js", - replaceText: [ + replaceModule: [ { - file: require.resolve("espree"), + module: require.resolve("espree"), find: "const Syntax = (function() {", replacement: "const Syntax = undefined && (function() {", }, { - file: require.resolve("espree"), + module: require.resolve("espree"), find: "var visitorKeys = require('eslint-visitor-keys');", replacement: "var visitorKeys;", }, @@ -171,9 +187,9 @@ const parsers = [ }, { input: "src/language-js/parse/angular.js", - replaceText: [ + replaceModule: [ { - file: "*", + module: "*", find: 'require("@angular/compiler/src/', replacement: 'require("@angular/compiler/esm2015/src/', }, @@ -181,14 +197,23 @@ const parsers = [ }, { input: "src/language-css/parser-postcss.js", - replaceText: [ + replaceModule: [ + // `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 { - // `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"), + module: require.resolve("postcss-values-parser/lib/parser.js"), find: "node.constructor.name === 'Word'", replacement: "node.type === 'word'", }, + // The following two replacements prevent load `source-map` module + { + module: require.resolve("postcss/lib/previous-map.js"), + text: "module.exports = class {};", + }, + { + module: require.resolve("postcss/lib/map-generator.js"), + text: "module.exports = class { generate() {} };", + }, ], }, { @@ -196,10 +221,12 @@ const parsers = [ }, { input: "src/language-markdown/parser-markdown.js", - replaceModule: { - [require.resolve("parse-entities/decode-entity.browser.js")]: - require.resolve("parse-entities/decode-entity.js"), - }, + replaceModule: [ + { + module: require.resolve("parse-entities/decode-entity.browser.js"), + path: require.resolve("parse-entities/decode-entity.js"), + }, + ], }, { input: "src/language-handlebars/parser-glimmer.js", @@ -209,12 +236,6 @@ const parsers = [ }, { input: "src/language-yaml/parser-yaml.js", - replaceModule: { - // Use `tslib.es6.js`, so we can avoid `globalThis` shim - [require.resolve("tslib")]: require - .resolve("tslib") - .replace(/tslib\.js$/, "tslib.es6.js"), - }, }, ].map((bundle) => { const { name } = bundle.input.match( @@ -234,14 +255,26 @@ const parsers = [ const coreBundles = [ { input: "src/index.js", - replaceText: [ + replaceModule: [ { - file: require.resolve("@iarna/toml/lib/toml-parser.js"), + module: require.resolve("@iarna/toml/lib/toml-parser.js"), find: "const utilInspect = eval(\"require('util').inspect\")", replacement: "const utilInspect = require('util').inspect", }, + // `editorconfig` use a older version of `semver` and only uses `semver.gte` + { + module: require.resolve("editorconfig"), + find: 'var semver = __importStar(require("semver"));', + replacement: ` + var semver = { + gte: require(${JSON.stringify( + require.resolve("semver/functions/gte") + )}) + }; + `, + }, + replaceDiffPackageEntry("lib/diff/array.js"), ], - replaceModule: replaceDiffPackageEntry("lib/diff/array.js"), }, { input: "src/document/index.js", @@ -255,14 +288,22 @@ const coreBundles = [ input: "src/standalone.js", name: "prettier", target: "universal", - replaceModule: { - [require.resolve("@babel/highlight")]: require.resolve( - "./shims/babel-highlight.cjs" - ), - [createRequire(require.resolve("vnopts")).resolve("chalk")]: - require.resolve("./shims/chalk.cjs"), - ...replaceDiffPackageEntry("lib/diff/array.js"), - }, + replaceModule: [ + { + module: require.resolve("@babel/highlight"), + path: require.resolve("./shims/babel-highlight.cjs"), + }, + { + module: createRequire(require.resolve("vnopts")).resolve("chalk"), + path: require.resolve("./shims/chalk.cjs"), + }, + replaceDiffPackageEntry("lib/diff/array.js"), + { + module: path.join(PROJECT_ROOT, "src/main/parser.js"), + find: "return requireParser(opts.parser);", + replacement: "", + }, + ], }, { input: "bin/prettier.js", @@ -276,17 +317,18 @@ const coreBundles = [ output: "cli.js", external: ["benchmark"], interopDefault: false, - replaceModule: replaceDiffPackageEntry("lib/patch/create.js"), + replaceModule: [replaceDiffPackageEntry("lib/patch/create.js")], }, { input: "src/common/third-party.cjs", output: "third-party.js", - replaceModule: { + replaceModule: [ // cosmiconfig@6 -> import-fresh can't find parentModule, since module is bundled - [require.resolve("parent-module")]: require.resolve( - "./shims/parent-module.cjs" - ), - }, + { + module: require.resolve("parent-module"), + path: require.resolve("./shims/parent-module.cjs"), + }, + ], }, ].map((bundle) => ({ type: "core", diff --git a/scripts/build/esbuild-plugins/license.mjs b/scripts/build/esbuild-plugins/license.mjs index 3c9e28d06..a9d121943 100644 --- a/scripts/build/esbuild-plugins/license.mjs +++ b/scripts/build/esbuild-plugins/license.mjs @@ -10,6 +10,10 @@ export default function esbuildPluginLicense(options) { build.initialOptions.metafile = true; build.onEnd((result) => { + if (result.errors.length > 0) { + return; + } + const files = Object.keys(result.metafile.inputs); const chunk = { modules: Object.fromEntries( diff --git a/scripts/build/esbuild-plugins/replace-module.mjs b/scripts/build/esbuild-plugins/replace-module.mjs index 1b06ec786..cf6fee283 100644 --- a/scripts/build/esbuild-plugins/replace-module.mjs +++ b/scripts/build/esbuild-plugins/replace-module.mjs @@ -1,66 +1,214 @@ -export default function esbuildPluginReplaceModule(replacements = {}) { - const pathReplacements = new Map(); - const contentsReplacements = new Map(); +import fs from "node:fs/promises"; - for (let [file, options] of Object.entries(replacements)) { - if (typeof options === "string") { - options = { path: options }; +const DEFAULT_ON_RESOLVE_CONCEPTS = { filter: /./, namespace: "file" }; +const DEFAULT_ON_LOAD_CONCEPTS = { + filter: /.(?:js|json|mjs|cjs)$/, + namespace: "file", +}; + +function processReplacements(replacements) { + const onResolveReplacements = new Map(); + const onLoadReplacements = new Map(); + const onLoadProcessors = new Map(); + + const checkPathReplaced = (module) => { + if (!onResolveReplacements.has(module)) { + return; } - if (Reflect.has(options, "path")) { - pathReplacements.set(file, options); + throw new Error(`module: '${module}' already replaced with another path.`); + }; + + const checkTextReplaced = (module) => { + if (!onLoadReplacements.has(module)) { + return; + } + + throw new Error( + `module: '${module}' already replaced with another content.` + ); + }; + + for (const replacement of replacements) { + const { module } = replacement; + + if (typeof module !== "string") { + throw new TypeError("'module' option is required."); + } + + if ( + Reflect.has(replacement, "external") || + Reflect.has(replacement, "path") + ) { + if (module === "*") { + throw new Error("Can not replace all modules with the same path."); + } + + checkPathReplaced(module); + + onResolveReplacements.set( + module, + Reflect.has(replacement, "external") + ? { external: true, path: replacement.external } + : { path: replacement.path } + ); + continue; } - if (Reflect.has(options, "contents")) { - contentsReplacements.set(file, options); + if (Reflect.has(replacement, "text")) { + if (module === "*") { + throw new Error("Can not replace all modules with the same content."); + } + + checkPathReplaced(module); + checkTextReplaced(module); + + onLoadReplacements.set(module, { + contents: replacement.text, + loader: replacement.loader, + }); + continue; } - throw new Error("'path' or 'contents' is required."); + checkPathReplaced(module); + checkTextReplaced(module); + + if (!onLoadProcessors.has(module)) { + onLoadProcessors.set(module, []); + } + + const processFunctions = onLoadProcessors.get(module); + + if (Reflect.has(replacement, "process")) { + const { process } = replacement; + if (typeof process !== "function") { + throw new TypeError("'process' option should be a function."); + } + + processFunctions.push(process); + continue; + } + + if ( + Reflect.has(replacement, "find") && + Reflect.has(replacement, "replacement") + ) { + processFunctions.push((text) => + text.replaceAll(replacement.find, replacement.replacement) + ); + continue; + } + + console.log(replacement); + throw new Error("Unexpected replacement option."); } + return { onResolveReplacements, onLoadReplacements, onLoadProcessors }; +} + +function setupOnResolveListener(build, { concepts, replacements }) { + if (replacements.size === 0) { + return; + } + + // `build.resolve()` will call `onResolve` listener + // Use a `Set` to avoid infinite loop + const seenModules = new Set(); + build.onResolve(concepts, async (args) => { + if ( + !( + args.kind === "require-call" || + args.kind === "import-statement" || + args.kind === "dynamic-import" + ) + ) { + return; + } + + const key = JSON.stringify(args); + if (seenModules.has(key)) { + return; + } + seenModules.add(key); + + const resolveResult = await build.resolve(args.path, { + importer: args.importer, + namespace: args.namespace, + resolveDir: args.resolveDir, + kind: args.kind, + pluginData: args.pluginData, + }); + + // `build.resolve()` seems not respecting `browser` field in `package.json`, + // `resolveResult` maybe not correct, return `undefined` to let esbuild process the file. + return replacements.get(resolveResult.path); + }); +} + +function setupOnLoadListener(build, { concepts, replacements, processors }) { + if (replacements.size === 0 && processors.size === 0) { + return; + } + + const processFunctionsForAllModules = processors.has("*") + ? processors.get("*") + : []; + + build.onLoad(concepts, async ({ path: file }) => { + if (replacements.has(file)) { + return replacements.get(file); + } + + const processFunctions = [ + ...processFunctionsForAllModules, + ...(processors.has(file) ? processors.get(file) : []), + ]; + + if (processFunctions.length === 0) { + return; + } + + const original = await fs.readFile(file, "utf8"); + + let text = original; + for (const process of processFunctions) { + text = process(text); + } + + // For files not JavaScript, we need add correct `loader` to the result, + // We can simply return `undefined` to let esbuild process the file. + if (original === text) { + return; + } + + return { contents: text }; + }); +} + +export default function esbuildPluginReplaceModule({ + onLoadConcepts = DEFAULT_ON_LOAD_CONCEPTS, + onResolveConcepts = DEFAULT_ON_RESOLVE_CONCEPTS, + replacements, +}) { + const { onResolveReplacements, onLoadReplacements, onLoadProcessors } = + processReplacements(replacements); + const onResolveListenerOptions = { + concepts: onResolveConcepts, + replacements: onResolveReplacements, + }; + const onLoadListenerOptions = { + concepts: onLoadConcepts, + replacements: onLoadReplacements, + processors: onLoadProcessors, + }; + return { name: "replace-module", setup(build) { - // `build.resolve()` will call `onResolve` listener - // Avoid infinite loop - const seen = new Set(); - - build.onResolve({ filter: /./ }, async (args) => { - if ( - !( - args.kind === "require-call" || - args.kind === "import-statement" || - args.kind === "dynamic-import" - ) || - args.namespace !== "file" - ) { - return; - } - - const key = JSON.stringify(args); - if (seen.has(key)) { - return; - } - seen.add(key); - - const resolveResult = await build.resolve(args.path, { - importer: args.importer, - namespace: args.namespace, - resolveDir: args.resolveDir, - kind: args.kind, - pluginData: args.pluginData, - }); - - // `build.resolve()` seems not respecting `browser` field in `package.json` - // Return `undefined` instead of `resolveResult` so esbuild can resolve correctly - return pathReplacements.get(resolveResult.path); - }); - - build.onLoad({ filter: /./ }, ({ path }) => - contentsReplacements.get(path) - ); + setupOnResolveListener(build, onResolveListenerOptions); + setupOnLoadListener(build, onLoadListenerOptions); }, }; } diff --git a/scripts/build/esbuild-plugins/replace-text.mjs b/scripts/build/esbuild-plugins/replace-text.mjs deleted file mode 100644 index a6dcf7289..000000000 --- a/scripts/build/esbuild-plugins/replace-text.mjs +++ /dev/null @@ -1,34 +0,0 @@ -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/scripts/build/esbuild-plugins/throw-warnings.mjs b/scripts/build/esbuild-plugins/throw-warnings.mjs index 62492e63b..7148d1f1c 100644 --- a/scripts/build/esbuild-plugins/throw-warnings.mjs +++ b/scripts/build/esbuild-plugins/throw-warnings.mjs @@ -7,8 +7,12 @@ export default function esbuildPluginThrowWarnings() { return { name: "throw-warnings", setup(build) { - build.onEnd(({ warnings }) => { - for (const warning of warnings) { + build.onEnd((result) => { + if (result.errors.length > 0) { + return; + } + + for (const warning of result.warnings) { if (ignoredWarnings.has(warning.text)) { continue; } diff --git a/scripts/build/esbuild-plugins/umd.mjs b/scripts/build/esbuild-plugins/umd.mjs index d7611bf12..0d090b6de 100644 --- a/scripts/build/esbuild-plugins/umd.mjs +++ b/scripts/build/esbuild-plugins/umd.mjs @@ -99,7 +99,11 @@ export default function esbuildPluginUmd(options) { esbuildOptions.globalName = temporaryName; esbuildOptions.format = "iife"; - build.onEnd(() => { + build.onEnd((result) => { + if (result.errors.length > 0) { + return; + } + if (!fs.existsSync(outfile)) { throw new Error(`${outfile} not exists`); } diff --git a/scripts/tools/bundle-test/index.js b/scripts/tools/bundle-test/index.js new file mode 100644 index 000000000..2150dc876 --- /dev/null +++ b/scripts/tools/bundle-test/index.js @@ -0,0 +1,96 @@ +import { fileURLToPath } from "node:url"; +import path from "node:path"; +import fs from "node:fs/promises"; +import { createRequire } from "node:module"; +import webpack from "webpack"; +import { DIST_DIR } from "../../../scripts/utils/index.mjs"; + +function runWebpack(config) { + return new Promise((resolve, reject) => { + webpack(config, (error, stats) => { + if (error) { + reject(error); + return; + } + + if (stats.hasErrors()) { + const { errors } = stats.toJson(); + const error = new Error(errors[0].message); + error.errors = errors; + reject(error); + return; + } + + resolve(stats); + }); + }); +} + +const TEMPORARY_DIRECTORY = fileURLToPath(new URL("./.tmp", import.meta.url)); + +/* `require` in `parser-typescript.js`, #12338 */ +(async () => { + const esmFilesDirectory = path.join(DIST_DIR, "esm"); + + const files = [ + (await fs.readdir(DIST_DIR)) + .filter( + (name) => + name.startsWith("parser-") || + name === "standalone.js" || + name === "doc.js" + ) + .map((name) => ({ + displayName: name, + name, + file: path.join(DIST_DIR, name), + })), + (await fs.readdir(esmFilesDirectory)).map((name) => ({ + displayName: `esm/${name}`, + name, + file: path.join(esmFilesDirectory, name), + })), + ].flat(); + + for (const { displayName, name, file } of files) { + console.log(`${displayName}: `); + const isEsmModule = name.endsWith(".mjs"); + + const stats = await runWebpack({ + mode: "production", + entry: file, + output: { + path: TEMPORARY_DIRECTORY, + filename: `${name}.[contenthash:7].${isEsmModule ? "mjs" : "cjs"}`, + }, + performance: { hints: false }, + optimization: { minimize: false }, + }); + const result = stats.toJson(); + const { warnings, assets } = result; + + if (warnings.length > 0) { + console.log(warnings); + throw new Error("Unexpected webpack warning."); + } + + if (assets.length > 1) { + console.log(assets); + throw new Error("Unexpected assets."); + } + + if (!isEsmModule) { + const outputFile = assets[0].name; + const require = createRequire(import.meta.url); + + try { + require(path.join(TEMPORARY_DIRECTORY, assets[0].name)); + } catch (error) { + console.log(`'${outputFile}' is not functional.`); + throw error; + } + } + + console.log(" Passed."); + } +})(); diff --git a/scripts/tools/bundle-test/package.json b/scripts/tools/bundle-test/package.json new file mode 100644 index 000000000..dd3ef136a --- /dev/null +++ b/scripts/tools/bundle-test/package.json @@ -0,0 +1,12 @@ +{ + "name": "@prettier/bundle-test", + "version": "0.0.0", + "private": "true", + "type": "module", + "devDependencies": { + "webpack": "5.70.0" + }, + "scripts": { + "test": "node ./index.js" + } +} diff --git a/scripts/tools/bundle-test/yarn.lock b/scripts/tools/bundle-test/yarn.lock new file mode 100644 index 000000000..8363c00db --- /dev/null +++ b/scripts/tools/bundle-test/yarn.lock @@ -0,0 +1,489 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/eslint-scope@^3.7.3": + version "3.7.3" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.3.tgz#125b88504b61e3c8bc6f870882003253005c3224" + integrity sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g== + dependencies: + "@types/eslint" "*" + "@types/estree" "*" + +"@types/eslint@*": + version "8.4.1" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.1.tgz#c48251553e8759db9e656de3efc846954ac32304" + integrity sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*", "@types/estree@^0.0.51": + version "0.0.51" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" + integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== + +"@types/json-schema@*", "@types/json-schema@^7.0.8": + version "7.0.10" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.10.tgz#9b05b7896166cd00e9cbd59864853abf65d9ac23" + integrity sha512-BLO9bBq59vW3fxCpD4o0N4U+DXsvwvIcl+jofw0frQo/GrBFC+/jRZj1E7kgp6dvTyNmA4y6JCV5Id/r3mNP5A== + +"@types/node@*": + version "17.0.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.21.tgz#864b987c0c68d07b4345845c3e63b75edd143644" + integrity sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ== + +"@webassemblyjs/ast@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" + integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== + dependencies: + "@webassemblyjs/helper-numbers" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + +"@webassemblyjs/floating-point-hex-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" + integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== + +"@webassemblyjs/helper-api-error@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" + integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== + +"@webassemblyjs/helper-buffer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" + integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== + +"@webassemblyjs/helper-numbers@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" + integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== + dependencies: + "@webassemblyjs/floating-point-hex-parser" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@xtuc/long" "4.2.2" + +"@webassemblyjs/helper-wasm-bytecode@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" + integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== + +"@webassemblyjs/helper-wasm-section@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" + integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + +"@webassemblyjs/ieee754@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" + integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" + integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== + dependencies: + "@xtuc/long" "4.2.2" + +"@webassemblyjs/utf8@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" + integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== + +"@webassemblyjs/wasm-edit@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" + integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/helper-wasm-section" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-opt" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + "@webassemblyjs/wast-printer" "1.11.1" + +"@webassemblyjs/wasm-gen@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" + integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" + +"@webassemblyjs/wasm-opt@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" + integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + +"@webassemblyjs/wasm-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" + integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" + +"@webassemblyjs/wast-printer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" + integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@xtuc/long" "4.2.2" + +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== + +"@xtuc/long@4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== + +acorn-import-assertions@^1.7.6: + version "1.8.0" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" + integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== + +acorn@^8.4.1, acorn@^8.5.0: + version "8.7.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" + integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== + +ajv-keywords@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" + integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== + +ajv@^6.12.5: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +browserslist@^4.14.5: + version "4.20.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.2.tgz#567b41508757ecd904dab4d1c646c612cd3d4f88" + integrity sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA== + dependencies: + caniuse-lite "^1.0.30001317" + electron-to-chromium "^1.4.84" + escalade "^3.1.1" + node-releases "^2.0.2" + picocolors "^1.0.0" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +caniuse-lite@^1.0.30001317: + version "1.0.30001317" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001317.tgz#0548fb28fd5bc259a70b8c1ffdbe598037666a1b" + integrity sha512-xIZLh8gBm4dqNX0gkzrBeyI86J2eCjWzYAs40q88smG844YIrN4tVQl/RhquHvKEKImWWFIVh1Lxe5n1G/N+GQ== + +chrome-trace-event@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" + integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== + +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +electron-to-chromium@^1.4.84: + version "1.4.86" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.86.tgz#90fe4a9787f48d6522957213408e08a8126b2ebc" + integrity sha512-EVTZ+igi8x63pK4bPuA95PXIs2b2Cowi3WQwI9f9qManLiZJOD1Lash1J3W4TvvcUCcIR4o/rgi9o8UicXSO+w== + +enhanced-resolve@^5.9.2: + version "5.9.2" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.9.2.tgz#0224dcd6a43389ebfb2d55efee517e5466772dd9" + integrity sha512-GIm3fQfwLJ8YZx2smuHpBKkXC1yOk+OBEmKckVyL0i/ea8mqDEykK3ld5dgH1QYPNyT/lIllxV2LULnxCHaHkA== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + +es-module-lexer@^0.9.0: + version "0.9.3" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" + integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +eslint-scope@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +events@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +glob-to-regexp@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== + +graceful-fs@^4.1.2, graceful-fs@^4.2.4, graceful-fs@^4.2.9: + version "4.2.9" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" + integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +jest-worker@^27.4.5: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +json-parse-better-errors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +loader-runner@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" + integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.27: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +neo-async@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== + +node-releases@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.2.tgz#7139fe71e2f4f11b47d4d2986aaf8c48699e0c01" + integrity sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +schema-utils@^3.1.0, schema-utils@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" + integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + +serialize-javascript@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0, source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +source-map@~0.7.2: + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +tapable@^2.1.1, tapable@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" + integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== + +terser-webpack-plugin@^5.1.3: + version "5.3.1" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.1.tgz#0320dcc270ad5372c1e8993fabbd927929773e54" + integrity sha512-GvlZdT6wPQKbDNW/GDQzZFg/j4vKU96yl2q6mcUkzKOgW4gwf1Z8cZToUCrz31XHlPWH8MVb1r2tFtdDtTGJ7g== + dependencies: + jest-worker "^27.4.5" + schema-utils "^3.1.1" + serialize-javascript "^6.0.0" + source-map "^0.6.1" + terser "^5.7.2" + +terser@^5.7.2: + version "5.12.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.12.1.tgz#4cf2ebed1f5bceef5c83b9f60104ac4a78b49e9c" + integrity sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ== + dependencies: + acorn "^8.5.0" + commander "^2.20.0" + source-map "~0.7.2" + source-map-support "~0.5.20" + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +watchpack@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.3.1.tgz#4200d9447b401156eeca7767ee610f8809bc9d25" + integrity sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA== + dependencies: + glob-to-regexp "^0.4.1" + graceful-fs "^4.1.2" + +webpack-sources@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" + integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== + +webpack@5.70.0: + version "5.70.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.70.0.tgz#3461e6287a72b5e6e2f4872700bc8de0d7500e6d" + integrity sha512-ZMWWy8CeuTTjCxbeaQI21xSswseF2oNOwc70QSKNePvmxE7XW36i7vpBMYZFAUHPwQiEbNGCEYIOOlyRbdGmxw== + dependencies: + "@types/eslint-scope" "^3.7.3" + "@types/estree" "^0.0.51" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/wasm-edit" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + acorn "^8.4.1" + acorn-import-assertions "^1.7.6" + browserslist "^4.14.5" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.9.2" + es-module-lexer "^0.9.0" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.9" + json-parse-better-errors "^1.0.2" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.1.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.1.3" + watchpack "^2.3.1" + webpack-sources "^3.2.3" diff --git a/scripts/utils/generate-schema.mjs b/scripts/utils/generate-schema.mjs index 9859825df..46151c1a9 100644 --- a/scripts/utils/generate-schema.mjs +++ b/scripts/utils/generate-schema.mjs @@ -80,6 +80,19 @@ function optionToSchema(option) { } if (option.array) { schema = wrapWithArraySchema(schema); + + // #10274 + if (option.name === "pluginSearchDirs") { + schema = { + oneOf: [ + schema, + { + enum: [false], + description: "Disable plugin autoloading.", + }, + ], + }; + } } return { description: option.description, diff --git a/src/cli/file-info.js b/src/cli/file-info.js index 26595fcb1..4f037bab4 100644 --- a/src/cli/file-info.js +++ b/src/cli/file-info.js @@ -1,5 +1,6 @@ import stringify from "fast-json-stable-stringify"; import prettier from "../index.js"; +import { printToScreen } from "./utils.js"; async function logFileInfoOrDie(context) { const { @@ -19,7 +20,7 @@ async function logFileInfoOrDie(context) { resolveConfig: config !== false, }); - context.logger.log(prettier.format(stringify(fileInfo), { parser: "json" })); + printToScreen(prettier.format(stringify(fileInfo), { parser: "json" })); } export default logFileInfoOrDie; diff --git a/src/cli/find-config-path.js b/src/cli/find-config-path.js index ed556cc84..346c32fd2 100644 --- a/src/cli/find-config-path.js +++ b/src/cli/find-config-path.js @@ -1,11 +1,12 @@ import path from "node:path"; import prettier from "../index.js"; +import { printToScreen } from "./utils.js"; async function logResolvedConfigPathOrDie(context) { const file = context.argv.findConfigPath; const configFile = await prettier.resolveConfigFile(file); if (configFile) { - context.logger.log(path.relative(process.cwd(), configFile)); + printToScreen(path.relative(process.cwd(), configFile)); } else { throw new Error(`Can not find configure file for "${file}"`); } diff --git a/src/cli/index.js b/src/cli/index.js index 5c74e73eb..02a5c288d 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -8,6 +8,7 @@ import { formatStdin, formatFiles } from "./format.js"; import logFileInfoOrDie from "./file-info.js"; import logResolvedConfigPathOrDie from "./find-config-path.js"; import prettierInternal from "./prettier-internal.js"; +import { printToScreen } from "./utils.js"; const { utils: { isNonEmptyArray }, @@ -68,12 +69,12 @@ async function main(rawArguments, logger) { } if (context.argv.version) { - logger.log(prettier.version); + printToScreen(prettier.version); return; } if (context.argv.help !== undefined) { - logger.log( + printToScreen( typeof context.argv.help === "string" && context.argv.help !== "" ? createDetailedUsage(context, context.argv.help) : createUsage(context) @@ -82,7 +83,7 @@ async function main(rawArguments, logger) { } if (context.argv.supportInfo) { - logger.log( + printToScreen( prettier.format(stringify(prettier.getSupportInfo()), { parser: "json", }) @@ -103,8 +104,8 @@ async function main(rawArguments, logger) { } else if (hasFilePatterns) { await formatFiles(context); } else { - logger.log(createUsage(context)); process.exitCode = 1; + printToScreen(createUsage(context)); } } diff --git a/src/cli/utils.js b/src/cli/utils.js new file mode 100644 index 000000000..6c0bff9fd --- /dev/null +++ b/src/cli/utils.js @@ -0,0 +1,6 @@ +"use strict"; + +// eslint-disable-next-line no-console +const printToScreen = console.log.bind(console); + +module.exports = { printToScreen }; diff --git a/src/language-js/print/assignment.js b/src/language-js/print/assignment.js index 6e5846410..e1ad497c1 100644 --- a/src/language-js/print/assignment.js +++ b/src/language-js/print/assignment.js @@ -441,7 +441,9 @@ function isCallExpressionWithComplexTypeArguments(node, print) { firstArg.type === "TSUnionType" || firstArg.type === "UnionTypeAnnotation" || firstArg.type === "TSIntersectionType" || - firstArg.type === "IntersectionTypeAnnotation" + firstArg.type === "IntersectionTypeAnnotation" || + firstArg.type === "TSTypeLiteral" || + firstArg.type === "ObjectTypeAnnotation" ) { return true; } diff --git a/src/main/parser.js b/src/main/parser.js index 961431043..7953ee134 100644 --- a/src/main/parser.js +++ b/src/main/parser.js @@ -49,17 +49,22 @@ function resolveParser(opts, parsers = getParsers(opts)) { ); } - try { - return { - parse: require(path.resolve(process.cwd(), opts.parser)), - astFormat: "estree", - locStart, - locEnd, - }; - } catch { - /* istanbul ignore next */ - throw new ConfigError(`Couldn't resolve parser "${opts.parser}"`); - } + // This line of code will be removed when bundling `standalone.js` + return requireParser(opts.parser); + } +} + +function requireParser(parser) { + try { + return { + parse: require(path.resolve(process.cwd(), parser)), + astFormat: "estree", + locStart, + locEnd, + }; + } catch { + /* istanbul ignore next */ + throw new ConfigError(`Couldn't resolve parser "${parser}"`); } } diff --git a/tests/format/flow/assignments/__snapshots__/jsfmt.spec.js.snap b/tests/format/flow/assignments/__snapshots__/jsfmt.spec.js.snap index d34376ab4..39d340a96 100644 --- a/tests/format/flow/assignments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/flow/assignments/__snapshots__/jsfmt.spec.js.snap @@ -110,3 +110,52 @@ const map: Map> = new Map(); ================================================================================ `; + +exports[`issue-12413.js format 1`] = ` +====================================options===================================== +parsers: ["babel-flow", "flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +let emit = + defineEmits<{ (event: "ready", canvas: HTMLCanvasElement): void; (event:"resize",canvas:HTMLCanvasElement):void; }>(); + +let abc = + func<{a:2,b:3,d:78,e:9,f:8,g:7,h:6,i:5,j:4,k:3,l:2,m:1,n:0,o:9,p:8,q:7,r:6,s:5,t:4,u:3,v:2,w:1,x:0,y:9,z:8}>(); + +=====================================output===================================== +let emit = defineEmits<{ + (event: "ready", canvas: HTMLCanvasElement): void, + (event: "resize", canvas: HTMLCanvasElement): void, +}>(); + +let abc = func<{ + a: 2, + b: 3, + d: 78, + e: 9, + f: 8, + g: 7, + h: 6, + i: 5, + j: 4, + k: 3, + l: 2, + m: 1, + n: 0, + o: 9, + p: 8, + q: 7, + r: 6, + s: 5, + t: 4, + u: 3, + v: 2, + w: 1, + x: 0, + y: 9, + z: 8, +}>(); + +================================================================================ +`; diff --git a/tests/format/flow/assignments/issue-12413.js b/tests/format/flow/assignments/issue-12413.js new file mode 100644 index 000000000..9161eb5f6 --- /dev/null +++ b/tests/format/flow/assignments/issue-12413.js @@ -0,0 +1,5 @@ +let emit = + defineEmits<{ (event: "ready", canvas: HTMLCanvasElement): void; (event:"resize",canvas:HTMLCanvasElement):void; }>(); + +let abc = + func<{a:2,b:3,d:78,e:9,f:8,g:7,h:6,i:5,j:4,k:3,l:2,m:1,n:0,o:9,p:8,q:7,r:6,s:5,t:4,u:3,v:2,w:1,x:0,y:9,z:8}>(); diff --git a/tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap index 1d7444082..2b8f6bc79 100644 --- a/tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap @@ -15,7 +15,7 @@ exports[`snippet: #0 [acorn] format 2`] = ` `; exports[`snippet: #0 [babel] format 1`] = ` -"'await' is not allowed in async function parameters. (2:20) +"'await' is only allowed within async functions and at the top levels of modules. (2:20) 1 | async function foo() { > 2 | function bar(x = await 2) {} | ^ diff --git a/tests/format/misc/errors/js/variable-declarator/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/variable-declarator/__snapshots__/jsfmt.spec.js.snap index 73283305f..8f52a13b4 100644 --- a/tests/format/misc/errors/js/variable-declarator/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/variable-declarator/__snapshots__/jsfmt.spec.js.snap @@ -8,7 +8,7 @@ exports[`invalid-const.js [acorn] format 1`] = ` `; exports[`invalid-const.js [babel] format 1`] = ` -"'Const declarations' require an initialization value. (1:10) +"Missing initializer in const declaration. (1:10) > 1 | const foo; | ^ 2 |" diff --git a/tests/format/typescript/assignment/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/assignment/__snapshots__/jsfmt.spec.js.snap index b2c3575e6..be749c189 100644 --- a/tests/format/typescript/assignment/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/assignment/__snapshots__/jsfmt.spec.js.snap @@ -443,6 +443,55 @@ const map: Map> = new Map(); ================================================================================ `; +exports[`issue-12413.ts format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +let emit = + defineEmits<{ (event: "ready", canvas: HTMLCanvasElement): void; (event:"resize",canvas:HTMLCanvasElement):void; }>(); + +let abc = + func<{a:2,b:3,d:78,e:9,f:8,g:7,h:6,i:5,j:4,k:3,l:2,m:1,n:0,o:9,p:8,q:7,r:6,s:5,t:4,u:3,v:2,w:1,x:0,y:9,z:8}>(); + +=====================================output===================================== +let emit = defineEmits<{ + (event: "ready", canvas: HTMLCanvasElement): void; + (event: "resize", canvas: HTMLCanvasElement): void; +}>(); + +let abc = func<{ + a: 2; + b: 3; + d: 78; + e: 9; + f: 8; + g: 7; + h: 6; + i: 5; + j: 4; + k: 3; + l: 2; + m: 1; + n: 0; + o: 9; + p: 8; + q: 7; + r: 6; + s: 5; + t: 4; + u: 3; + v: 2; + w: 1; + x: 0; + y: 9; + z: 8; +}>(); + +================================================================================ +`; + exports[`lone-arg.ts format 1`] = ` ====================================options===================================== parsers: ["typescript"] diff --git a/tests/format/typescript/assignment/issue-12413.ts b/tests/format/typescript/assignment/issue-12413.ts new file mode 100644 index 000000000..9161eb5f6 --- /dev/null +++ b/tests/format/typescript/assignment/issue-12413.ts @@ -0,0 +1,5 @@ +let emit = + defineEmits<{ (event: "ready", canvas: HTMLCanvasElement): void; (event:"resize",canvas:HTMLCanvasElement):void; }>(); + +let abc = + func<{a:2,b:3,d:78,e:9,f:8,g:7,h:6,i:5,j:4,k:3,l:2,m:1,n:0,o:9,p:8,q:7,r:6,s:5,t:4,u:3,v:2,w:1,x:0,y:9,z:8}>(); diff --git a/tests/format/typescript/conformance/parser/ecmascript5/Statements/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/conformance/parser/ecmascript5/Statements/__snapshots__/jsfmt.spec.js.snap index 749159cd4..5109b5905 100644 --- a/tests/format/typescript/conformance/parser/ecmascript5/Statements/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/conformance/parser/ecmascript5/Statements/__snapshots__/jsfmt.spec.js.snap @@ -53,9 +53,9 @@ for (var of of) { `; exports[`parserForInStatement2.ts [babel-ts] format 1`] = ` -"Missing semicolon. (1:12) +"Unexpected keyword 'in'. (1:10) > 1 | for (var in X) { - | ^ + | ^ 2 | } 3 |" `; diff --git a/tests/format/typescript/custom/abstract/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/custom/abstract/__snapshots__/jsfmt.spec.js.snap index 66fe20146..9fdf6fd07 100644 --- a/tests/format/typescript/custom/abstract/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/custom/abstract/__snapshots__/jsfmt.spec.js.snap @@ -11,7 +11,7 @@ abstract class X {} const -abstract +abstract = 1; class Y {} export let @@ -26,7 +26,7 @@ export class Y {} var abstract; class X {} -const abstract; +const abstract = 1; class Y {} export let abstract; diff --git a/tests/format/typescript/custom/abstract/abstractNewlineHandling.ts b/tests/format/typescript/custom/abstract/abstractNewlineHandling.ts index 4487225f1..b5c2f39e7 100644 --- a/tests/format/typescript/custom/abstract/abstractNewlineHandling.ts +++ b/tests/format/typescript/custom/abstract/abstractNewlineHandling.ts @@ -3,7 +3,7 @@ abstract class X {} const -abstract +abstract = 1; class Y {} export let diff --git a/tests/format/typescript/definite/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/definite/__snapshots__/jsfmt.spec.js.snap index 2fa0f6562..f8b8429b1 100644 --- a/tests/format/typescript/definite/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/definite/__snapshots__/jsfmt.spec.js.snap @@ -26,7 +26,7 @@ class MyComponent { ngModel!: ng.INgModelController; } -const x!: string +const x!: string = ''; var y!: MyComponent @@ -35,7 +35,7 @@ class MyComponent { ngModel!: ng.INgModelController; } -const x!: string; +const x!: string = ""; var y!: MyComponent; @@ -57,9 +57,9 @@ class Foo { } let a! = x -const b! +const b! = x var c/* */! = x -export const d! +export const d! = x =====================================output===================================== class Foo { @@ -71,9 +71,9 @@ class Foo { } let a! = x; -const b!; +const b! = x; var c! /* */ = x; -export const d!; +export const d! = x; ================================================================================ `; diff --git a/tests/format/typescript/definite/definite.ts b/tests/format/typescript/definite/definite.ts index 8febeb572..f6fd726d6 100644 --- a/tests/format/typescript/definite/definite.ts +++ b/tests/format/typescript/definite/definite.ts @@ -2,6 +2,6 @@ class MyComponent { ngModel!: ng.INgModelController; } -const x!: string +const x!: string = ''; var y!: MyComponent diff --git a/tests/format/typescript/definite/without-annotation.ts b/tests/format/typescript/definite/without-annotation.ts index 5eac08a23..c7930ec42 100644 --- a/tests/format/typescript/definite/without-annotation.ts +++ b/tests/format/typescript/definite/without-annotation.ts @@ -7,6 +7,6 @@ class Foo { } let a! = x -const b! +const b! = x var c/* */! = x -export const d! +export const d! = x diff --git a/tests/integration/__tests__/__snapshots__/schema.js.snap b/tests/integration/__tests__/__snapshots__/schema.js.snap index 82d6a8ce3..d76f18954 100644 --- a/tests/integration/__tests__/__snapshots__/schema.js.snap +++ b/tests/integration/__tests__/__snapshots__/schema.js.snap @@ -281,10 +281,20 @@ This option cannot be used with --range-start and --range-end.", "description": "Custom directory that contains prettier plugins in node_modules subdirectory. Overrides default behavior when plugins are searched relatively to the location of Prettier. Multiple values are accepted.", - "items": Object { - "type": "string", - }, - "type": "array", + "oneOf": Array [ + Object { + "items": Object { + "type": "string", + }, + "type": "array", + }, + Object { + "description": "Disable plugin autoloading.", + "enum": Array [ + false, + ], + }, + ], }, "plugins": Object { "default": Array [], diff --git a/tests/integration/__tests__/loglevel.js b/tests/integration/__tests__/loglevel.js index b874279d4..16130d3af 100644 --- a/tests/integration/__tests__/loglevel.js +++ b/tests/integration/__tests__/loglevel.js @@ -35,6 +35,85 @@ describe("Should use default level logger to log `--loglevel` error", () => { }); }); +describe("loglevel should not effect information print", () => { + for (const { argv, runOptions, assertOptions } of [ + { + argv: ["--version"], + assertOptions: { + stdout(value) { + expect(value).not.toBe(""); + }, + }, + }, + { + argv: ["--help"], + assertOptions: { + stdout(value) { + expect(value.includes("-v, --version")).toBe(true); + }, + }, + }, + { + argv: ["--help", "write"], + assertOptions: { + stdout(value) { + expect(value.startsWith("-w, --write")).toBe(true); + }, + }, + }, + { + argv: ["--support-info"], + assertOptions: { + stdout(value) { + expect(JSON.parse(value)).toBeDefined(); + }, + }, + }, + { + argv: ["--find-config-path", "any-file"], + assertOptions: { + stdout: ".prettierrc\n", + }, + }, + { + argv: ["--file-info", "any-js-file.js"], + assertOptions: { + stdout(value) { + expect(JSON.parse(value)).toEqual({ + ignored: false, + inferredParser: "babel", + }); + }, + }, + }, + { + argv: [], + runOptions: { isTTY: true }, + assertOptions: { + status: "non-zero", + stdout(value) { + expect(value.includes("-v, --version")).toBe(true); + }, + }, + }, + { + argv: ["--parser", "babel"], + runOptions: { input: "foo" }, + assertOptions: { stdout: "foo;\n" }, + }, + ]) { + runPrettier("cli/loglevel", ["--loglevel", "silent", ...argv], { + ...runOptions, + title: argv.join(" "), + }).test({ + stderr: "", + status: 0, + write: [], + ...assertOptions, + }); + } +}); + async function runPrettierWithLogLevel(logLevel, patterns) { const result = await runPrettier("cli/loglevel", [ "--loglevel", diff --git a/tests/integration/run-prettier.js b/tests/integration/run-prettier.js index bd6dd0aac..e76df2029 100644 --- a/tests/integration/run-prettier.js +++ b/tests/integration/run-prettier.js @@ -180,7 +180,7 @@ function runPrettier(dir, args = [], options = {}) { function testResult(testOptions) { for (const name of ["status", "stdout", "stderr", "write"]) { - test(`(${name})`, async () => { + test(`${options.title || ""}(${name})`, async () => { const result = await runCli(); const value = // \r is trimmed from jest snapshots by default; @@ -194,6 +194,8 @@ function runPrettier(dir, args = [], options = {}) { if (name in testOptions) { if (name === "status" && testOptions[name] === "non-zero") { expect(value).not.toBe(0); + } else if (typeof testOptions[name] === "function") { + testOptions[name](value); } else { expect(value).toEqual(testOptions[name]); } diff --git a/website/blog/2022-03-16-2.6.0.md b/website/blog/2022-03-16-2.6.0.md index 03f618864..0689d84c5 100644 --- a/website/blog/2022-03-16-2.6.0.md +++ b/website/blog/2022-03-16-2.6.0.md @@ -817,7 +817,7 @@ $ prettier . --no-plugin-search #### Infer parser for `.swcrc` ([#12320](https://github.com/prettier/prettier/pull/12320) by [@sosukesuzuki](https://github.com/sosukesuzuki)) -A [`.swcrc`](https://swc.rs/docs/configuration/swcrc) is handled using `json` parser. +Format the [`.swcrc`](https://swc.rs/docs/configuration/swcrc) file as a JSON file. ### Miscellaneous diff --git a/website/pages/en/index.js b/website/pages/en/index.js index bb7126efe..d7329d7b3 100755 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -283,31 +283,34 @@ const UsersSection = ({ language }) => { >
-

- Regularly used by more than 70% of respondents - to State of JS 2020 -

- +

Regularly used by:

+
- - + +

@@ -322,11 +325,8 @@ const UsersSection = ({ language }) => {

- - + +

diff --git a/website/pages/en/users/index.js b/website/pages/en/users/index.js index 0888c2d48..da4ade80c 100644 --- a/website/pages/en/users/index.js +++ b/website/pages/en/users/index.js @@ -23,28 +23,25 @@ class Users extends React.Component {

-
- Prettier is regularly used by more than 70% -  of the respondents to the “Utilities” section of - the  - - State of JS 2020 - {" "} - survey (14880 developers out of 20974). -
- - - +

Prettier is regularly used by:

+
{showcase}
diff --git a/website/static/images/state_of_js.svg b/website/static/images/state_of_js.svg deleted file mode 100644 index c83f98bf0..000000000 --- a/website/static/images/state_of_js.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/website/static/images/state_of_js_grey.svg b/website/static/images/state_of_js_grey.svg index 42892151d..0c4fde7e3 100644 --- a/website/static/images/state_of_js_grey.svg +++ b/website/static/images/state_of_js_grey.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/website/static/overrides.css b/website/static/overrides.css index 114606cc4..d3347ad1d 100644 --- a/website/static/overrides.css +++ b/website/static/overrides.css @@ -415,12 +415,17 @@ em { } .ecosystemSubSection p { - padding-top: 4px !important; + padding-top: 0 !important; font-size: 0.9em; color: rgb(176, 196, 206) !important; line-height: 1.2em !important; } +.ecosystemSubSection ul, +.ecosystemSubSection ul a { + color: rgb(176, 196, 206) !important; +} + .growOnHover { transition: transform 0.3s cubic-bezier(0.075, 0.82, 0.165, 1); } diff --git a/yarn.lock b/yarn.lock index 9d00bea07..f9575bf9a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -45,18 +45,18 @@ 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== +"@babel/core@7.17.8", "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.8.tgz#3dac27c190ebc3a4381110d46c80e77efe172e1a" + integrity sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.16.7" "@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/helpers" "^7.17.8" + "@babel/parser" "^7.17.8" "@babel/template" "^7.16.7" "@babel/traverse" "^7.17.3" "@babel/types" "^7.17.0" @@ -280,10 +280,10 @@ "@babel/traverse" "^7.16.8" "@babel/types" "^7.16.8" -"@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== +"@babel/helpers@^7.17.8": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.8.tgz#288450be8c6ac7e4e44df37bcc53d345e07bc106" + integrity sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw== dependencies: "@babel/template" "^7.16.7" "@babel/traverse" "^7.17.3" @@ -298,15 +298,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@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/parser@7.17.8", "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3", "@babel/parser@^7.17.8": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.8.tgz#2817fb9d885dd8132ea0f8eb615a6388cca1c240" + integrity sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ== "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.7": version "7.16.7" @@ -1735,14 +1730,14 @@ dependencies: "@types/yargs-parser" "*" -"@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== +"@typescript-eslint/eslint-plugin@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.16.0.tgz#78f246dd8d1b528fc5bfca99a8a64d4023a3d86d" + integrity sha512-SJoba1edXvQRMmNI505Uo4XmGbxCK9ARQpkvOd00anxzri9RNQk0DDCxD+LIl+jYhkzOJiOMMKYEHnHEODjdCw== dependencies: - "@typescript-eslint/scope-manager" "5.15.0" - "@typescript-eslint/type-utils" "5.15.0" - "@typescript-eslint/utils" "5.15.0" + "@typescript-eslint/scope-manager" "5.16.0" + "@typescript-eslint/type-utils" "5.16.0" + "@typescript-eslint/utils" "5.16.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -1750,59 +1745,59 @@ semver "^7.3.5" tsutils "^3.21.0" -"@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== +"@typescript-eslint/scope-manager@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.16.0.tgz#7e7909d64bd0c4d8aef629cdc764b9d3e1d3a69a" + integrity sha512-P+Yab2Hovg8NekLIR/mOElCDPyGgFZKhGoZA901Yax6WR6HVeGLbsqJkZ+Cvk5nts/dAlFKm8PfL43UZnWdpIQ== dependencies: - "@typescript-eslint/types" "5.15.0" - "@typescript-eslint/visitor-keys" "5.15.0" + "@typescript-eslint/types" "5.16.0" + "@typescript-eslint/visitor-keys" "5.16.0" -"@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== +"@typescript-eslint/type-utils@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.16.0.tgz#b482bdde1d7d7c0c7080f7f2f67ea9580b9e0692" + integrity sha512-SKygICv54CCRl1Vq5ewwQUJV/8padIWvPgCxlWPGO/OgQLCijY9G7lDu6H+mqfQtbzDNlVjzVWQmeqbLMBLEwQ== dependencies: - "@typescript-eslint/utils" "5.15.0" + "@typescript-eslint/utils" "5.16.0" debug "^4.3.2" tsutils "^3.21.0" -"@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/types@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.16.0.tgz#5827b011982950ed350f075eaecb7f47d3c643ee" + integrity sha512-oUorOwLj/3/3p/HFwrp6m/J2VfbLC8gjW5X3awpQJ/bSG+YRGFS4dpsvtQ8T2VNveV+LflQHjlLvB6v0R87z4g== -"@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== +"@typescript-eslint/typescript-estree@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.16.0.tgz#32259459ec62f5feddca66adc695342f30101f61" + integrity sha512-SE4VfbLWUZl9MR+ngLSARptUv2E8brY0luCdgmUevU6arZRY/KxYoLI/3V/yxaURR8tLRN7bmZtJdgmzLHI6pQ== dependencies: - "@typescript-eslint/types" "5.15.0" - "@typescript-eslint/visitor-keys" "5.15.0" + "@typescript-eslint/types" "5.16.0" + "@typescript-eslint/visitor-keys" "5.16.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.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== +"@typescript-eslint/utils@5.16.0", "@typescript-eslint/utils@^5.10.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.16.0.tgz#42218b459d6d66418a4eb199a382bdc261650679" + integrity sha512-iYej2ER6AwmejLWMWzJIHy3nPJeGDuCqf8Jnb+jAQVoPpmWzwQOfa9hWVB8GIQE5gsCv/rfN4T+AYb/V06WseQ== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.15.0" - "@typescript-eslint/types" "5.15.0" - "@typescript-eslint/typescript-estree" "5.15.0" + "@typescript-eslint/scope-manager" "5.16.0" + "@typescript-eslint/types" "5.16.0" + "@typescript-eslint/typescript-estree" "5.16.0" eslint-scope "^5.1.1" eslint-utils "^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== +"@typescript-eslint/visitor-keys@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.16.0.tgz#f27dc3b943e6317264c7492e390c6844cd4efbbb" + integrity sha512-jqxO8msp5vZDhikTwq9ubyMHqZ67UIvawohr4qF3KhlpL7gzSjOd+8471H3nh5LyABkaI85laEKKU8SnGUK5/g== dependencies: - "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/types" "5.16.0" eslint-visitor-keys "^3.0.0" abab@^2.0.3, abab@^2.0.5: @@ -3061,10 +3056,10 @@ eslint-plugin-import@2.25.4: resolve "^1.20.0" tsconfig-paths "^3.12.0" -eslint-plugin-jest@26.1.1: - version "26.1.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.1.1.tgz#7176dd745ef8bca3070263f62cdf112f2dfc9aa1" - integrity sha512-HRKOuPi5ADhza4ZBK5ufyNXy28bXXkib87w+pQqdvBhSTsamndh6sIAKPAUl8y0/n9jSWBdTPslrwtKWqkp8dA== +eslint-plugin-jest@26.1.2: + version "26.1.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.1.2.tgz#0f1a15c62889fffc3f78a773749d672f1bedb15f" + integrity sha512-1bXCoRODPkGN06n9KAMls4Jm0eyS+0Q/LWcIxhqWR2ycV0Z7lnx2c10idk4dtFIJY5xStgiIr5snC6/rxcXpbw== dependencies: "@typescript-eslint/utils" "^5.10.0" @@ -3093,10 +3088,10 @@ eslint-plugin-react@7.29.4: semver "^6.3.0" string.prototype.matchall "^4.0.6" -eslint-plugin-regexp@1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-regexp/-/eslint-plugin-regexp-1.5.1.tgz#982ea8936283035897d6bb1ba32c0ea5d9a4dee0" - integrity sha512-5v0rQIi54m2KycQHqmOAHrZhvI56GHmI2acr6zEffAqfeifTtobAEapv9Uf4o8//lGvwVkHKyjLoSbBNEFcfOA== +eslint-plugin-regexp@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-regexp/-/eslint-plugin-regexp-1.6.0.tgz#d757e40e53b51b67b84194387495e346774eca86" + integrity sha512-xkaQOzyY4PUukRd8b6zTq+QTtg0dePlCP2dZiM+XGSmvlpDeYiPJHfRDpAfS/sP9YtK6q7DGes1smCyPTD3Lkg== dependencies: comment-parser "^1.1.2" eslint-utils "^3.0.0" @@ -3107,10 +3102,10 @@ eslint-plugin-regexp@1.5.1: regexpp "^3.2.0" scslre "^0.1.6" -eslint-plugin-unicorn@41.0.0: - version "41.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-41.0.0.tgz#bf0974f8551ab4dd4aaae7d9cf53894040defbbd" - integrity sha512-xoJCaRc1uy5REg9DkVga1BkZV57jJxoqOcrU28QHZB89Lk5LdSqdVyTIt9JQVfHNKaiyJ7X+3iLlIn+VEHWEzA== +eslint-plugin-unicorn@41.0.1: + version "41.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-41.0.1.tgz#b49205b38e71e227d21fb5776f8d078a1dc637ca" + integrity sha512-gF5vo2dIj0YdNMQ/IMegiBkQdQ22GBFFVpdkJP+0og3w7XD4ypea0xQVRv6iofkLVR2w0phAdikcnU01ybd4Ow== dependencies: "@babel/helper-validator-identifier" "^7.15.7" ci-info "^3.3.0" @@ -3434,10 +3429,10 @@ flatten@^1.0.2: resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.3.tgz#c1283ac9f27b368abc1e36d1ff7b04501a30356b" integrity sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg== -flow-parser@0.173.0: - version "0.173.0" - resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.173.0.tgz#992539fe87b4448a660ac1c54ffa358301e7110b" - integrity sha512-gikomjo+jzdehhOCHP2Ca5y1HGK3jkODhUdTxk4a3SdyLAMBsEwb7KJETHzB4KQs7HhHcqhyT7mGmd9iT8B5Hg== +flow-parser@0.174.1: + version "0.174.1" + resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.174.1.tgz#bb81e17fe45a1e64d9752090e819a6744a539fa0" + integrity sha512-nDMOvlFR+4doLpB3OJpseHZ7uEr3ENptlF6qMas/kzQmNcLzMwfQeFX0gGJ/+em7UdldB/nGsk55tDTOvjbCuw== foreground-child@^2.0.0: version "2.0.0" @@ -4710,12 +4705,10 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json5@2.2.0, json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" +json5@2.2.1, json5@^2.1.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" + integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== json5@^1.0.1: version "1.0.1" @@ -4974,10 +4967,10 @@ minimatch@^3.0.4, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimist@1.2.5, minimist@^1.2.0, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== +minimist@1.2.6, minimist@^1.2.0: + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== mkdirp@1.0.4: version "1.0.4"