From c7b232c8f6925ce154f8c11a296345dbdc15e2ee Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 2 Mar 2022 13:40:59 +0800 Subject: [PATCH 01/14] Remove `leven` from `standalone.js` (#12382) --- src/cli/options/get-options-for-file.js | 3 +- src/cli/options/parse-cli-arguments.js | 2 ++ src/main/options-normalizer.js | 43 ++++++++++++++++++------- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/cli/options/get-options-for-file.js b/src/cli/options/get-options-for-file.js index e2bbe6507..0bfa2454a 100644 --- a/src/cli/options/get-options-for-file.js +++ b/src/cli/options/get-options-for-file.js @@ -2,6 +2,7 @@ const dashify = require("dashify"); const chalk = require("chalk"); +const leven = require("leven"); // eslint-disable-next-line no-restricted-modules const prettier = require("../../index.js"); const { optionsNormalizer } = require("../prettier-internal.js"); @@ -50,7 +51,7 @@ function parseArgsToOptions(context, overrideDefaults) { default: cliifyOptions(overrideDefaults, apiDetailedOptionMap), }), context.detailedOptions, - { logger: false, colorsModule: chalk } + { logger: false, colorsModule: chalk, levenshteinDistance: leven } ), context.detailedOptions ); diff --git a/src/cli/options/parse-cli-arguments.js b/src/cli/options/parse-cli-arguments.js index b96de1cff..55ecea1de 100644 --- a/src/cli/options/parse-cli-arguments.js +++ b/src/cli/options/parse-cli-arguments.js @@ -2,6 +2,7 @@ const pick = require("lodash/pick"); const camelCase = require("camelcase"); const chalk = require("chalk"); +const leven = require("leven"); const { optionsNormalizer: { normalizeCliOptions }, } = require("../prettier-internal.js"); @@ -27,6 +28,7 @@ function parseArgv(rawArguments, detailedOptions, logger, keys) { const normalized = normalizeCliOptions(argv, detailedOptions, { logger, colorsModule: chalk, + levenshteinDistance: leven, }); return { diff --git a/src/main/options-normalizer.js b/src/main/options-normalizer.js index 17742108f..5d1c16028 100644 --- a/src/main/options-normalizer.js +++ b/src/main/options-normalizer.js @@ -1,7 +1,6 @@ "use strict"; const vnopts = require("vnopts"); -const leven = require("leven"); const getLast = require("../utils/get-last.js"); const cliDescriptor = { @@ -17,9 +16,8 @@ const cliDescriptor = { : `${cliDescriptor.key(key)}=${value}`, }; -// To prevent `chalk` module from being included in the `standalone.js` bundle, -// it will take that as an argument if needed. -const getFlagSchema = (colorsModule) => +// To prevent `chalk` and `leven` module from being included in the `standalone.js` bundle, it will take that as an argument if needed. +const getFlagSchema = ({ colorsModule, levenshteinDistance }) => class FlagSchema extends vnopts.ChoiceSchema { constructor({ name, flags }) { super({ name, choices: flags }); @@ -31,7 +29,9 @@ const getFlagSchema = (colorsModule) => value.length > 0 && !this._flags.includes(value) ) { - const suggestion = this._flags.find((flag) => leven(flag, value) < 3); + const suggestion = this._flags.find( + (flag) => levenshteinDistance(flag, value) < 3 + ); if (suggestion) { utils.logger.warn( [ @@ -58,7 +58,13 @@ let hasDeprecationWarned; function normalizeOptions( options, optionInfos, - { logger, isCLI = false, passThrough = false, colorsModule } = {} + { + logger, + isCLI = false, + passThrough = false, + colorsModule, + levenshteinDistance, + } = {} ) { const unknown = !passThrough ? (key, value, options) => { @@ -75,7 +81,11 @@ function normalizeOptions( : (key, value) => ({ [key]: value }); const descriptor = isCLI ? cliDescriptor : vnopts.apiDescriptor; - const schemas = optionInfosToSchemas(optionInfos, { isCLI, colorsModule }); + const schemas = optionInfosToSchemas(optionInfos, { + isCLI, + colorsModule, + levenshteinDistance, + }); const normalizer = new vnopts.Normalizer(schemas, { logger, unknown, @@ -101,7 +111,10 @@ function normalizeOptions( return normalized; } -function optionInfosToSchemas(optionInfos, { isCLI, colorsModule }) { +function optionInfosToSchemas( + optionInfos, + { isCLI, colorsModule, levenshteinDistance } +) { const schemas = []; if (isCLI) { @@ -110,7 +123,12 @@ function optionInfosToSchemas(optionInfos, { isCLI, colorsModule }) { for (const optionInfo of optionInfos) { schemas.push( - optionInfoToSchema(optionInfo, { isCLI, optionInfos, colorsModule }) + optionInfoToSchema(optionInfo, { + isCLI, + optionInfos, + colorsModule, + levenshteinDistance, + }) ); if (optionInfo.alias && isCLI) { @@ -126,7 +144,10 @@ function optionInfosToSchemas(optionInfos, { isCLI, colorsModule }) { return schemas; } -function optionInfoToSchema(optionInfo, { isCLI, optionInfos, colorsModule }) { +function optionInfoToSchema( + optionInfo, + { isCLI, optionInfos, colorsModule, levenshteinDistance } +) { const { name } = optionInfo; if (name === "plugin-search-dir" || name === "pluginSearchDirs") { @@ -182,7 +203,7 @@ function optionInfoToSchema(optionInfo, { isCLI, optionInfos, colorsModule }) { SchemaConstructor = vnopts.BooleanSchema; break; case "flag": - SchemaConstructor = getFlagSchema(colorsModule); + SchemaConstructor = getFlagSchema({ colorsModule, levenshteinDistance }); parameters.flags = optionInfos.flatMap((optionInfo) => [ optionInfo.alias, From 199a1bb38929c72861ead3cf44978a895eba65bb Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Wed, 2 Mar 2022 16:00:50 +0900 Subject: [PATCH 02/14] Support decorator auto accessors syntax (#12299) * Handle `ClassAccessorProperty` * Disable file * Add `babel-plugins` tests * Add more tests * Fix tests * Fix typo * Add changelog * Fix printing for no-semi * Update statement.js Co-authored-by: fisker Cheung --- changelog_unreleased/javascript/12299.md | 12 + src/language-js/parse/babel.js | 1 + src/language-js/print/class.js | 3 + src/language-js/print/statement.js | 3 +- src/language-js/printer-estree.js | 2 + tests/config/format-test.js | 30 +- .../__snapshots__/jsfmt.spec.js.snap | 36 + .../babel-plugins/decorator-auto-accessors.js | 3 + tests/format/js/babel-plugins/jsfmt.spec.js | 2 + .../__snapshots__/jsfmt.spec.js.snap | 798 ++++++++++++++++++ .../js/decorator-auto-accessors/basic.js | 3 + .../computed-with-newline.js | 4 + .../js/decorator-auto-accessors/computed.js | 3 + .../js/decorator-auto-accessors/jsfmt.spec.js | 25 + .../not-accessor-method.js | 3 + .../not-accessor-property.js | 3 + .../js/decorator-auto-accessors/private.js | 3 + .../static-computed.js | 3 + .../static-private.js | 3 + .../static-with-newline.js | 4 + .../js/decorator-auto-accessors/static.js | 3 + .../decorator-auto-accessors/with-newline.js | 4 + .../with-semicolon-1.js | 5 + .../with-semicolon-2.js | 4 + 24 files changed, 958 insertions(+), 2 deletions(-) create mode 100644 changelog_unreleased/javascript/12299.md create mode 100644 tests/format/js/babel-plugins/decorator-auto-accessors.js create mode 100644 tests/format/js/decorator-auto-accessors/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/format/js/decorator-auto-accessors/basic.js create mode 100644 tests/format/js/decorator-auto-accessors/computed-with-newline.js create mode 100644 tests/format/js/decorator-auto-accessors/computed.js create mode 100644 tests/format/js/decorator-auto-accessors/jsfmt.spec.js create mode 100644 tests/format/js/decorator-auto-accessors/not-accessor-method.js create mode 100644 tests/format/js/decorator-auto-accessors/not-accessor-property.js create mode 100644 tests/format/js/decorator-auto-accessors/private.js create mode 100644 tests/format/js/decorator-auto-accessors/static-computed.js create mode 100644 tests/format/js/decorator-auto-accessors/static-private.js create mode 100644 tests/format/js/decorator-auto-accessors/static-with-newline.js create mode 100644 tests/format/js/decorator-auto-accessors/static.js create mode 100644 tests/format/js/decorator-auto-accessors/with-newline.js create mode 100644 tests/format/js/decorator-auto-accessors/with-semicolon-1.js create mode 100644 tests/format/js/decorator-auto-accessors/with-semicolon-2.js diff --git a/changelog_unreleased/javascript/12299.md b/changelog_unreleased/javascript/12299.md new file mode 100644 index 000000000..a8cd28519 --- /dev/null +++ b/changelog_unreleased/javascript/12299.md @@ -0,0 +1,12 @@ +#### Support decorator auto accessors syntax (#12299 by @sosukesuzuki) + +Support auto accessors syntax that is introduced in [new decorators proposal](https://github.com/tc39/proposal-decorators). + + +```jsx +// Example +@defineElement("my-class") +class C extends HTMLElement { + @reactive accessor clicked = false; +} +``` diff --git a/src/language-js/parse/babel.js b/src/language-js/parse/babel.js index c73240d02..b6a290d6b 100644 --- a/src/language-js/parse/babel.js +++ b/src/language-js/parse/babel.js @@ -39,6 +39,7 @@ const parseOptions = { "asyncDoExpressions", "regexpUnicodeSets", "destructuringPrivate", + "decoratorAutoAccessors", ], tokens: true, ranges: true, diff --git a/src/language-js/print/class.js b/src/language-js/print/class.js index 88644595e..dad89db26 100644 --- a/src/language-js/print/class.js +++ b/src/language-js/print/class.js @@ -217,6 +217,9 @@ function printClassProperty(path, options, print) { if (node.variance) { parts.push(print("variance")); } + if (node.type === "ClassAccessorProperty") { + parts.push("accessor "); + } parts.push( printPropertyKey(path, options, print), printOptionalToken(path), diff --git a/src/language-js/print/statement.js b/src/language-js/print/statement.js index b8575744f..da2ff299e 100644 --- a/src/language-js/print/statement.js +++ b/src/language-js/print/statement.js @@ -167,7 +167,8 @@ function printSwitchCaseConsequent(path, options, print) { const isClassProperty = ({ type }) => type === "ClassProperty" || type === "PropertyDefinition" || - type === "ClassPrivateProperty"; + type === "ClassPrivateProperty" || + type === "ClassAccessorProperty"; /** * @returns {boolean} */ diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js index 4321e9691..d9c233fa7 100644 --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -96,6 +96,7 @@ function genericPrint(path, options, print, args) { type === "ClassMethod" || type === "ClassPrivateMethod" || type === "ClassProperty" || + type === "ClassAccessorProperty" || type === "PropertyDefinition" || type === "TSAbstractPropertyDefinition" || type === "ClassPrivateProperty" || @@ -759,6 +760,7 @@ function printPathNoParens(path, options, print, args) { case "ClassProperty": case "PropertyDefinition": case "ClassPrivateProperty": + case "ClassAccessorProperty": return printClassProperty(path, options, print); case "TemplateElement": return replaceTextEndOfLine(node.value.raw); diff --git a/tests/config/format-test.js b/tests/config/format-test.js index 667b747b1..cd87cd622 100644 --- a/tests/config/format-test.js +++ b/tests/config/format-test.js @@ -57,7 +57,28 @@ const espreeDisabledTests = new Set( ].map((directory) => path.join(__dirname, "../format/js", directory)) ); const acornDisabledTests = espreeDisabledTests; -const meriyahDisabledTests = espreeDisabledTests; +const meriyahDisabledTests = new Set([ + ...espreeDisabledTests, + // Meriyah does not support decorator auto accessors syntax. + // But meriyah can parse it as an ordinary class property. + // So meriyah does not throw parsing error for it. + ...[ + "basic.js", + "computed.js", + "private.js", + "static-computed.js", + "static-private.js", + "static.js", + "with-semicolon-1.js", + "with-semicolon-2.js", + ].map((filename) => + path.join(__dirname, "../format/js/decorator-auto-accessors", filename) + ), + path.join( + __dirname, + "../format/js/babel-plugins/decorator-auto-accessors.js" + ), +]); const isUnstable = (filename, options) => { const testFunction = unstableTests.get(filename); @@ -216,6 +237,13 @@ function runSpec(fixtures, parsers, options) { : format(code, formatOptions); for (const currentParser of allParsers) { + if ( + (currentParser === "espree" && espreeDisabledTests.has(filename)) || + (currentParser === "meriyah" && meriyahDisabledTests.has(filename)) || + (currentParser === "acorn" && acornDisabledTests.has(filename)) + ) { + continue; + } runTest({ parsers, name, diff --git a/tests/format/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap index b0732a255..c7d338bb5 100644 --- a/tests/format/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap @@ -534,6 +534,42 @@ typeof 1m === "decimal128"; ================================================================================ `; +exports[`decorator-auto-accessors.js [acorn] format 1`] = ` +"Unexpected token (2:12) + 1 | class C extends HTMLElement { +> 2 | accessor clicked = false; + | ^ + 3 | } + 4 |" +`; + +exports[`decorator-auto-accessors.js [espree] format 1`] = ` +"Unexpected token clicked (2:12) + 1 | class C extends HTMLElement { +> 2 | accessor clicked = false; + | ^ + 3 | } + 4 |" +`; + +exports[`decorator-auto-accessors.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class C extends HTMLElement { + accessor clicked = false; +} + +=====================================output===================================== +class C extends HTMLElement { + accessor clicked = false; +} + +================================================================================ +`; + exports[`decorators.js [acorn] format 1`] = ` "Unexpected character '@' (3:1) 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-decorators diff --git a/tests/format/js/babel-plugins/decorator-auto-accessors.js b/tests/format/js/babel-plugins/decorator-auto-accessors.js new file mode 100644 index 000000000..f43e1474a --- /dev/null +++ b/tests/format/js/babel-plugins/decorator-auto-accessors.js @@ -0,0 +1,3 @@ +class C extends HTMLElement { + accessor clicked = false; +} diff --git a/tests/format/js/babel-plugins/jsfmt.spec.js b/tests/format/js/babel-plugins/jsfmt.spec.js index 325322072..1e6b705ec 100644 --- a/tests/format/js/babel-plugins/jsfmt.spec.js +++ b/tests/format/js/babel-plugins/jsfmt.spec.js @@ -26,6 +26,7 @@ run_spec(__dirname, ["babel", "babel-ts", "babel-flow"], { "module-blocks.js", "async-do-expressions.js", "regex-v-flag.js", + "decorator-auto-accessors.js", ], espree: [ "decimal.js", @@ -50,6 +51,7 @@ run_spec(__dirname, ["babel", "babel-ts", "babel-flow"], { "module-blocks.js", "async-do-expressions.js", "regex-v-flag.js", + "decorator-auto-accessors.js", ], meriyah: [ "decimal.js", diff --git a/tests/format/js/decorator-auto-accessors/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/decorator-auto-accessors/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..128e914c1 --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,798 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`basic.js [acorn] format 1`] = ` +"Unexpected token (2:12) + 1 | class Foo { +> 2 | accessor bar; + | ^ + 3 | } + 4 |" +`; + +exports[`basic.js [espree] format 1`] = ` +"Unexpected token bar (2:12) + 1 | class Foo { +> 2 | accessor bar; + | ^ + 3 | } + 4 |" +`; + +exports[`basic.js - {"semi":false} [acorn] format 1`] = ` +"Unexpected token (2:12) + 1 | class Foo { +> 2 | accessor bar; + | ^ + 3 | } + 4 |" +`; + +exports[`basic.js - {"semi":false} [espree] format 1`] = ` +"Unexpected token bar (2:12) + 1 | class Foo { +> 2 | accessor bar; + | ^ + 3 | } + 4 |" +`; + +exports[`basic.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class Foo { + accessor bar; +} + +=====================================output===================================== +class Foo { + accessor bar +} + +================================================================================ +`; + +exports[`basic.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + accessor bar; +} + +=====================================output===================================== +class Foo { + accessor bar; +} + +================================================================================ +`; + +exports[`computed.js [acorn] format 1`] = ` +"Unexpected token (2:12) + 1 | class Foo { +> 2 | accessor [\\"bar\\"]; + | ^ + 3 | } + 4 |" +`; + +exports[`computed.js [espree] format 1`] = ` +"Unexpected token [ (2:12) + 1 | class Foo { +> 2 | accessor [\\"bar\\"]; + | ^ + 3 | } + 4 |" +`; + +exports[`computed.js - {"semi":false} [acorn] format 1`] = ` +"Unexpected token (2:12) + 1 | class Foo { +> 2 | accessor [\\"bar\\"]; + | ^ + 3 | } + 4 |" +`; + +exports[`computed.js - {"semi":false} [espree] format 1`] = ` +"Unexpected token [ (2:12) + 1 | class Foo { +> 2 | accessor [\\"bar\\"]; + | ^ + 3 | } + 4 |" +`; + +exports[`computed.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class Foo { + accessor ["bar"]; +} + +=====================================output===================================== +class Foo { + accessor ["bar"] +} + +================================================================================ +`; + +exports[`computed.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + accessor ["bar"]; +} + +=====================================output===================================== +class Foo { + accessor ["bar"]; +} + +================================================================================ +`; + +exports[`computed-with-newline.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class Foo { + accessor + ["bar"]; +} + +=====================================output===================================== +class Foo { + accessor; + ["bar"] +} + +================================================================================ +`; + +exports[`computed-with-newline.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + accessor + ["bar"]; +} + +=====================================output===================================== +class Foo { + accessor; + ["bar"]; +} + +================================================================================ +`; + +exports[`not-accessor-method.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class Foo { + accessor() {} +} + +=====================================output===================================== +class Foo { + accessor() {} +} + +================================================================================ +`; + +exports[`not-accessor-method.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + accessor() {} +} + +=====================================output===================================== +class Foo { + accessor() {} +} + +================================================================================ +`; + +exports[`not-accessor-property.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class Foo { + accessor = 123; +} + +=====================================output===================================== +class Foo { + accessor = 123 +} + +================================================================================ +`; + +exports[`not-accessor-property.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + accessor = 123; +} + +=====================================output===================================== +class Foo { + accessor = 123; +} + +================================================================================ +`; + +exports[`private.js [acorn] format 1`] = ` +"Unexpected token (2:12) + 1 | class Foo { +> 2 | accessor #bar; + | ^ + 3 | } + 4 |" +`; + +exports[`private.js [espree] format 1`] = ` +"Unexpected token #bar (2:12) + 1 | class Foo { +> 2 | accessor #bar; + | ^ + 3 | } + 4 |" +`; + +exports[`private.js - {"semi":false} [acorn] format 1`] = ` +"Unexpected token (2:12) + 1 | class Foo { +> 2 | accessor #bar; + | ^ + 3 | } + 4 |" +`; + +exports[`private.js - {"semi":false} [espree] format 1`] = ` +"Unexpected token #bar (2:12) + 1 | class Foo { +> 2 | accessor #bar; + | ^ + 3 | } + 4 |" +`; + +exports[`private.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class Foo { + accessor #bar; +} + +=====================================output===================================== +class Foo { + accessor #bar +} + +================================================================================ +`; + +exports[`private.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + accessor #bar; +} + +=====================================output===================================== +class Foo { + accessor #bar; +} + +================================================================================ +`; + +exports[`static.js [acorn] format 1`] = ` +"Unexpected token (2:19) + 1 | class Foo { +> 2 | static accessor bar; + | ^ + 3 | } + 4 |" +`; + +exports[`static.js [espree] format 1`] = ` +"Unexpected token bar (2:19) + 1 | class Foo { +> 2 | static accessor bar; + | ^ + 3 | } + 4 |" +`; + +exports[`static.js - {"semi":false} [acorn] format 1`] = ` +"Unexpected token (2:19) + 1 | class Foo { +> 2 | static accessor bar; + | ^ + 3 | } + 4 |" +`; + +exports[`static.js - {"semi":false} [espree] format 1`] = ` +"Unexpected token bar (2:19) + 1 | class Foo { +> 2 | static accessor bar; + | ^ + 3 | } + 4 |" +`; + +exports[`static.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class Foo { + static accessor bar; +} + +=====================================output===================================== +class Foo { + static accessor bar +} + +================================================================================ +`; + +exports[`static.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + static accessor bar; +} + +=====================================output===================================== +class Foo { + static accessor bar; +} + +================================================================================ +`; + +exports[`static-computed.js [acorn] format 1`] = ` +"Unexpected token (2:19) + 1 | class Foo { +> 2 | static accessor [\\"bar\\"]; + | ^ + 3 | } + 4 |" +`; + +exports[`static-computed.js [espree] format 1`] = ` +"Unexpected token [ (2:19) + 1 | class Foo { +> 2 | static accessor [\\"bar\\"]; + | ^ + 3 | } + 4 |" +`; + +exports[`static-computed.js - {"semi":false} [acorn] format 1`] = ` +"Unexpected token (2:19) + 1 | class Foo { +> 2 | static accessor [\\"bar\\"]; + | ^ + 3 | } + 4 |" +`; + +exports[`static-computed.js - {"semi":false} [espree] format 1`] = ` +"Unexpected token [ (2:19) + 1 | class Foo { +> 2 | static accessor [\\"bar\\"]; + | ^ + 3 | } + 4 |" +`; + +exports[`static-computed.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class Foo { + static accessor ["bar"]; +} + +=====================================output===================================== +class Foo { + static accessor ["bar"] +} + +================================================================================ +`; + +exports[`static-computed.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + static accessor ["bar"]; +} + +=====================================output===================================== +class Foo { + static accessor ["bar"]; +} + +================================================================================ +`; + +exports[`static-private.js [acorn] format 1`] = ` +"Unexpected token (2:19) + 1 | class Foo { +> 2 | static accessor #bar; + | ^ + 3 | } + 4 |" +`; + +exports[`static-private.js [espree] format 1`] = ` +"Unexpected token #bar (2:19) + 1 | class Foo { +> 2 | static accessor #bar; + | ^ + 3 | } + 4 |" +`; + +exports[`static-private.js - {"semi":false} [acorn] format 1`] = ` +"Unexpected token (2:19) + 1 | class Foo { +> 2 | static accessor #bar; + | ^ + 3 | } + 4 |" +`; + +exports[`static-private.js - {"semi":false} [espree] format 1`] = ` +"Unexpected token #bar (2:19) + 1 | class Foo { +> 2 | static accessor #bar; + | ^ + 3 | } + 4 |" +`; + +exports[`static-private.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class Foo { + static accessor #bar; +} + +=====================================output===================================== +class Foo { + static accessor #bar +} + +================================================================================ +`; + +exports[`static-private.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + static accessor #bar; +} + +=====================================output===================================== +class Foo { + static accessor #bar; +} + +================================================================================ +`; + +exports[`static-with-newline.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class Foo { + static accessor + bar; +} + +=====================================output===================================== +class Foo { + static accessor + bar +} + +================================================================================ +`; + +exports[`static-with-newline.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + static accessor + bar; +} + +=====================================output===================================== +class Foo { + static accessor; + bar; +} + +================================================================================ +`; + +exports[`with-newline.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class Foo { + accessor + bar; +} + +=====================================output===================================== +class Foo { + accessor + bar +} + +================================================================================ +`; + +exports[`with-newline.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + accessor + bar; +} + +=====================================output===================================== +class Foo { + accessor; + bar; +} + +================================================================================ +`; + +exports[`with-semicolon-1.js [acorn] format 1`] = ` +"Unexpected token (2:12) + 1 | class C { +> 2 | accessor clicked = \\"value\\"; + | ^ + 3 | [foo]() {} + 4 | } + 5 | " +`; + +exports[`with-semicolon-1.js [espree] format 1`] = ` +"Unexpected token clicked (2:12) + 1 | class C { +> 2 | accessor clicked = \\"value\\"; + | ^ + 3 | [foo]() {} + 4 | } + 5 | " +`; + +exports[`with-semicolon-1.js - {"semi":false} [acorn] format 1`] = ` +"Unexpected token (2:12) + 1 | class C { +> 2 | accessor clicked = \\"value\\"; + | ^ + 3 | [foo]() {} + 4 | } + 5 | " +`; + +exports[`with-semicolon-1.js - {"semi":false} [espree] format 1`] = ` +"Unexpected token clicked (2:12) + 1 | class C { +> 2 | accessor clicked = \\"value\\"; + | ^ + 3 | [foo]() {} + 4 | } + 5 | " +`; + +exports[`with-semicolon-1.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class C { + accessor clicked = "value"; + [foo]() {} +} + +=====================================output===================================== +class C { + accessor clicked = "value"; + [foo]() {} +} + +================================================================================ +`; + +exports[`with-semicolon-1.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class C { + accessor clicked = "value"; + [foo]() {} +} + +=====================================output===================================== +class C { + accessor clicked = "value"; + [foo]() {} +} + +================================================================================ +`; + +exports[`with-semicolon-2.js [acorn] format 1`] = ` +"Unexpected token (2:12) + 1 | class C { +> 2 | accessor clicked = \\"value\\"; + | ^ + 3 | *foo() {} + 4 | } + 5 |" +`; + +exports[`with-semicolon-2.js [espree] format 1`] = ` +"Unexpected token clicked (2:12) + 1 | class C { +> 2 | accessor clicked = \\"value\\"; + | ^ + 3 | *foo() {} + 4 | } + 5 |" +`; + +exports[`with-semicolon-2.js - {"semi":false} [acorn] format 1`] = ` +"Unexpected token (2:12) + 1 | class C { +> 2 | accessor clicked = \\"value\\"; + | ^ + 3 | *foo() {} + 4 | } + 5 |" +`; + +exports[`with-semicolon-2.js - {"semi":false} [espree] format 1`] = ` +"Unexpected token clicked (2:12) + 1 | class C { +> 2 | accessor clicked = \\"value\\"; + | ^ + 3 | *foo() {} + 4 | } + 5 |" +`; + +exports[`with-semicolon-2.js - {"semi":false} format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 +semi: false + | printWidth +=====================================input====================================== +class C { + accessor clicked = "value"; + *foo() {} +} + +=====================================output===================================== +class C { + accessor clicked = "value"; + *foo() {} +} + +================================================================================ +`; + +exports[`with-semicolon-2.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +class C { + accessor clicked = "value"; + *foo() {} +} + +=====================================output===================================== +class C { + accessor clicked = "value"; + *foo() {} +} + +================================================================================ +`; diff --git a/tests/format/js/decorator-auto-accessors/basic.js b/tests/format/js/decorator-auto-accessors/basic.js new file mode 100644 index 000000000..735a7a78e --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/basic.js @@ -0,0 +1,3 @@ +class Foo { + accessor bar; +} diff --git a/tests/format/js/decorator-auto-accessors/computed-with-newline.js b/tests/format/js/decorator-auto-accessors/computed-with-newline.js new file mode 100644 index 000000000..a067c2ad5 --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/computed-with-newline.js @@ -0,0 +1,4 @@ +class Foo { + accessor + ["bar"]; +} diff --git a/tests/format/js/decorator-auto-accessors/computed.js b/tests/format/js/decorator-auto-accessors/computed.js new file mode 100644 index 000000000..f77d3f867 --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/computed.js @@ -0,0 +1,3 @@ +class Foo { + accessor ["bar"]; +} diff --git a/tests/format/js/decorator-auto-accessors/jsfmt.spec.js b/tests/format/js/decorator-auto-accessors/jsfmt.spec.js new file mode 100644 index 000000000..818b9639f --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/jsfmt.spec.js @@ -0,0 +1,25 @@ +const parsers = ["babel", "babel-ts", "babel-flow"]; +const errors = { + espree: [ + "basic.js", + "computed.js", + "private.js", + "static-computed.js", + "static-private.js", + "static.js", + "with-semicolon-1.js", + "with-semicolon-2.js", + ], + acorn: [ + "basic.js", + "computed.js", + "private.js", + "static-computed.js", + "static-private.js", + "static.js", + "with-semicolon-1.js", + "with-semicolon-2.js", + ], +}; +run_spec(__dirname, parsers, { errors }); +run_spec(__dirname, parsers, { errors, semi: false }); diff --git a/tests/format/js/decorator-auto-accessors/not-accessor-method.js b/tests/format/js/decorator-auto-accessors/not-accessor-method.js new file mode 100644 index 000000000..d4092463f --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/not-accessor-method.js @@ -0,0 +1,3 @@ +class Foo { + accessor() {} +} diff --git a/tests/format/js/decorator-auto-accessors/not-accessor-property.js b/tests/format/js/decorator-auto-accessors/not-accessor-property.js new file mode 100644 index 000000000..fba4a91f8 --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/not-accessor-property.js @@ -0,0 +1,3 @@ +class Foo { + accessor = 123; +} diff --git a/tests/format/js/decorator-auto-accessors/private.js b/tests/format/js/decorator-auto-accessors/private.js new file mode 100644 index 000000000..9127772fc --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/private.js @@ -0,0 +1,3 @@ +class Foo { + accessor #bar; +} diff --git a/tests/format/js/decorator-auto-accessors/static-computed.js b/tests/format/js/decorator-auto-accessors/static-computed.js new file mode 100644 index 000000000..03a1bfe9b --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/static-computed.js @@ -0,0 +1,3 @@ +class Foo { + static accessor ["bar"]; +} diff --git a/tests/format/js/decorator-auto-accessors/static-private.js b/tests/format/js/decorator-auto-accessors/static-private.js new file mode 100644 index 000000000..eda1665ae --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/static-private.js @@ -0,0 +1,3 @@ +class Foo { + static accessor #bar; +} diff --git a/tests/format/js/decorator-auto-accessors/static-with-newline.js b/tests/format/js/decorator-auto-accessors/static-with-newline.js new file mode 100644 index 000000000..e297f3f66 --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/static-with-newline.js @@ -0,0 +1,4 @@ +class Foo { + static accessor + bar; +} diff --git a/tests/format/js/decorator-auto-accessors/static.js b/tests/format/js/decorator-auto-accessors/static.js new file mode 100644 index 000000000..10777835c --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/static.js @@ -0,0 +1,3 @@ +class Foo { + static accessor bar; +} diff --git a/tests/format/js/decorator-auto-accessors/with-newline.js b/tests/format/js/decorator-auto-accessors/with-newline.js new file mode 100644 index 000000000..30bf86a73 --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/with-newline.js @@ -0,0 +1,4 @@ +class Foo { + accessor + bar; +} diff --git a/tests/format/js/decorator-auto-accessors/with-semicolon-1.js b/tests/format/js/decorator-auto-accessors/with-semicolon-1.js new file mode 100644 index 000000000..504d41d7c --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/with-semicolon-1.js @@ -0,0 +1,5 @@ +class C { + accessor clicked = "value"; + [foo]() {} +} + \ No newline at end of file diff --git a/tests/format/js/decorator-auto-accessors/with-semicolon-2.js b/tests/format/js/decorator-auto-accessors/with-semicolon-2.js new file mode 100644 index 000000000..d6e55e3db --- /dev/null +++ b/tests/format/js/decorator-auto-accessors/with-semicolon-2.js @@ -0,0 +1,4 @@ +class C { + accessor clicked = "value"; + *foo() {} +} From 9b599ccaad8201af9e85f5749e53a9315d3fbdf6 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 2 Mar 2022 22:00:41 +0800 Subject: [PATCH 03/14] Regenerate vendors (#12386) --- scripts/vendors/vendor-meta.json | 2 +- vendors/tempy.js | 73 +++++++++++++++----------------- 2 files changed, 36 insertions(+), 39 deletions(-) diff --git a/scripts/vendors/vendor-meta.json b/scripts/vendors/vendor-meta.json index 196b35d88..90230d22a 100644 --- a/scripts/vendors/vendor-meta.json +++ b/scripts/vendors/vendor-meta.json @@ -1239,7 +1239,7 @@ { "name": "minimatch", "maintainers": [], - "version": "3.0.5", + "version": "3.1.2", "description": "a glob matcher in javascript", "repository": { "type": "git", diff --git a/vendors/tempy.js b/vendors/tempy.js index 6f46ee838..ce8117cdf 100644 --- a/vendors/tempy.js +++ b/vendors/tempy.js @@ -7269,12 +7269,12 @@ var require_minimatch = __commonJS({ "node_modules/minimatch/minimatch.js"(exports, module2) { module2.exports = minimatch; minimatch.Minimatch = Minimatch; - var path2 = (() => { + var path2 = function() { try { return require("path"); } catch (e) { } - })() || { + }() || { sep: "/" }; minimatch.sep = path2.sep; @@ -7307,9 +7307,8 @@ var require_minimatch = __commonJS({ }; } function ext(a, b) { - a = a || {}; b = b || {}; - const t = {}; + var t = {}; Object.keys(a).forEach(function(k) { t[k] = a[k]; }); @@ -7322,14 +7321,14 @@ var require_minimatch = __commonJS({ if (!def || typeof def !== "object" || !Object.keys(def).length) { return minimatch; } - const orig = minimatch; - const m = function minimatch2(p, pattern, options) { + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { return orig(p, pattern, ext(def, options)); }; m.Minimatch = function Minimatch2(pattern, options) { return new orig.Minimatch(pattern, ext(def, options)); }; - m.Minimatch.defaults = (options) => { + m.Minimatch.defaults = function defaults(options) { return orig.defaults(ext(def, options)).Minimatch; }; m.filter = function filter2(pattern, options) { @@ -7359,8 +7358,6 @@ var require_minimatch = __commonJS({ if (!options.nocomment && pattern.charAt(0) === "#") { return false; } - if (pattern.trim() === "") - return p === ""; return new Minimatch(pattern, options).match(p); } function Minimatch(pattern, options) { @@ -7371,7 +7368,7 @@ var require_minimatch = __commonJS({ if (!options) options = {}; pattern = pattern.trim(); - if (path2.sep !== "/") { + if (!options.allowWindowsEscape && path2.sep !== "/") { pattern = pattern.split(path2.sep).join("/"); } this.options = options; @@ -7381,14 +7378,13 @@ var require_minimatch = __commonJS({ this.negate = false; this.comment = false; this.empty = false; + this.partial = !!options.partial; this.make(); } Minimatch.prototype.debug = function() { }; Minimatch.prototype.make = make; function make() { - if (this._made) - return; var pattern = this.pattern; var options = this.options; if (!options.nocomment && pattern.charAt(0) === "#") { @@ -7402,7 +7398,9 @@ var require_minimatch = __commonJS({ this.parseNegate(); var set = this.globSet = this.braceExpand(); if (options.debug) - this.debug = console.error; + this.debug = function debug() { + console.error.apply(console, arguments); + }; this.debug(this.pattern, set); set = this.globParts = set.map(function(s) { return s.split(slashSplit); @@ -7454,7 +7452,7 @@ var require_minimatch = __commonJS({ return expand(pattern); } var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = (pattern) => { + var assertValidPattern = function(pattern) { if (typeof pattern !== "string") { throw new TypeError("invalid pattern"); } @@ -7467,12 +7465,16 @@ var require_minimatch = __commonJS({ function parse(pattern, isSub) { assertValidPattern(pattern); var options = this.options; - if (!options.noglobstar && pattern === "**") - return GLOBSTAR; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + else + pattern = "*"; + } if (pattern === "") return ""; var re = ""; - var hasMagic = false; + var hasMagic = !!options.nocase; var escaping = false; var patternListStack = []; var negativeLists = []; @@ -7595,17 +7597,15 @@ var require_minimatch = __commonJS({ escaping = false; continue; } - if (inClass) { - var cs = pattern.substring(classStart + 1, i); - try { - RegExp("[" + cs + "]"); - } catch (er) { - var sp = this.parse(cs, SUBPARSE); - re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; - hasMagic = hasMagic || sp[1]; - inClass = false; - continue; - } + var cs = pattern.substring(classStart + 1, i); + try { + RegExp("[" + cs + "]"); + } catch (er) { + var sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; + hasMagic = hasMagic || sp[1]; + inClass = false; + continue; } hasMagic = true; inClass = false; @@ -7647,8 +7647,8 @@ var require_minimatch = __commonJS({ } var addPatternStart = false; switch (re.charAt(0)) { - case ".": case "[": + case ".": case "(": addPatternStart = true; } @@ -7726,7 +7726,7 @@ var require_minimatch = __commonJS({ } minimatch.match = function(list, pattern, options) { options = options || {}; - const mm = new Minimatch(pattern, options); + var mm = new Minimatch(pattern, options); list = list.filter(function(f) { return mm.match(f); }); @@ -7735,8 +7735,9 @@ var require_minimatch = __commonJS({ } return list; }; - Minimatch.prototype.match = match; - function match(f, partial) { + Minimatch.prototype.match = function match(f, partial) { + if (typeof partial === "undefined") + partial = this.partial; this.debug("match", f, this.pattern); if (this.comment) return false; @@ -7775,7 +7776,7 @@ var require_minimatch = __commonJS({ if (options.flipNegate) return false; return this.negate; - } + }; Minimatch.prototype.matchOne = function(file, pattern, partial) { var options = this.options; this.debug("matchOne", { "this": this, file, pattern }); @@ -7823,11 +7824,7 @@ var require_minimatch = __commonJS({ } var hit; if (typeof p === "string") { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase(); - } else { - hit = f === p; - } + hit = f === p; this.debug("string match", p, f, hit); } else { hit = f.match(p); From 542549c37216e9a32d555276089ee889c15c9fca Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Fri, 4 Mar 2022 02:28:48 +0200 Subject: [PATCH 04/14] Refactor printing definite assignment assertions (#12351) * Refactor printing definite assignment assertions * Add changelog * Fix unexpected ! in var initializers --- changelog_unreleased/typescript/12351.md | 15 ++++++++ src/language-js/print/class.js | 7 +++- src/language-js/print/misc.js | 22 +++++++----- src/language-js/printer-estree.js | 2 ++ .../definite/__snapshots__/jsfmt.spec.js.snap | 36 +++++++++++++++++++ .../typescript/definite/without-annotation.ts | 12 +++++++ 6 files changed, 84 insertions(+), 10 deletions(-) create mode 100644 changelog_unreleased/typescript/12351.md create mode 100644 tests/format/typescript/definite/without-annotation.ts diff --git a/changelog_unreleased/typescript/12351.md b/changelog_unreleased/typescript/12351.md new file mode 100644 index 000000000..11f0276d2 --- /dev/null +++ b/changelog_unreleased/typescript/12351.md @@ -0,0 +1,15 @@ +#### Refactor printing definite assignment assertions (#12351 by @thorn0) + +Also now definite assignment assertions are printed even when they aren't followed by type annotations, which is an error in TS but not a parse error. + + +```ts +// Input +let a!; + +// Prettier stable +let a; + +// Prettier main +let a!; +``` diff --git a/src/language-js/print/class.js b/src/language-js/print/class.js index dad89db26..d8675c7d9 100644 --- a/src/language-js/print/class.js +++ b/src/language-js/print/class.js @@ -14,7 +14,11 @@ const { const { hasComment, CommentCheckFlags } = require("../utils/index.js"); const { getTypeParametersGroupId } = require("./type-parameters.js"); const { printMethod } = require("./function.js"); -const { printOptionalToken, printTypeAnnotation } = require("./misc.js"); +const { + printOptionalToken, + printTypeAnnotation, + printDefiniteToken, +} = require("./misc.js"); const { printPropertyKey } = require("./property.js"); const { printAssignment } = require("./assignment.js"); const { printClassMemberDecorators } = require("./decorators.js"); @@ -223,6 +227,7 @@ function printClassProperty(path, options, print) { parts.push( printPropertyKey(path, options, print), printOptionalToken(path), + printDefiniteToken(path), printTypeAnnotation(path, options, print) ); diff --git a/src/language-js/print/misc.js b/src/language-js/print/misc.js index 66616e8dd..3d5a7d0f8 100644 --- a/src/language-js/print/misc.js +++ b/src/language-js/print/misc.js @@ -25,6 +25,17 @@ function printOptionalToken(path) { return "?"; } +function printDefiniteToken(path) { + return path.getValue().definite || + path.match( + undefined, + (node, name) => + name === "id" && node.type === "VariableDeclarator" && node.definite + ) + ? "!" + : ""; +} + function printFunctionTypeParameters(path, options, print) { const fun = path.getValue(); if (fun.typeArguments) { @@ -43,11 +54,6 @@ function printTypeAnnotation(path, options, print) { } const parentNode = path.getParentNode(); - const isDefinite = - node.definite || - (parentNode && - parentNode.type === "VariableDeclarator" && - parentNode.definite); const isFunctionDeclarationIdentifier = parentNode.type === "DeclareFunction" && parentNode.id === node; @@ -56,10 +62,7 @@ function printTypeAnnotation(path, options, print) { return [" /*: ", print("typeAnnotation"), " */"]; } - return [ - isFunctionDeclarationIdentifier ? "" : isDefinite ? "!: " : ": ", - print("typeAnnotation"), - ]; + return [isFunctionDeclarationIdentifier ? "" : ": ", print("typeAnnotation")]; } function printBindExpressionCallee(path, options, print) { @@ -92,6 +95,7 @@ function printRestSpread(path, options, print) { module.exports = { printOptionalToken, + printDefiniteToken, printFunctionTypeParameters, printBindExpressionCallee, printTypeScriptModifiers, diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js index d9c233fa7..e4fcc925d 100644 --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -46,6 +46,7 @@ const { printTypeAnnotation, adjustClause, printRestSpread, + printDefiniteToken, } = require("./print/misc.js"); const { printImportDeclaration, @@ -292,6 +293,7 @@ function printPathNoParens(path, options, print, args) { return [ node.name, printOptionalToken(path), + printDefiniteToken(path), printTypeAnnotation(path, options, print), ]; } diff --git a/tests/format/typescript/definite/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/definite/__snapshots__/jsfmt.spec.js.snap index 0bc639f0d..2fa0f6562 100644 --- a/tests/format/typescript/definite/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/definite/__snapshots__/jsfmt.spec.js.snap @@ -41,3 +41,39 @@ var y!: MyComponent; ================================================================================ `; + +exports[`without-annotation.ts format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + a! + #b! + static c! + [d]! = 1 + 'e'! +} + +let a! = x +const b! +var c/* */! = x +export const d! + +=====================================output===================================== +class Foo { + a!; + #b!; + static c!; + [d]! = 1; + "e"!; +} + +let a! = x; +const b!; +var c! /* */ = x; +export const d!; + +================================================================================ +`; diff --git a/tests/format/typescript/definite/without-annotation.ts b/tests/format/typescript/definite/without-annotation.ts new file mode 100644 index 000000000..5eac08a23 --- /dev/null +++ b/tests/format/typescript/definite/without-annotation.ts @@ -0,0 +1,12 @@ +class Foo { + a! + #b! + static c! + [d]! = 1 + 'e'! +} + +let a! = x +const b! +var c/* */! = x +export const d! From 9ceeb0cb8aedede804ba5f961d6d26bddec2c6a5 Mon Sep 17 00:00:00 2001 From: Niklas Vatn <55627591+niklasvatn@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:49:28 +0100 Subject: [PATCH 05/14] Fix typo in blog about paying maintainers (#12381) --- website/blog/2022-01-06-prettier-begins-paying-maintainers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/blog/2022-01-06-prettier-begins-paying-maintainers.md b/website/blog/2022-01-06-prettier-begins-paying-maintainers.md index 26d496aa3..c2049b7bb 100644 --- a/website/blog/2022-01-06-prettier-begins-paying-maintainers.md +++ b/website/blog/2022-01-06-prettier-begins-paying-maintainers.md @@ -10,7 +10,7 @@ Prettier, an opinionated code formatter for JavaScript and many web languages, h -Open Source and Money has always been a tricky topic. We've tried many things with Prettier. Right after the project was open sourced, Facebook contracted [James Long](https://twitter.com/jlongster) for 2 weeks into order to polish it. Facebook also paid Christopher Chedeau ([vjeux](https://twitter.com/Vjeux)) for 9 months to work on it full time. Once there was \$10,000 in contributions, we gave everyone that contributed significantly the opportunity to redeem \$1,000 but due to the complexities in collecting the money, few people did. +Open Source and Money has always been a tricky topic. We've tried many things with Prettier. Right after the project was open sourced, Facebook contracted [James Long](https://twitter.com/jlongster) for 2 weeks in order to polish it. Facebook also paid Christopher Chedeau ([vjeux](https://twitter.com/Vjeux)) for 9 months to work on it full time. Once there was \$10,000 in contributions, we gave everyone that contributed significantly the opportunity to redeem \$1,000 but due to the complexities in collecting the money, few people did. We now have \$50,000 which is a sizable sum but not enough for someone with the skills to work on it to do it full time. But at the same time we shouldn't let it sit unused. So after a lot of thinking, we decided to provide a recurring \$1,500 to the two current maintainers of the project. They have been amazing stewards for the project for the past 2 years! From 828b7a30ea5b234f2e9c0d1af3eeae6d7786bf12 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Sat, 5 Mar 2022 15:40:11 +0900 Subject: [PATCH 06/14] Print trailing comma for rest elements in tuple types (#12390) * Remove `hasRest` condition for printing tuple types * Update snapshots * Fix test file name * Add changelog --- changelog_unreleased/typescript/12390.md | 45 +++++ src/language-js/print/type-annotation.js | 7 +- .../tuple/__snapshots__/jsfmt.spec.js.snap | 172 +++++++++--------- ...est.ts => trailing-comma-trailing-rest.ts} | 0 4 files changed, 133 insertions(+), 91 deletions(-) create mode 100644 changelog_unreleased/typescript/12390.md rename tests/format/typescript/tuple/{no-trailing-comma-after-rest.ts => trailing-comma-trailing-rest.ts} (100%) diff --git a/changelog_unreleased/typescript/12390.md b/changelog_unreleased/typescript/12390.md new file mode 100644 index 000000000..21be549b9 --- /dev/null +++ b/changelog_unreleased/typescript/12390.md @@ -0,0 +1,45 @@ +#### Print trailing comma for rest elements in tuple types (#12390 by @sosukesuzuki) + +TypeScript allows to put rest elements in places other than the end of tuple types since [4.2](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-2.html#leadingmiddle-rest-elements-in-tuple-types). +Prettier now prints a trailing comma for the trailing rest element as the it may be followed by the next element. + + +```tsx +// { trailingCommma: "all" } + +// Input +type Foo = [ + Element, + Element, + Element, + Element, + Element, + Element, + ...RestElement, +]; + + +// Prettier stable +type Foo = [ + Element, + Element, + Element, + Element, + Element, + Element, + ...RestElement +]; + + +// Prettier main +type Foo = [ + Element, + Element, + Element, + Element, + Element, + Element, + ...RestElement, +]; + +``` diff --git a/src/language-js/print/type-annotation.js b/src/language-js/print/type-annotation.js index 88f4c78cf..6b8ad87f7 100644 --- a/src/language-js/print/type-annotation.js +++ b/src/language-js/print/type-annotation.js @@ -4,7 +4,7 @@ const { printComments, printDanglingComments, } = require("../../main/comments.js"); -const { getLast, isNonEmptyArray } = require("../../common/util.js"); +const { isNonEmptyArray } = require("../../common/util.js"); const { builders: { group, join, line, softline, indent, align, ifBreak }, } = require("../../document/index.js"); @@ -289,7 +289,6 @@ function printTupleType(path, options, print) { const typesField = node.type === "TSTupleType" ? "elementTypes" : "types"; const types = node[typesField]; const isNonEmptyTuple = isNonEmptyArray(types); - const hasRest = isNonEmptyTuple && getLast(types).type === "TSRestType"; const bracketsDelimiterLine = isNonEmptyTuple ? softline : ""; return group([ "[", @@ -297,9 +296,7 @@ function printTupleType(path, options, print) { bracketsDelimiterLine, printArrayItems(path, options, typesField, print), ]), - ifBreak( - isNonEmptyTuple && shouldPrintComma(options, "all") && !hasRest ? "," : "" - ), + ifBreak(isNonEmptyTuple && shouldPrintComma(options, "all") ? "," : ""), printDanglingComments(path, options, /* sameIndent */ true), bracketsDelimiterLine, "]", diff --git a/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap index e2c610475..3f38b0853 100644 --- a/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap @@ -1,91 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`no-trailing-comma-after-rest.ts - {"trailingComma":"all"} format 1`] = ` -====================================options===================================== -parsers: ["typescript"] -printWidth: 80 -trailingComma: "all" - | printWidth -=====================================input====================================== -type ValidateArgs = [ - { - [key: string]: any; - }, - string, - string, - ...string[], -]; - -=====================================output===================================== -type ValidateArgs = [ - { - [key: string]: any; - }, - string, - string, - ...string[] -]; - -================================================================================ -`; - -exports[`no-trailing-comma-after-rest.ts - {"trailingComma":"none"} format 1`] = ` -====================================options===================================== -parsers: ["typescript"] -printWidth: 80 -trailingComma: "none" - | printWidth -=====================================input====================================== -type ValidateArgs = [ - { - [key: string]: any; - }, - string, - string, - ...string[], -]; - -=====================================output===================================== -type ValidateArgs = [ - { - [key: string]: any; - }, - string, - string, - ...string[] -]; - -================================================================================ -`; - -exports[`no-trailing-comma-after-rest.ts format 1`] = ` -====================================options===================================== -parsers: ["typescript"] -printWidth: 80 - | printWidth -=====================================input====================================== -type ValidateArgs = [ - { - [key: string]: any; - }, - string, - string, - ...string[], -]; - -=====================================output===================================== -type ValidateArgs = [ - { - [key: string]: any; - }, - string, - string, - ...string[] -]; - -================================================================================ -`; - exports[`trailing-comma.ts - {"trailingComma":"all"} format 1`] = ` ====================================options===================================== parsers: ["typescript"] @@ -273,6 +187,92 @@ type Foo = ================================================================================ `; +exports[`trailing-comma-trailing-rest.ts - {"trailingComma":"all"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 +trailingComma: "all" + | printWidth +=====================================input====================================== +type ValidateArgs = [ + { + [key: string]: any; + }, + string, + string, + ...string[], +]; + +=====================================output===================================== +type ValidateArgs = [ + { + [key: string]: any; + }, + string, + string, + ...string[], +]; + +================================================================================ +`; + +exports[`trailing-comma-trailing-rest.ts - {"trailingComma":"none"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 +trailingComma: "none" + | printWidth +=====================================input====================================== +type ValidateArgs = [ + { + [key: string]: any; + }, + string, + string, + ...string[], +]; + +=====================================output===================================== +type ValidateArgs = [ + { + [key: string]: any; + }, + string, + string, + ...string[] +]; + +================================================================================ +`; + +exports[`trailing-comma-trailing-rest.ts format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +type ValidateArgs = [ + { + [key: string]: any; + }, + string, + string, + ...string[], +]; + +=====================================output===================================== +type ValidateArgs = [ + { + [key: string]: any; + }, + string, + string, + ...string[] +]; + +================================================================================ +`; + exports[`tuple.ts - {"trailingComma":"all"} format 1`] = ` ====================================options===================================== parsers: ["typescript"] diff --git a/tests/format/typescript/tuple/no-trailing-comma-after-rest.ts b/tests/format/typescript/tuple/trailing-comma-trailing-rest.ts similarity index 100% rename from tests/format/typescript/tuple/no-trailing-comma-after-rest.ts rename to tests/format/typescript/tuple/trailing-comma-trailing-rest.ts From 9828c0c09af523642e63d2a80ef0dca68f9b6473 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Mar 2022 19:05:59 +0800 Subject: [PATCH 07/14] Build(deps-dev): Bump node-fetch from 3.1.1 to 3.2.1 (#12399) Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 3.1.1 to 3.2.1. - [Release notes](https://github.com/node-fetch/node-fetch/releases) - [Commits](https://github.com/node-fetch/node-fetch/compare/v3.1.1...v3.2.1) --- updated-dependencies: - dependency-name: node-fetch dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 8e16a12f0..8a04192ff 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "jest-snapshot-serializer-raw": "1.2.0", "jest-watch-typeahead": "1.0.0", "node-actionlint": "1.2.2", - "node-fetch": "3.1.1", + "node-fetch": "3.2.1", "npm-run-all": "4.1.5", "path-browserify": "1.0.1", "prettier": "2.5.1", diff --git a/yarn.lock b/yarn.lock index 5a3a2d716..023a37972 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3280,7 +3280,7 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fetch-blob@^3.1.2, fetch-blob@^3.1.3: +fetch-blob@^3.1.2, fetch-blob@^3.1.4: version "3.1.4" resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.1.4.tgz#e8c6567f80ad7fc22fd302e7dcb72bafde9c1717" integrity sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA== @@ -4947,13 +4947,13 @@ node-domexception@^1.0.0: resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.1.1.tgz#d0d9607e455b3087e3092b821b5b1f1ebf4c2147" - integrity sha512-SMk+vKgU77PYotRdWzqZGTZeuFKlsJ0hu4KPviQKkfY+N3vn2MIzr0rvpnYpR8MtB3IEuhlEcuOLbGvLRlA+yg== +node-fetch@3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.1.tgz#002177382810cfb77858857f69a3621a86c45f26" + integrity sha512-Ef3SPFtRWFCDyhvcwCSvacLpkwmYZcD57mmZzAsMiks9TpHpIghe32U9H06tMICnr+X7YCpzH7WvUlUoml2urA== dependencies: data-uri-to-buffer "^4.0.0" - fetch-blob "^3.1.3" + fetch-blob "^3.1.4" formdata-polyfill "^4.0.10" node-int64@^0.4.0: From 072b1491ee24d58fae62c895dd80c898c5c5b5a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Mar 2022 19:06:17 +0800 Subject: [PATCH 08/14] Build(deps-dev): Bump eslint-plugin-react from 7.29.2 to 7.29.3 (#12406) Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.29.2 to 7.29.3. - [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases) - [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.29.2...v7.29.3) --- updated-dependencies: - dependency-name: eslint-plugin-react dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8a04192ff..881e3777b 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "eslint-plugin-import": "2.25.4", "eslint-plugin-jest": "26.1.1", "eslint-plugin-prettier-internal-rules": "2.0.1", - "eslint-plugin-react": "7.29.2", + "eslint-plugin-react": "7.29.3", "eslint-plugin-regexp": "1.5.1", "eslint-plugin-unicorn": "41.0.0", "esm-utils": "3.0.0", diff --git a/yarn.lock b/yarn.lock index 023a37972..64656e40d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2992,10 +2992,10 @@ eslint-plugin-prettier-internal-rules@2.0.1: resolved "https://registry.yarnpkg.com/eslint-plugin-prettier-internal-rules/-/eslint-plugin-prettier-internal-rules-2.0.1.tgz#ee6f5b4d663fd16d406f66a0d52775d05be1bd6e" integrity sha512-6mLlbq4xl86c66Smulq2a/bIpTzXDL3LcoYQd/C+kSbjLl8L7G+3wNJs6lWsZZ5v8fyirundQBH6PP/PSAzDMw== -eslint-plugin-react@7.29.2: - version "7.29.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.29.2.tgz#2d4da69d30d0a736efd30890dc6826f3e91f3f7c" - integrity sha512-ypEBTKOy5liFQXZWMchJ3LN0JX1uPI6n7MN7OPHKacqXAxq5gYC30TdO7wqGYQyxD1OrzpobdHC3hDmlRWDg9w== +eslint-plugin-react@7.29.3: + version "7.29.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.29.3.tgz#f4eab757f2756d25d6d4c2a58a9e20b004791f05" + integrity sha512-MzW6TuCnDOcta67CkpDyRfRsEVx9FNMDV8wZsDqe1luHPdGTrQIUaUXD27Ja3gHsdOIs/cXzNchWGlqm+qRVRg== dependencies: array-includes "^3.1.4" array.prototype.flatmap "^1.2.5" From ba1cf72c5b58495c86455292eed4acfa43e035e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Mar 2022 19:06:43 +0800 Subject: [PATCH 09/14] Build(deps-dev): Bump eslint-config-prettier from 8.4.0 to 8.5.0 (#12401) Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.4.0 to 8.5.0. - [Release notes](https://github.com/prettier/eslint-config-prettier/releases) - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.4.0...v8.5.0) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 881e3777b..2dec54a41 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "esbuild-plugin-text-replace": "1.2.0", "esbuild-visualizer": "0.3.1", "eslint": "8.10.0", - "eslint-config-prettier": "8.4.0", + "eslint-config-prettier": "8.5.0", "eslint-formatter-friendly": "7.0.0", "eslint-plugin-compat": "4.0.2", "eslint-plugin-import": "2.25.4", diff --git a/yarn.lock b/yarn.lock index 64656e40d..2c49e2b1a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2915,10 +2915,10 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -eslint-config-prettier@8.4.0: - version "8.4.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.4.0.tgz#8e6d17c7436649e98c4c2189868562921ef563de" - integrity sha512-CFotdUcMY18nGRo5KGsnNxpznzhkopOcOo0InID+sgQssPrzjvsyKZPvOgymTFeHrFuC3Tzdf2YndhXtULK9Iw== +eslint-config-prettier@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" + integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== eslint-formatter-friendly@7.0.0: version "7.0.0" From cb206840303453cdbd962ebdaa55975a6eb296e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Mar 2022 11:08:06 +0000 Subject: [PATCH 10/14] Build(deps-dev): Bump @typescript-eslint/eslint-plugin (#12404) --- package.json | 2 +- yarn.lock | 76 +++++++++++++++++++++++++++++++++++----------------- 2 files changed, 52 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index 2dec54a41..2fbf27aad 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "@glimmer/reference": "0.84.0", "@types/estree": "0.0.51", "@types/jest": "27.4.1", - "@typescript-eslint/eslint-plugin": "5.12.1", + "@typescript-eslint/eslint-plugin": "5.13.0", "babel-jest": "27.5.1", "benchmark": "2.1.4", "browserslist-to-esbuild": "1.1.1", diff --git a/yarn.lock b/yarn.lock index 2c49e2b1a..9d8322dbd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1693,14 +1693,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@5.12.1": - version "5.12.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.12.1.tgz#b2cd3e288f250ce8332d5035a2ff65aba3374ac4" - integrity sha512-M499lqa8rnNK7mUv74lSFFttuUsubIRdAbHcVaP93oFcKkEmHmLqy2n7jM9C8DVmFMYK61ExrZU6dLYhQZmUpw== +"@typescript-eslint/eslint-plugin@5.13.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.13.0.tgz#2809052b85911ced9c54a60dac10e515e9114497" + integrity sha512-vLktb2Uec81fxm/cfz2Hd6QaWOs8qdmVAZXLdOBX6JFJDhf6oDZpMzZ4/LZ6SFM/5DgDcxIMIvy3F+O9yZBuiQ== dependencies: - "@typescript-eslint/scope-manager" "5.12.1" - "@typescript-eslint/type-utils" "5.12.1" - "@typescript-eslint/utils" "5.12.1" + "@typescript-eslint/scope-manager" "5.13.0" + "@typescript-eslint/type-utils" "5.13.0" + "@typescript-eslint/utils" "5.13.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -1708,20 +1708,20 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/scope-manager@5.12.1": - version "5.12.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.12.1.tgz#58734fd45d2d1dec49641aacc075fba5f0968817" - integrity sha512-J0Wrh5xS6XNkd4TkOosxdpObzlYfXjAFIm9QxYLCPOcHVv1FyyFCPom66uIh8uBr0sZCrtS+n19tzufhwab8ZQ== +"@typescript-eslint/scope-manager@5.13.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.13.0.tgz#cf6aff61ca497cb19f0397eea8444a58f46156b6" + integrity sha512-T4N8UvKYDSfVYdmJq7g2IPJYCRzwtp74KyDZytkR4OL3NRupvswvmJQJ4CX5tDSurW2cvCc1Ia1qM7d0jpa7IA== dependencies: - "@typescript-eslint/types" "5.12.1" - "@typescript-eslint/visitor-keys" "5.12.1" + "@typescript-eslint/types" "5.13.0" + "@typescript-eslint/visitor-keys" "5.13.0" -"@typescript-eslint/type-utils@5.12.1": - version "5.12.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.12.1.tgz#8d58c6a0bb176b5e9a91581cda1a7f91a114d3f0" - integrity sha512-Gh8feEhsNLeCz6aYqynh61Vsdy+tiNNkQtc+bN3IvQvRqHkXGUhYkUi+ePKzP0Mb42se7FDb+y2SypTbpbR/Sg== +"@typescript-eslint/type-utils@5.13.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.13.0.tgz#b0efd45c85b7bab1125c97b752cab3a86c7b615d" + integrity sha512-/nz7qFizaBM1SuqAKb7GLkcNn2buRdDgZraXlkhz+vUGiN1NZ9LzkA595tHHeduAiS2MsHqMNhE2zNzGdw43Yg== dependencies: - "@typescript-eslint/utils" "5.12.1" + "@typescript-eslint/utils" "5.13.0" debug "^4.3.2" tsutils "^3.21.0" @@ -1730,6 +1730,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.12.1.tgz#46a36a28ff4d946821b58fe5a73c81dc2e12aa89" integrity sha512-hfcbq4qVOHV1YRdhkDldhV9NpmmAu2vp6wuFODL71Y0Ixak+FLeEU4rnPxgmZMnGreGEghlEucs9UZn5KOfHJA== +"@typescript-eslint/types@5.13.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.13.0.tgz#da1de4ae905b1b9ff682cab0bed6b2e3be9c04e5" + integrity sha512-LmE/KO6DUy0nFY/OoQU0XelnmDt+V8lPQhh8MOVa7Y5k2gGRd6U9Kp3wAjhB4OHg57tUO0nOnwYQhRRyEAyOyg== + "@typescript-eslint/typescript-estree@5.12.1": version "5.12.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.12.1.tgz#6a9425b9c305bcbc38e2d1d9a24c08e15e02b722" @@ -1743,15 +1748,28 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.12.1", "@typescript-eslint/utils@^5.10.0": - version "5.12.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.12.1.tgz#447c24a05d9c33f9c6c64cb48f251f2371eef920" - integrity sha512-Qq9FIuU0EVEsi8fS6pG+uurbhNTtoYr4fq8tKjBupsK5Bgbk2I32UGm0Sh+WOyjOPgo/5URbxxSNV6HYsxV4MQ== +"@typescript-eslint/typescript-estree@5.13.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.13.0.tgz#b37c07b748ff030a3e93d87c842714e020b78141" + integrity sha512-Q9cQow0DeLjnp5DuEDjLZ6JIkwGx3oYZe+BfcNuw/POhtpcxMTy18Icl6BJqTSd+3ftsrfuVb7mNHRZf7xiaNA== + dependencies: + "@typescript-eslint/types" "5.13.0" + "@typescript-eslint/visitor-keys" "5.13.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.13.0", "@typescript-eslint/utils@^5.10.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.13.0.tgz#2328feca700eb02837298339a2e49c46b41bd0af" + integrity sha512-+9oHlPWYNl6AwwoEt5TQryEHwiKRVjz7Vk6kaBeD3/kwHE5YqTGHtm/JZY8Bo9ITOeKutFaXnBlMgSATMJALUQ== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.12.1" - "@typescript-eslint/types" "5.12.1" - "@typescript-eslint/typescript-estree" "5.12.1" + "@typescript-eslint/scope-manager" "5.13.0" + "@typescript-eslint/types" "5.13.0" + "@typescript-eslint/typescript-estree" "5.13.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -1763,6 +1781,14 @@ "@typescript-eslint/types" "5.12.1" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.13.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.13.0.tgz#f45ff55bcce16403b221ac9240fbeeae4764f0fd" + integrity sha512-HLKEAS/qA1V7d9EzcpLFykTePmOQqOFim8oCvhY3pZgQ8Hi38hYpHd9e5GN6nQBFQNecNhws5wkS9Y5XIO0s/g== + dependencies: + "@typescript-eslint/types" "5.13.0" + eslint-visitor-keys "^3.0.0" + abab@^2.0.3, abab@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" From 38913183c9132d6c22ef33b7b6c6b69c1f904af9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Mar 2022 19:08:56 +0800 Subject: [PATCH 11/14] Build(deps): Bump preactjs/compressed-size-action from 2.4.0 to 2.5.0 (#12395) Bumps [preactjs/compressed-size-action](https://github.com/preactjs/compressed-size-action) from 2.4.0 to 2.5.0. - [Release notes](https://github.com/preactjs/compressed-size-action/releases) - [Commits](https://github.com/preactjs/compressed-size-action/compare/2.4.0...2.5.0) --- updated-dependencies: - dependency-name: preactjs/compressed-size-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/prod-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prod-test.yml b/.github/workflows/prod-test.yml index 335834c47..d3db39feb 100644 --- a/.github/workflows/prod-test.yml +++ b/.github/workflows/prod-test.yml @@ -36,7 +36,7 @@ jobs: # It should be the last step - name: Check Sizes if: ${{ github.event_name == 'pull_request' && startsWith(github.head_ref, 'dependabot/npm_and_yarn/') }} - uses: preactjs/compressed-size-action@2.4.0 + uses: preactjs/compressed-size-action@2.5.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" pattern: "./dist/**/*" From c78050fdcdaa90f311b9f6db4fc257fc67318ee3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Mar 2022 13:07:48 +0000 Subject: [PATCH 12/14] Build(deps-dev): Bump esbuild from 0.14.23 to 0.14.25 (#12397) --- package.json | 2 +- yarn.lock | 204 ++++++++++++++++++++++++++------------------------- 2 files changed, 106 insertions(+), 100 deletions(-) diff --git a/package.json b/package.json index 2fbf27aad..ea8a29204 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "cross-env": "7.0.3", "cspell": "5.18.5", "enquirer": "2.3.6", - "esbuild": "0.14.23", + "esbuild": "0.14.25", "esbuild-plugin-text-replace": "1.2.0", "esbuild-visualizer": "0.3.1", "eslint": "8.10.0", diff --git a/yarn.lock b/yarn.lock index 9d8322dbd..a09224e02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2773,80 +2773,85 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -esbuild-android-arm64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.23.tgz#c89b3c50b4f47668dcbeb0b34ee4615258818e71" - integrity sha512-k9sXem++mINrZty1v4FVt6nC5BQCFG4K2geCIUUqHNlTdFnuvcqsY7prcKZLFhqVC1rbcJAr9VSUGFL/vD4vsw== +esbuild-android-64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.25.tgz#d532d38cb5fe0ae45167ce35f4bbc784c636be40" + integrity sha512-L5vCUk7TzFbBnoESNoXjU3x9+/+7TDIE/1mTfy/erAfvZAqC+S3sp/Qa9wkypFMcFvN9FzvESkTlpeQDolREtQ== -esbuild-darwin-64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.23.tgz#1c131e8cb133ed935ca32f824349a117c896a15b" - integrity sha512-lB0XRbtOYYL1tLcYw8BoBaYsFYiR48RPrA0KfA/7RFTr4MV7Bwy/J4+7nLsVnv9FGuQummM3uJ93J3ptaTqFug== +esbuild-android-arm64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.25.tgz#9c5bb3366aabfd14a1c726d36978b79441dfcb6e" + integrity sha512-4jv5xPjM/qNm27T5j3ZEck0PvjgQtoMHnz4FzwF5zNP56PvY2CT0WStcAIl6jNlsuDdN63rk2HRBIsO6xFbcFw== -esbuild-darwin-arm64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.23.tgz#3c6245a50109dd84953f53d7833bd3b4f0e8c6fa" - integrity sha512-yat73Z/uJ5tRcfRiI4CCTv0FSnwErm3BJQeZAh+1tIP0TUNh6o+mXg338Zl5EKChD+YGp6PN+Dbhs7qa34RxSw== +esbuild-darwin-64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.25.tgz#05dcdb6d884f427039ffee5e92ff97527e56c26d" + integrity sha512-TGp8tuudIxOyWd1+8aYPxQmC1ZQyvij/AfNBa35RubixD0zJ1vkKHVAzo0Zao1zcG6pNqiSyzfPto8vmg0s7oA== -esbuild-freebsd-64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.23.tgz#0cdc54e72d3dd9cd992f9c2960055e68a7f8650c" - integrity sha512-/1xiTjoLuQ+LlbfjJdKkX45qK/M7ARrbLmyf7x3JhyQGMjcxRYVR6Dw81uH3qlMHwT4cfLW4aEVBhP1aNV7VsA== +esbuild-darwin-arm64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.25.tgz#28e080da4ea0cfe9498071e7f8060498caee1a95" + integrity sha512-oTcDgdm0MDVEmw2DWu8BV68pYuImpFgvWREPErBZmNA4MYKGuBRaCiJqq6jZmBR1x+3y1DWCjez+5uLtuAm6mw== -esbuild-freebsd-arm64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.23.tgz#1d11faed3a0c429e99b7dddef84103eb509788b2" - integrity sha512-uyPqBU/Zcp6yEAZS4LKj5jEE0q2s4HmlMBIPzbW6cTunZ8cyvjG6YWpIZXb1KK3KTJDe62ltCrk3VzmWHp+iLg== +esbuild-freebsd-64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.25.tgz#200d3664a3b945bc9fdcba73614b49a11ebd1cfa" + integrity sha512-ueAqbnMZ8arnuLH8tHwTCQYeptnHOUV7vA6px6j4zjjQwDx7TdP7kACPf3TLZLdJQ3CAD1XCvQ2sPhX+8tacvQ== -esbuild-linux-32@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.23.tgz#fd9f033fc27dcab61100cb1eb1c936893a68c841" - integrity sha512-37R/WMkQyUfNhbH7aJrr1uCjDVdnPeTHGeDhZPUNhfoHV0lQuZNCKuNnDvlH/u/nwIYZNdVvz1Igv5rY/zfrzQ== +esbuild-freebsd-arm64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.25.tgz#624b08c5da6013bdc312aaa23c4ff409580f5c3c" + integrity sha512-+ZVWud2HKh+Ob6k/qiJWjBtUg4KmJGGmbvEXXW1SNKS7hW7HU+Zq2ZCcE1akFxOPkVB+EhOty/sSek30tkCYug== -esbuild-linux-64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.23.tgz#c04c438514f1359ecb1529205d0c836d4165f198" - integrity sha512-H0gztDP60qqr8zoFhAO64waoN5yBXkmYCElFklpd6LPoobtNGNnDe99xOQm28+fuD75YJ7GKHzp/MLCLhw2+vQ== +esbuild-linux-32@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.25.tgz#0238e597eb0b60aa06c7e98fccbbfd6bb9a0d6c5" + integrity sha512-3OP/lwV3kCzEz45tobH9nj+uE4ubhGsfx+tn0L26WAGtUbmmcRpqy7XRG/qK7h1mClZ+eguIANcQntYMdYklfw== -esbuild-linux-arm64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.23.tgz#d1b3ab2988ab0734886eb9e811726f7db099ab96" - integrity sha512-c4MLOIByNHR55n3KoYf9hYDfBRghMjOiHLaoYLhkQkIabb452RWi+HsNgB41sUpSlOAqfpqKPFNg7VrxL3UX9g== +esbuild-linux-64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.25.tgz#8a8b8cf47dfce127c858e71229d9a385a82c62e8" + integrity sha512-+aKHdHZmX9qwVlQmu5xYXh7GsBFf4TWrePgeJTalhXHOG7NNuUwoHmketGiZEoNsWyyqwH9rE5BC+iwcLY30Ug== -esbuild-linux-arm@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.23.tgz#df7558b6a5076f5eb9fd387c8704f768b61d97fb" - integrity sha512-x64CEUxi8+EzOAIpCUeuni0bZfzPw/65r8tC5cy5zOq9dY7ysOi5EVQHnzaxS+1NmV+/RVRpmrzGw1QgY2Xpmw== +esbuild-linux-arm64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.25.tgz#7ac94371418a2640ba413bc1700aaedeb2794e52" + integrity sha512-UxfenPx/wSZx55gScCImPtXekvZQLI2GW3qe5dtlmU7luiqhp5GWPzGeQEbD3yN3xg/pHc671m5bma5Ns7lBHw== -esbuild-linux-mips64le@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.23.tgz#bb4c47fccc9493d460ffeb1f88e8a97a98a14f8b" - integrity sha512-kHKyKRIAedYhKug2EJpyJxOUj3VYuamOVA1pY7EimoFPzaF3NeY7e4cFBAISC/Av0/tiV0xlFCt9q0HJ68IBIw== +esbuild-linux-arm@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.25.tgz#034bd18e9310b9f010c89f90ef7f05706689600b" + integrity sha512-aTLcE2VBoLydL943REcAcgnDi3bHtmULSXWLbjtBdtykRatJVSxKMjK9YlBXUZC4/YcNQfH7AxwVeQr9fNxPhw== -esbuild-linux-ppc64le@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.23.tgz#a332dbc8a1b4e30cfe1261bfaa5cef57c9c8c02a" - integrity sha512-7ilAiJEPuJJnJp/LiDO0oJm5ygbBPzhchJJh9HsHZzeqO+3PUzItXi+8PuicY08r0AaaOe25LA7sGJ0MzbfBag== +esbuild-linux-mips64le@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.25.tgz#05f98a8cf6b578eab6b4e6b0ab094f37530934f4" + integrity sha512-wLWYyqVfYx9Ur6eU5RT92yJVsaBGi5RdkoWqRHOqcJ38Kn60QMlcghsKeWfe9jcYut8LangYZ98xO1LxIoSXrQ== -esbuild-linux-riscv64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.23.tgz#85675f3f931f5cd7cfb238fd82f77a62ffcb6d86" - integrity sha512-fbL3ggK2wY0D8I5raPIMPhpCvODFE+Bhb5QGtNP3r5aUsRR6TQV+ZBXIaw84iyvKC8vlXiA4fWLGhghAd/h/Zg== +esbuild-linux-ppc64le@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.25.tgz#46fd0add8d8535678439d7a9c2876ad20042d952" + integrity sha512-0dR6Csl6Zas3g4p9ULckEl8Mo8IInJh33VCJ3eaV1hj9+MHGdmDOakYMN8MZP9/5nl+NU/0ygpd14cWgy8uqRw== -esbuild-linux-s390x@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.23.tgz#a526282a696e6d846f4c628f5315475518c0c0f0" - integrity sha512-GHMDCyfy7+FaNSO8RJ8KCFsnax8fLUsOrj9q5Gi2JmZMY0Zhp75keb5abTFCq2/Oy6KVcT0Dcbyo/bFb4rIFJA== +esbuild-linux-riscv64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.25.tgz#ea2e986f0f3e5df73c635135dd778051734fc605" + integrity sha512-J4d20HDmTrgvhR0bdkDhvvJGaikH3LzXQnNaseo8rcw9Yqby9A90gKUmWpfwqLVNRILvNnAmKLfBjCKU9ajg8w== -esbuild-netbsd-64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.23.tgz#8e456605694719aa1be4be266d6cd569c06dfaf5" - integrity sha512-ovk2EX+3rrO1M2lowJfgMb/JPN1VwVYrx0QPUyudxkxLYrWeBxDKQvc6ffO+kB4QlDyTfdtAURrVzu3JeNdA2g== +esbuild-linux-s390x@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.25.tgz#efe89486e9a1b1508925048076e3f3a6698aa6a3" + integrity sha512-YI2d5V6nTE73ZnhEKQD7MtsPs1EtUZJ3obS21oxQxGbbRw1G+PtJKjNyur+3t6nzHP9oTg6GHQ3S3hOLLmbDIQ== -esbuild-openbsd-64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.23.tgz#f2fc51714b4ddabc86e4eb30ca101dd325db2f7d" - integrity sha512-uYYNqbVR+i7k8ojP/oIROAHO9lATLN7H2QeXKt2H310Fc8FJj4y3Wce6hx0VgnJ4k1JDrgbbiXM8rbEgQyg8KA== +esbuild-netbsd-64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.25.tgz#439fe27d8ee3b5887501ee63988e85f920107db6" + integrity sha512-TKIVgNWLUOkr+Exrye70XTEE1lJjdQXdM4tAXRzfHE9iBA7LXWcNtVIuSnphTqpanPzTDFarF0yqq4kpbC6miA== + +esbuild-openbsd-64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.25.tgz#31ebf616aadf6e60674469f2b92cec92280d9930" + integrity sha512-QgFJ37A15D7NIXBTYEqz29+uw3nNBOIyog+3kFidANn6kjw0GHZ0lEYQn+cwjyzu94WobR+fes7cTl/ZYlHb1A== esbuild-plugin-text-replace@1.2.0: version "1.2.0" @@ -2855,10 +2860,10 @@ esbuild-plugin-text-replace@1.2.0: dependencies: ts-replace-all "^1.0.0" -esbuild-sunos-64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.23.tgz#a408f33ea20e215909e20173a0fd78b1aaad1f8e" - integrity sha512-hAzeBeET0+SbScknPzS2LBY6FVDpgE+CsHSpe6CEoR51PApdn2IB0SyJX7vGelXzlyrnorM4CAsRyb9Qev4h9g== +esbuild-sunos-64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.25.tgz#815e4f936d74970292a63ccfd5791fe5e3569f5f" + integrity sha512-rmWfjUItYIVlqr5EnTH1+GCxXiBOC42WBZ3w++qh7n2cS9Xo0lO5pGSG2N+huOU2fX5L+6YUuJ78/vOYvefeFw== esbuild-visualizer@0.3.1: version "0.3.1" @@ -2869,45 +2874,46 @@ esbuild-visualizer@0.3.1: open "^7.4.2" yargs "^16.2.0" -esbuild-windows-32@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.23.tgz#b9005bbff54dac3975ff355d5de2b5e37165d128" - integrity sha512-Kttmi3JnohdaREbk6o9e25kieJR379TsEWF0l39PQVHXq3FR6sFKtVPgY8wk055o6IB+rllrzLnbqOw/UV60EA== +esbuild-windows-32@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.25.tgz#189e14df2478f2c193c86968ab1fb54e1ceaafd2" + integrity sha512-HGAxVUofl3iUIz9W10Y9XKtD0bNsK9fBXv1D55N/ljNvkrAYcGB8YCm0v7DjlwtyS6ws3dkdQyXadbxkbzaKOA== -esbuild-windows-64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.23.tgz#2b5a99befeaca6aefdad32d738b945730a60a060" - integrity sha512-JtIT0t8ymkpl6YlmOl6zoSWL5cnCgyLaBdf/SiU/Eg3C13r0NbHZWNT/RDEMKK91Y6t79kTs3vyRcNZbfu5a8g== +esbuild-windows-64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.25.tgz#3d5fbfdc3856850bb47439299e3b60dd18be111f" + integrity sha512-TirEohRkfWU9hXLgoDxzhMQD1g8I2mOqvdQF2RS9E/wbkORTAqJHyh7wqGRCQAwNzdNXdg3JAyhQ9/177AadWA== -esbuild-windows-arm64@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.23.tgz#edc560bbadb097eb45fc235aeacb942cb94a38c0" - integrity sha512-cTFaQqT2+ik9e4hePvYtRZQ3pqOvKDVNarzql0VFIzhc0tru/ZgdLoXd6epLiKT+SzoSce6V9YJ+nn6RCn6SHw== +esbuild-windows-arm64@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.25.tgz#8b243cbbad8a86cf98697da9ccb88c05df2ef458" + integrity sha512-4ype9ERiI45rSh+R8qUoBtaj6kJvUOI7oVLhKqPEpcF4Pa5PpT3hm/mXAyotJHREkHpM87PAJcA442mLnbtlNA== -esbuild@0.14.23: - version "0.14.23" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.23.tgz#95e842cb22bc0c7d82c140adc16788aac91469fe" - integrity sha512-XjnIcZ9KB6lfonCa+jRguXyRYcldmkyZ99ieDksqW/C8bnyEX299yA4QH2XcgijCgaddEZePPTgvx/2imsq7Ig== +esbuild@0.14.25: + version "0.14.25" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.25.tgz#ddb9d47b91ca76abb7d850ce3dfed0bc3dc88d16" + integrity sha512-4JHEIOMNFvK09ziiL+iVmldIhLbn49V4NAVo888tcGFKedEZY/Y8YapfStJ6zSE23tzYPKxqKwQBnQoIO0BI/Q== optionalDependencies: - esbuild-android-arm64 "0.14.23" - esbuild-darwin-64 "0.14.23" - esbuild-darwin-arm64 "0.14.23" - esbuild-freebsd-64 "0.14.23" - esbuild-freebsd-arm64 "0.14.23" - esbuild-linux-32 "0.14.23" - esbuild-linux-64 "0.14.23" - esbuild-linux-arm "0.14.23" - esbuild-linux-arm64 "0.14.23" - esbuild-linux-mips64le "0.14.23" - esbuild-linux-ppc64le "0.14.23" - esbuild-linux-riscv64 "0.14.23" - esbuild-linux-s390x "0.14.23" - esbuild-netbsd-64 "0.14.23" - esbuild-openbsd-64 "0.14.23" - esbuild-sunos-64 "0.14.23" - esbuild-windows-32 "0.14.23" - esbuild-windows-64 "0.14.23" - esbuild-windows-arm64 "0.14.23" + esbuild-android-64 "0.14.25" + esbuild-android-arm64 "0.14.25" + esbuild-darwin-64 "0.14.25" + esbuild-darwin-arm64 "0.14.25" + esbuild-freebsd-64 "0.14.25" + esbuild-freebsd-arm64 "0.14.25" + esbuild-linux-32 "0.14.25" + esbuild-linux-64 "0.14.25" + esbuild-linux-arm "0.14.25" + esbuild-linux-arm64 "0.14.25" + esbuild-linux-mips64le "0.14.25" + esbuild-linux-ppc64le "0.14.25" + esbuild-linux-riscv64 "0.14.25" + esbuild-linux-s390x "0.14.25" + esbuild-netbsd-64 "0.14.25" + esbuild-openbsd-64 "0.14.25" + esbuild-sunos-64 "0.14.25" + esbuild-windows-32 "0.14.25" + esbuild-windows-64 "0.14.25" + esbuild-windows-arm64 "0.14.25" escalade@^3.1.1: version "3.1.1" From fa380feb95f30c16a5c05796243ac29f596bd248 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 10:55:49 +0800 Subject: [PATCH 13/14] Build(deps): Bump node-fetch from 3.2.0 to 3.2.1 in /scripts/release (#12407) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- scripts/release/package.json | 2 +- scripts/release/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/release/package.json b/scripts/release/package.json index 8084a11c0..36ecb1f8b 100644 --- a/scripts/release/package.json +++ b/scripts/release/package.json @@ -8,7 +8,7 @@ "chalk": "4.1.2", "execa": "6.1.0", "minimist": "1.2.5", - "node-fetch": "3.2.0", + "node-fetch": "3.2.1", "outdent": "0.8.0", "semver": "7.3.5", "string-width": "5.1.0" diff --git a/scripts/release/yarn.lock b/scripts/release/yarn.lock index 18e991c85..566d83d3b 100644 --- a/scripts/release/yarn.lock +++ b/scripts/release/yarn.lock @@ -2215,10 +2215,10 @@ node-domexception@^1.0.0: resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.0.tgz#59390db4e489184fa35d4b74caf5510e8dfbaf3b" - integrity sha512-8xeimMwMItMw8hRrOl3C9/xzU49HV/yE6ORew/l+dxWimO5A4Ra8ld2rerlJvc/O7et5Z1zrWsPX43v1QBjCxw== +node-fetch@3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.1.tgz#002177382810cfb77858857f69a3621a86c45f26" + integrity sha512-Ef3SPFtRWFCDyhvcwCSvacLpkwmYZcD57mmZzAsMiks9TpHpIghe32U9H06tMICnr+X7YCpzH7WvUlUoml2urA== dependencies: data-uri-to-buffer "^4.0.0" fetch-blob "^3.1.4" From e2357ef2ab6b21f72ddc508beff81a438bf6666a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 10:58:38 +0800 Subject: [PATCH 14/14] Build(deps-dev): Bump webpack from 5.69.1 to 5.70.0 in /website (#12398) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- website/package.json | 2 +- website/yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/website/package.json b/website/package.json index e4a847cbb..2861234c3 100644 --- a/website/package.json +++ b/website/package.json @@ -20,7 +20,7 @@ "concurrently": "7.0.0", "docusaurus": "1.14.7", "js-yaml": "4.1.0", - "webpack": "5.69.1", + "webpack": "5.70.0", "webpack-cli": "4.9.2" } } diff --git a/website/yarn.lock b/website/yarn.lock index 2ae37f67f..031488668 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -3195,10 +3195,10 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^5.8.3: - version "5.8.3" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz#6d552d465cce0423f5b3d718511ea53826a7b2f0" - integrity sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA== +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" @@ -8257,10 +8257,10 @@ webpack-sources@^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.69.1: - version "5.69.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.69.1.tgz#8cfd92c192c6a52c99ab00529b5a0d33aa848dc5" - integrity sha512-+VyvOSJXZMT2V5vLzOnDuMz5GxEqLk7hKWQ56YxPW/PQRUuKimPqmEIJOx8jHYeyo65pKbapbW464mvsKbaj4A== +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" @@ -8271,7 +8271,7 @@ webpack@5.69.1: acorn-import-assertions "^1.7.6" browserslist "^4.14.5" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.8.3" + enhanced-resolve "^5.9.2" es-module-lexer "^0.9.0" eslint-scope "5.1.1" events "^3.2.0"